File tree Expand file tree Collapse file tree 1 file changed +14
-13
lines changed
Expand file tree Collapse file tree 1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -1923,19 +1923,6 @@ impl LanguageClient {
19231923 } )
19241924 . map ( Clone :: clone)
19251925 . collect :: < Vec < _ > > ( ) ;
1926- diagnostics. sort_by_key (
1927- // First sort by line.
1928- // Then severity descendingly. Error should come last since when processing item comes
1929- // later will override its precedance.
1930- // Then by character descendingly.
1931- |diagnostic| {
1932- (
1933- diagnostic. range . start . line ,
1934- -( diagnostic. severity . unwrap_or ( DiagnosticSeverity :: Hint ) as i8 ) ,
1935- -( diagnostic. range . start . line as i64 ) ,
1936- )
1937- } ,
1938- ) ;
19391926
19401927 self . update ( |state| {
19411928 state
@@ -1949,6 +1936,20 @@ impl LanguageClient {
19491936 if filename != current_filename. canonicalize ( ) {
19501937 return Ok ( ( ) ) ;
19511938 }
1939+
1940+ // Sort diagnostics as pre-process for display.
1941+ // First sort by line.
1942+ // Then severity descending. Error should come last since when processing item comes
1943+ // later will override its precedence.
1944+ // Then by character descending.
1945+ diagnostics. sort_by_key ( |diagnostic| {
1946+ (
1947+ diagnostic. range . start . line ,
1948+ -( diagnostic. severity . unwrap_or ( DiagnosticSeverity :: Hint ) as i8 ) ,
1949+ -( diagnostic. range . start . line as i64 ) ,
1950+ )
1951+ } ) ;
1952+
19521953 self . process_diagnostics ( & current_filename, & diagnostics) ?;
19531954 self . update ( |state| {
19541955 state. viewports . remove ( & filename) ;
You can’t perform that action at this time.
0 commit comments