microsoft / microsoft/vscode-languageserver-node
VS Code reports errors for semantic tokens that include newlines, should be stripped by the client?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 404
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 14
Description
About Semantic Tokens, the LSP spec says (reasonably IMO):
If multiline tokens are not supported and a tokens length takes it past the end of the line, it should be treated as if the token ends at the end of the line and will not wrap onto the next line.
However VS Code does not support this, it instead writes an error to the console - even if it is only the line ending (which is valid IMO) included in the range.
The suggestion at https://github.com/microsoft/vscode/issues/244266#issuecomment-2929886707 is that the LSP client "truncates" any LSP tokens that include the new line character (or any further characters) in their range, or that the spec is updated to remove this (I think this is a breaking change, and I also think it is a bad change - since IMO a newline that's part of a multiline string should still be included in a token).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name repository files or tests. Start by tracing semantic-token range handling in the client and reviewing the LSP rule alongside the linked VS Code discussion. Determine whether newline-crossing ranges should be truncated or the specification changed; done means the chosen behavior is documented and covered for a range ending at a line break.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100