Fix colorization of type name in MyType<Qualified.Name>.StaticMember#19800
Fix colorization of type name in MyType<Qualified.Name>.StaticMember#19800T-Gro wants to merge 2 commits into
Conversation
Accept ItemOccurrence.InvalidUse in LegitTypeOccurrence so that the type-name span in expressions like MyType<System.Int32>.S - which name resolution flags as InvalidUse via isWrongItemInExpr - is still classified as a ReferenceType, matching the behavior for the unqualified form MyType<int>.S. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
T-Gro
left a comment
There was a problem hiding this comment.
Review
The core fix is correct and well-reasoned. Adding ItemOccurrence.InvalidUse to LegitTypeOccurrence is the right approach — InvalidUse is only ever emitted for Item.Types items resolved in expression position (via isWrongItemInExpr in NameResolution.fs:4233-4236), so it's always semantically a type that deserves colorization.
The tests are well-structured, covering both the positive case (generic type with qualified type arg gets colored) and the safety invariant (undeclared identifiers don't get false type classification).
Issue to fix before merge
Remove .executor-pid — this file was accidentally committed in 2e24ca91. It's a dev artifact and should not be in the repository.
# .gitignore or remove the file:
git rm .executor-pid
git commit --amend # or a new commit
Minor observation
The FSharpCheckerResults.fs line:
| CNR(_, ItemOccurrence.InvalidUse, _, _, _, _) :: _, _ -> NameResResult.Empty...already correctly blocks autocomplete for InvalidUse items, so this change doesn't affect completions — only semantic classification. Good separation of concerns.
Fixes #18009
Fixes syntax colorization when a qualified type name with generic parameters is used in a static member access expression.