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

Move from open/close/save diagnostics to textDocument/diagnostics #279

Open
karthiknadig opened this issue Oct 16, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@karthiknadig
Copy link

With this you can enable support for whole workspace and related document diagnostics.

@dhruvmanila
Copy link
Member

Thanks! The DocumentDiagnosticReportKind.Unchanged feature is nice as it kinda acts like a cache and the editor doesn't need to re-render the diagnostics. Does this mean that refreshing the diagnostic is client's responsibility as this is a pull model?

@dhruvmanila dhruvmanila added the enhancement New feature or request label Oct 18, 2023
@karthiknadig
Copy link
Author

Yes, client decides when diagnostics is pulled for a file or workspace.

@karthiknadig
Copy link
Author

Just wanted to add some bit of info for this:

  1. This adds 3 "reporting scopes"
    1. document level: (default) client will basically call textDocument/diagnostic on each open document.
    2. dependent-document: you have to enable this mode from the server by setting dependent document diagnostic. What happens here is that you would get textDocument/diagnostic for a document, your response can include diagnostic for multiple documents that the said document depends on.
    3. workspace scope: This is a separate request workspace/diagnostic, the result of this request is expected to include all document diagnostics.
  2. You don't control when the diagnostics are reported. the client will always ask for it when it determines this is needed. So things like onType diagnostic might have to be redefined, as the client will decide how often this is called.

@dhruvmanila
Copy link
Member

This is useful information. Thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants