You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
fmoo
changed the title
Syntax highlighting incorrectly highlights last character of quoted string in command
Syntax highlighting incorrectly highlights quoted string in command
Jan 7, 2022
I had a hunch as to this and it turned out to be correct. Not sure what the best fix should be at this stage but writing this down so I don't forget the cause.
The issue is in SemanticTokenVisitor.csSplitCommandText function in the LSP.
That correctly identifies in the above example there are two tokens TODO and Initialize anything but because that splitting code is dropping the the "'s at either end (because its mostly the correct thing to do) the range of the token is off by two.
This is where the trick is, by default the extension will use a basic syntax highlighter that will see "Initialize anything" as a String later the LSP runs and goes "yeah nah that isn't a string its a parameter" which is correct but because the LSPs tokens are two shorter the last two characters are still using their initial "I am a string" settings they got from the first syntax highlight pass.
I suppose can just add the "'s back in but I would have to check if that causes issues with other parts of the LSP that check the validity of commands.
Repro case:
produces the following:
This is on version 2.0, released on 12/18
The text was updated successfully, but these errors were encountered: