Repository navigation
Labels
AI-thinks-issue-fixedAI-thinks-windows-onlyArea-LangService-RenameSymbolFCS and VS support for renaming symbolsArea-VS-EditorVS editor support for F# code, not covered elsewhereBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone
Description
In VS: renaming an operator containing . only renames right of ., but keeps everything left (including .) of .
Repro steps
let (-.-) a b = a + b
let _ = 1 -.- 2Rename (F2) on -.- (doesn't matter if decl or usage)
-> only last - gets selected and replaced when renamed with something:
Expected behavior
Select and rename complete operator
Actual behavior
Selects and renames only right of .
Known workarounds
Rename all with Search&Rename
Related information
I think the issue is in:
fsharp/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs
Lines 802 to 813 in fcd06c7
| /// Fix invalid span if it appears to have redundant suffix and prefix. | |
| let fixupSpan (sourceText: SourceText, span: TextSpan) : TextSpan = | |
| let text = sourceText.GetSubText(span).ToString() | |
| // backticked ident | |
| if text.EndsWith "``" then | |
| match text.LastIndexOf("``", text.Length - 3, text.Length - 2) with | |
| | -1 | 0 -> span | |
| | index -> TextSpan(span.Start + index, text.Length - index) | |
| else | |
| match text.LastIndexOf '.' with | |
| | -1 | 0 -> span | |
| | index -> TextSpan(span.Start + index + 1, text.Length - index - 1) |
span gets adjusted to remove parts like leading Namespaces, Modules, Types. This is done by retrieving text after last . (if no backticks). For normal identifiers that's ok -- but . is allowed in operators -> TextSpan for operators with . only contains part right of . (-.- -> -)
Provide any related information (optional):
- Win 11 x64
- Microsoft Visual Studio Community 2022 (64-bit) Version 17.3.5
Metadata
Metadata
Assignees
Labels
AI-thinks-issue-fixedAI-thinks-windows-onlyArea-LangService-RenameSymbolFCS and VS support for renaming symbolsArea-VS-EditorVS editor support for F# code, not covered elsewhereBugImpact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Type
Projects
- StatusShow more project fieldsDone

Activity
Fix operator rename issues (#14057, #17221)
Add missing issue references and update TASKLIST.md
Add release notes for Find All References and Rename fixes
github-actions commentedon Mar 22, 2026
🤖 This is an automated response from Repo Assist.
This issue appears to be fixed by PR #19252 (merged 2026-02-12), which fixed rename handling in
Tokenizer.FixedSpanto correctly handle operators containing.. The fix is included in the F# 10.0.300 release notes:To verify the fix, try renaming
-.-in VS and it should now rename the complete operator instead of just the part after the last..If this is confirmed fixed, the issue can be closed.
Add regression test for #14057: Renaming operator with dot only renam…
Add regression test for #14057: Renaming operator with dot only renam…