Skip to content

Commit

Permalink
Remove fix_diagnostic workaround, it's not bug of rust-analzyer.
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Jun 29, 2023
1 parent e13ba84 commit cfb94f8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions core/fileaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,9 @@ def sort_diagnostic(self, diagnostic_a, diagnostic_b):
else:
return 0

def fix_diagnostic(self, diagnostics):
if self.single_server_info and self.single_server_info["name"] == "rust-analyzer":
diagnostics = list(filter(lambda d: d["source"] == "rustc", diagnostics))

return diagnostics

def record_diagnostics(self, diagnostics, server_name):
log_time("Record diagnostics from '{}' for file {}".format(server_name, os.path.basename(self.filepath)))

# Fix some LSP server return wrong diagnostics, such as rust-analyzer.
diagnostics = self.fix_diagnostic(diagnostics)

# Record diagnostics data that push from LSP server.
import functools
self.diagnostics[server_name] = sorted(diagnostics, key=functools.cmp_to_key(self.sort_diagnostic))
Expand Down

0 comments on commit cfb94f8

Please sign in to comment.