Skip to content

Commit

Permalink
sort the diagnostics by the line number
Browse files Browse the repository at this point in the history
Before:
plugin/configuration.py:
  10:32  error   Expected ":" ​Pyright
  11:13  error   Expected expression ​Pyright
  12:14  error   Expected expression ​Pyright
  13:13  error   Unexpected indentation ​Pyright
  15:5   error   Unindent not expected ​Pyright
  21:1   error   Unindent not expected ​Pyright
  13:13  error   "self" is not defined ​Pyright (reportUndefinedVariable)

After:
plugin/configuration.py:
  10:32  error   Expected ":" ​Pyright
  11:13  error   Expected expression ​Pyright
  12:14  error   Expected expression ​Pyright
  13:13  error   "self" is not defined ​Pyright (reportUndefinedVariable)
  13:13  error   Unexpected indentation ​Pyright
  15:5   error   Unindent not expected ​Pyright
  21:1   error   Unindent not expected ​Pyright
  • Loading branch information
predragnikolic authored and rwols committed Dec 10, 2020
1 parent ff768b1 commit 3757d08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ def diagnostics_panel_contribution_async(self) -> List[str]:
data = sb.data_per_severity.get(severity)
if data:
result.extend(data.panel_contribution)
return result
# sort the result by asc line number
return sorted(result)

def diagnostics_async(self) -> Generator[Tuple[SessionBuffer, List[Diagnostic]], None, None]:
for sb in self.session_buffers_async():
Expand Down

0 comments on commit 3757d08

Please sign in to comment.