Resolve diagnostic node mapping for value entities in getNodeForTarget#10921
Open
Copilot wants to merge 8 commits into
Open
Resolve diagnostic node mapping for value entities in getNodeForTarget#10921Copilot wants to merge 8 commits into
getNodeForTarget#10921Copilot wants to merge 8 commits into
Conversation
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
timotheeguerin
June 8, 2026 18:54
View session
commit: |
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot
AI
changed the title
Prevent html-program-viewer crash when search renders malformed type nodes
Guard html-program-viewer search/tree icon rendering against missing type kind
Jun 8, 2026
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Co-authored-by: timotheeguerin <1031227+timotheeguerin@users.noreply.github.com>
Copilot
AI
changed the title
Guard html-program-viewer search/tree icon rendering against missing type kind
Resolve diagnostic node mapping for value entities in Jun 8, 2026
getNodeForTarget
|
You can try these changes here
|
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 were resolving targets as if all entities were types, which could surface the wrong source location when the target was a value (notably function values). This change makes node extraction entity-aware so diagnostics map to the actual originating node for values and mixed constraints.
Problem context
TypeSpecDiagnosticTargetincludesEntity, butgetNodeForTargetonly handled symbols/nodes/types, so value entities could be rendered with misleading locations.Compiler change: entity-aware target resolution
getNodeForTargetnow explicitly handlesentityKindbranches:Type→target.nodeValue→ value node (when present) with fallback totarget.type.nodeMixedParameterConstraint→node ?? type.node ?? valueType.node(documented precedence)Indeterminate→target.type.nodegetValueNode(value)to centralize node extraction for value kinds that carry syntax nodes (Function,ObjectValue,ArrayValue).Coverage added