-
Notifications
You must be signed in to change notification settings - Fork 291
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
Never return error for diagnostics request #981
Never return error for diagnostics request #981
Conversation
@swift-ci Please test |
// VS Code does not request diagnostics again for a document if the diagnostics request failed. | ||
// Since sourcekit-lsp usually recovers from failures (e.g. after sourcekitd crashes), this is undesirable. | ||
// Instead of returning an error, return empty results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a VS Code thing or an extension thing? Because IMO it's useful to distinguish between having results and not (consider eg. deciding whether to replace previous issues or not).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK it’s a VS Code thing. @adam-fowler to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a VSCode thing. The extension doesn't have control over when VSCode asks for diagnostics.
Out of interest the "failed" diagnostics request, does that mean no response was returned or that an error response was returned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By “failed” I meant an error response. The workaround for this issue is to always return empty diagnostics instead whenever we previously returned an error response.
VS Code does not request diagnostics again for a document if the diagnostics request failed. Since sourcekit-lsp usually recovers from failures (e.g. after sourcekitd crashes), this is undesirable. Instead of returning an error, return empty results.
32cb77f
to
4c8aea2
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
VS Code does not request diagnostics again for a document if the diagnostics request failed. Since sourcekit-lsp usually recovers from failures (e.g. after sourcekitd crashes), this is undesirable. Instead of returning an error, return empty results.