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

[Enhancement] Improve cancellation support in LSP server #215

Open
mattmasson opened this issue May 21, 2024 · 0 comments
Open

[Enhancement] Improve cancellation support in LSP server #215

mattmasson opened this issue May 21, 2024 · 0 comments

Comments

@mattmasson
Copy link
Member

Feature

  • Handlers should return ResponseError on cancellation
  • Ensure all LSP operations are passing through cancellation tokens
  • Cancellation occurrence should be traced but should not be considered an error

Example of runSafeAsync implementation -
https://github.com/microsoft/vscode/blob/aa31bfc9fd1746626b3efe86f41b9c172d5f4d23/extensions/css-language-features/server/src/utils/runner.ts#L21

Other implementation examples can be found in the vscode tree:
https://github.com/microsoft/vscode/tree/aa31bfc9fd1746626b3efe86f41b9c172d5f4d23/extensions/css-language-features/server/src

Implementation / Validation Notes

We should ensure that operations such as documentSymbols, diagnostics, and semantic tokens are only run once for a given document. A new request should automatically cancel the previous request. A quick scan of other LSP implementations indicates that this should be handled for us automatically by the LSP framework - we shouldn't need explicit handling / debouncing.

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

No branches or pull requests

1 participant