ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Broken syntax highlighting when splitting constructs over multiple lines
The bug
When splitting some F# code over multiple lines in a way that the F# compiler permits, Ionide syntax highlighting stops working correctly. It is particularly noticeable because syntax highlighting breaks throughout the entire file.
In particular, I'm facing issues when:
-
Splitting a qualified function reference over two lines:
Module .f
rather than
Module.f
-
Splitting a record pattern-match in a function parameter over two lines:
let f ({ X = x Y = y }) =
rather than
let f ({ X = x; Y = y }) =
Reproduction steps
- Clone https://github.com/mattgallagher92/fsharp-syntax-highlighting-bugs.git:
git clone https://github.com/mattgallagher92/fsharp-syntax-highlighting-bugs.git
- Open the repo:
cd fsharp-syntax-highlighting-bugs/
- Check out the initial commit:
git checkout 44ee9c4f8aaf07cb5facc035581052b32c99e6fc
- Open the repo in VS Code:
code .
- Open
MultilinePatternMatch.fs
andSplitModuleAndFunctionName.fs
and inspect the contents - Notice the syntax highlighting is broken as described in the comments
- Close VS Code
- Remove generated files:
git clean -d -f
- Check out the next commit:
git checkout e074b183a43513f434ee3f652a711d0ed06d9821
- Open the repo in VS Code:
code .
- Open
MultilinePatternMatch.fs
andSplitModuleAndFunctionName.fs
and inspect the contents - Notice the syntax highlighting works correctly
Expected behaviour
I expected syntax highlighting in the entire file to work when these constructs are split across multiple lines, in the same way that it works when the constructs are on one line.
Screenshots
Qualified function over two lines
Qualified function on one line
Pattern match over two lines
Pattern match on one line
Environment
- OS: Windows 10 Pro version 2004
- Ionide version: 4.17.0
- VSCode version: 1.49.1
- dotnet SDK version: 3.1.201
- mono / .Net Framework version: n/a
Hey @mattgallagher92 :wave:,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our OpenCollective and consider backing us.
https://opencollective.com/ionide
PS.: We offer
backer
support for all backers. Don't forget to addbacker
label when you start backing us :smile:
It didn't fit into the nice concise bug report template you gave, but I just want to take the chance to note how awesome this VS Code extension is! The reason I'm raising the bug report is that writing F# with Ionide's lovely syntax highlighting is so much better 😊