Fix F# semantic classification for delegates, slices, CEs, open type#19960
Conversation
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
4c44aad to
1637561
Compare
…5/7) Items 1/2/5/7 are completion-safe and shipped here: - item 1: suppress the synthesized delegate Invoke value over the `delegate of ...` RHS - item 2: classify CE builders inside list/array comprehensions as ComputationExpression - item 5: don't paint slice brackets as Method; fix open-ended slice upper-bound range - item 7: `open type T` is not unused when its static members/fields or DU cases are used Items 3/4/6 (generic `<...>` argument colorization) are deferred: narrowing the shared name-resolution range to fix colorization breaks find-all-references, completion and parameter-info, because the resolution sink matches symbol uses by exact range end. The correct fix requires separating classification ranges from symbol-use ranges in the sink. Guard tests assert the IDE features still work. Co-authored-by: Copilot <[email protected]>
|
@copilot resolve the merge conflicts in this pull request |
T-Gro
left a comment
There was a problem hiding this comment.
🤖 This review was generated by AI (@expert-reviewer agent). Findings may contain inaccuracies — please verify independently.
Nice, well-targeted set of fixes with thorough regression tests. The range1 → range2 change in ExpandIndexArgs correctly attaches the synthesized None of an open-ended slice's upper bound to the upper-bound range. A few suppression heuristics look slightly broader than the bugs they target — flagged inline for verification (all editor-classification only, low severity).
Responds to the expert-reviewer feedback on the editor semantic-classification fixes: - GetSlice/SetSlice suppression: document why the synthesized indexer (xs[a..]) cannot be distinguished from an explicit .GetSlice(..) call in this pass (no source text; both Item.MethodGroup resolutions cover the receiver). The broad suppression is an intentional trade-off. - open type unused-detection: clarify that recording static-member/static-field uses against the declaring entity mirrors existing open <module> behavior, and add a regression test asserting open type and open <module> behave consistently when their members are only ever used fully qualified. Co-authored-by: Copilot <[email protected]>
The merge=union driver on docs/release-notes/**/*.md dropped main's #19960 and #19883 entries when merging main into the branch. Restore main's file and keep only our FS0039 entry as the added change. Co-authored-by: Copilot <[email protected]>
Addresses #19905. Four F# editor semantic-classification errors:
delegate of …signature as a method.ComputationExpression.]of an open-ended slice (xs[0..]) is no longer classified asFunction/Method.open type Tis no longer reported as unused when its static members, static fields, or DU cases are used.The generic-argument colorization items (
Type<int>.Member, generic constructor/method calls) are deferred: narrowing the shared name-resolution range to fix coloring breaks find-all-references, completion, and parameter-info.