Repository navigation
fix(compiler): highlight type-reference names without template arguments - #12202
Open
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Open
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Timothee Guerin (timotheeguerin) wants to merge 2 commits into
Conversation
commit: |
Contributor
|
All changed packages have been documented.
Show changes
|
Timothee Guerin (timotheeguerin)
marked this pull request as ready for review
October 15, 2026 15:20
Timothee Guerin (timotheeguerin)
requested review from
catalinaperalta,
iscai-msft,
Laurent Mazuel (lmazuel) and
Mark Cowlishaw (markcowl)
as code owners
October 15, 2026 15:20
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change matches the requested behavior, preserves default ranges, and includes targeted regression coverage.
0 open findings
What changed in this PR
Fixes #8087 by narrowing diagnostic highlights to type-reference names while preserving full ranges when locateId is omitted.
Changes:
- Highlights
FooorN.Foowithout template arguments. - Adds regression tests for default and narrowed ranges.
- Documents the behavior and adds a compiler changelog entry.
| File | Description |
|---|---|
| packages/compiler/test/core/diagnostics.test.ts | Tests default, simple, and qualified reference highlights. |
| packages/compiler/src/core/diagnostics.ts | Narrows type-reference locations when locateId is enabled. |
| .chronus/changes/fix-diagnostic-type-reference-2026-9-15-11-16-18.md | Records the compiler diagnostic fix. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
You can try these changes here
|
Timothee Guerin (timotheeguerin)
enabled auto-merge
October 16, 2026 13:52
This branch has not been deployed
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.
Diagnostics targeting a generic type reference currently underline all its template arguments, making the actual target harder to identify.
Narrow diagnostic highlights to the reference target:
Foo<string>highlightsFoo, andN.Foo<string>highlightsN.Foo. Calls togetSourceLocationwithoutlocateIdretain the full reference range.Fixes #8087