Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only publish diagnostics when they change #717

Open
radeksimko opened this issue Nov 17, 2021 · 0 comments
Open

Only publish diagnostics when they change #717

radeksimko opened this issue Nov 17, 2021 · 0 comments

Comments

@radeksimko
Copy link
Member

Background

Previously we would re-publish any (if any) diagnostics as part of RPC request handlers textDocument/didOpen, textDocument/didChange etc. Since #714 and also because we always maintain a cache of diagnostics in memdb we have an opportunity to compare new vs old diagnostics and only publish diagnostics if they actually changed and avoid unnecessary RPC chatter.

This is what gopls reportedly does: microsoft/language-server-protocol#1217

Use-cases

Reduce the amount of RPC notifications sent for publishing diagnostics from the server to the client.

Attempted Solutions

Re-publish any time any aspect of the module changes (#714).

Proposal

  • Implement equality comparison for diagnostics
  • TODO: figure out how and when do validate diagnostics get cleared
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants