microsoft / microsoft/vscode-powerquery

[Enhancement] Improve cancellation support in LSP server

Open
#215 0 comments 0 reactions 1 assignee View on GitHub

@mattmasson is already working on this.

Since Sep 8, 2025.

Dominant language
TypeScript
Stars
108
Forks
25
Avg merge
8d 22h
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.