ionide/ionide-vscode-fsharp

Error highlighting on method calls

Opened this issue · 1 comments

Describe the bug

When a method is called, the part that precedes it is incorrectly highlighted by the method's color

sample reproduction

value.Replace("{","{{").Replace("}","}}")

Expected behaviour

Correct highlighting for each step of the chained call

Screenshots

image

Machine info

  • OS: Windows
  • .NET SDK version: 8.0.300
  • Ionide version: 7.20.1

This bug seems to be coming from FSAC.

When inspecting the tokens it seems like the range for the semantic token are off:

CleanShot 2024-05-27 at 17 44 31

CleanShot 2024-05-27 at 17 44 41

We have a range for:

  • "".Replace
  • ("{","{{").Replace

but they should be split in several smaller ranges:

  • ""
  • .
  • Replace
  • etc.