Reputation: 110
I am using the most recent vscode, with fira code ttf font, and the ionide plugin to handle F# work. I just noticed a problem that I think is new to the most recent vscode, and I think is a base VSCode issue, but I am not sure - it could be related to either ionide project, or the font. Or perhaps, electron or chrome is at at fault here?
In short, the -> symbol in F# used for lambda function declaration doesn't always get recognized.
As you can see in the image above, the fun _ -> syntax used to declare an anonymous function does not render the -> as an arrow in all cases. The addition of even a single parenthesis around the parameters will cause it to work right, as will the replacement of the parameter with a number (but not a letter). The arrow ligature works fine in a big match statement, but it fails in this particular place.
I don't think its the font, as the font contains the right ligatures and works in most other places. I think it has something to do with how/when vscode decides it should substitute the ligature. Something about x -> makes it think it shouldn't do anything, but (_) -> is OK. I suppose its possible that the ionide package somehow affects ligature detection, but I have seen no evidence of it.
So, before I report this to vscode as an issue, does anyone know for sure what is going on, and where the issue might be?
Edit: Another picture of it failing in a different context. The multi parameter function renders correct, the single parameter function doesn't.
Upvotes: 1
Views: 1336
Reputation: 34138
To me, this looks like an issue with the tmLanguage
file for F#.
As you can see when using the Developer: Inpsect TM scopes
command, -
and >
are separate tokens (1, 2) in the case where ligatures don't work, whereas in the working case, it's just a single token (->
):
I actually reported a fairly similar ligature-related issue in #19183 (for Haxe), but in that case it does not appear to be an issue with the grammar.
VSCode seems to use ionide-fsgrammar for its F# grammar, so you could report an issue there.
Upvotes: 1