Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements semantic token support for the TypeScript language server, enabling syntax highlighting based on semantic understanding of code (types, symbols, modifiers) rather than just syntax. This is a major editor feature that enhances the developer experience.
Key changes:
- Added semantic token generation in the language service layer with type-based classification and modifier detection
- Integrated semantic token handlers into the LSP server with support for both full-document and range-based requests
- Created extensive test infrastructure with 40+ test files covering various semantic classification scenarios
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ls/semantictokens.go | New file implementing semantic token collection, classification, and LSP encoding logic |
| internal/lsp/server.go | Adds LSP handlers for semantic tokens requests and advertises semantic token capability |
| internal/fourslash/semantictokens.go | Test utilities for verifying semantic token output |
| internal/fourslash/fourslash.go | Updates test framework to support semantic token client capabilities |
| internal/fourslash/_scripts/convertFourslash.mts | Adds parsing support for semantic classification test cases |
| testdata/baselines/reference/*.jsonc | Updated test baselines showing improved behavior for rename/reference operations |
| internal/fourslash/tests/gen/*.go | 40+ generated test files for semantic token verification |
| internal/fourslash/tests/manual/*.go | Manual test for semantic token classification |
Member
Wasn't the same true for document highlights and semantic tokens? Does it feel reasonable in a larger codebase? |
Member
|
Ah, but we didn't make more checkers. |
gyanu1
reviewed
Nov 16, 2025
internal/fourslash/tests/gen/syntacticClassificationsConflictDiff3Markers1_test.go
Show resolved
Hide resolved
gyanu1
reviewed
Nov 16, 2025
internal/fourslash/tests/gen/syntacticClassificationsConflictMarkers1_test.go
Show resolved
Hide resolved
gyanu1
reviewed
Nov 16, 2025
internal/fourslash/tests/gen/syntacticClassificationsConflictDiff3Markers2_test.go
Show resolved
Hide resolved
gyanu1
reviewed
Nov 16, 2025
internal/fourslash/tests/gen/syntacticClassificationsMergeConflictMarker1_test.go
Show resolved
Hide resolved
jakebailey
commented
Nov 17, 2025
Member
Author
|
Drafting this for now, until we can improve the checker situation IMO |
67765eb to
6463a4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1894
I am a little scared of this one. VS Code seems to ask for doc highlights, semantic tokens, diags, all in quick succession. All three of those require checkers, which means we are likely creating 3 checkers to handle these. 4 if we merge inlay hints.