microsoft / microsoft/language-server-protocol

Add ```serverCancelled``` support for ```textDocument/documentSymbol```

Open
#2,069 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

document symbols feature-request
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

Problem

I am working on developing a language server for the rocq prover, https://github.com/coq/vscoq.
I have recently run into a problem with the document outline (in vscode).
In a recent change, I parse the document incrementally, using events that get popped up in an event loop. Many times the textDocument/documentSymbol request gets sent before the parsing of the document is finished.

Tried solutions

The first solution I explored was using progress based. Unfortunately it seems that vscode does not send a partialResultToken or a workDoneToken in the request although I did opt-in through the capabilities. Maybe there is a subtlety I do not understand ?

The second solution I explored comes from the disccusion in #1367 where it is suggested that after receiving a ServerCancelled error code the client well then re-send the request later. This does not seem to be happening for the documentSymbol request.

After some digging in the spec, it seems documentSymbol is not cancellable ? Compared to the semanticTokensClientCapabilities it does not contain the serverCancelledSupport field.

Proposed solution

Could we add serverCancelled support to the documentSymbol request ?

Related

Related to #1572 and #1367.

Also related to https://github.com/microsoft/vscode/issues/135453

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.

Research direction

Start with the textDocument/documentSymbol request and compare its capabilities with semanticTokensClientCapabilities in the LSP specification. Review the discussion in #1367 and related issue #1572, along with the linked VS Code issue, to understand the expected cancellation behavior. Done means the protocol's serverCancelled support is clearly specified for documentSymbol.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.