microsoft / microsoft/TypeScript
Expose semantic token command type
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Suggestion
🔍 Search Terms
language server protocol, semantic tokens, full, range, syntax highlight,
✅ Viability Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
⭐ Suggestion
Hi. I'd like to get the LSP equivalent of textDocument/semanticTokens, which the Typescript codebase seems to call getSemanticTokens(), but it doesn't look like that's an available command type.
📃 Motivating Example
{"seq":1,"type":"request","command":"getSemanticTokens","arguments":{"file":"/home/user/example.ts"}}
💻 Use Cases
I'd like to have tsserver send me tokens so that I can do syntax highlighting without my editor having to understand JS/TS/etc.
Contributor guide
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
Start with lib/protocol.d.ts and the existing getSemanticTokens() entry point mentioned in the issue. Compare the requested textDocument/semanticTokens equivalent with the example tsserver request, then verify that the command type and request shape are exposed for editor clients.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, developer-experience
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100