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

Collect publish-based LSP diagnostics in background #746

Open
falko17 opened this issue Jun 16, 2024 · 0 comments
Open

Collect publish-based LSP diagnostics in background #746

falko17 opened this issue Jun 16, 2024 · 0 comments
Labels
Improvement Improvement of existing features

Comments

@falko17
Copy link
Collaborator

falko17 commented Jun 16, 2024

As part of the LSP import process, we have to collect diagnostics, which are used to display erosion icons.

LSP diagnostics can be sent to the client in two ways:

  • Pull-based, which is no problem—we can just query each file for its diagnostics as we construct the graph. However, barely any language server has implemented this, as it is a recent (LSP 3.17) feature.
  • Publish-based, which the vast majority of language servers actually use. This is an issue, as we have to wait for the server to emit diagnostics for each file we opened. We cannot actually wait until all diagnostics are present, since there is (AFAIK) no notification that tells us that diagnostics processing is done.

Currently, we handle publish-based diagnostics by listening for diagnostic messages until the end of the LSP import process, any further diagnostics are then lost. This should be changed so that diagnostics keep being collected in the background, updating the nodes in the process. Additionally, the ErosionIssues has to become an observer of the nodes and has to update the icons whenever a change occurs, preferably only once per frame (or even less often than that).

@falko17 falko17 added the Improvement Improvement of existing features label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improvement of existing features
Projects
None yet
Development

No branches or pull requests

1 participant