Skip to content

Commit 09db23f

Browse files
T-GroCopilot
andcommitted
Exclude infix applications from leaf-func-expr fallback in getAllCurriedArgsAtPosition
The rangeContainsPos fallback (for narrowed symbol-use ranges) was matching infix operator applications like "a === b" where pos points at the operator. This caused parameter name hints to appear for custom operators used in infix position. Fix: Gate the fallback on 'not isInfix' so it only applies to prefix function applications (dotted accesses, qualified names), which was the original intent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5f1c3a4 commit 09db23f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/Compiler/Service/ServiceParamInfoLocations.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,11 @@ module internal SynExprAppLocationsImpl =
483483
// pos may point at the terminal identifier rather than the full long-id start.
484484
// The second condition handles this by checking whether pos falls within the
485485
// leaf function expression's range in the application chain.
486-
| SynExpr.App(_exprAtomicFlag, _isInfix, funcExpr, argExpr, range) when
487-
posEq pos range.Start || rangeContainsPos (getLeafFuncExpr funcExpr).Range pos
486+
// We exclude infix applications from the fallback to avoid matching operator
487+
// uses like "a === b" where pos points at the operator.
488+
| SynExpr.App(_exprAtomicFlag, isInfix, funcExpr, argExpr, range) when
489+
posEq pos range.Start
490+
|| (not isInfix && rangeContainsPos (getLeafFuncExpr funcExpr).Range pos)
488491
->
489492
let isInfixFuncExpr =
490493
match funcExpr with

0 commit comments

Comments
 (0)