File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -1923,19 +1923,6 @@ impl LanguageClient {
1923
1923
} )
1924
1924
. map ( Clone :: clone)
1925
1925
. 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
- ) ;
1939
1926
1940
1927
self . update ( |state| {
1941
1928
state
@@ -1949,6 +1936,20 @@ impl LanguageClient {
1949
1936
if filename != current_filename. canonicalize ( ) {
1950
1937
return Ok ( ( ) ) ;
1951
1938
}
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
+
1952
1953
self . process_diagnostics ( & current_filename, & diagnostics) ?;
1953
1954
self . update ( |state| {
1954
1955
state. viewports . remove ( & filename) ;
You can’t perform that action at this time.
0 commit comments