Semantic Syntax is incorrectly highlighting arguments as commands
See original GitHub issueAny bare (unquoted) string argument that has a -
in it is being highlighted as a command:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:20 (4 by maintainers)
Top Results From Across the Web
Your syntax highlighter is wrong - Jim Fisher
One tool that is supposed to help here is 'syntax highlighting.' Text editors, web viewers, and command-line tools do it.
Read more >Syntax Highlighting not fully working in TypeScript files when ...
I used the Inspect Editor Tokens And Scopes command to see what was happening, and it seems Volar is causing TypeScript variables to...
Read more >A case against syntax highlighting - Linus Åkesson
Background. Syntax highlighting is a standard feature of most modern text editors and development environments. The basic idea is to exaggerate ...
Read more >A case against syntax highlighting (2007) - Hacker News
I have a strange use case for syntax highlighting: If you ever forget to close a string or a function definition argument list,...
Read more >VS Code Pylance not highlighting variables and modules
I'm having a problem with the Pylance extension not doing syntax highlight for things like modules and my dataframe.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I think we need to take this in two stages.
The first stage is parity: being as close to PSReadLine as possible. This will allow both the console and editing experience to be on the same playing field. (this was actually the original goal of doing this work from the beginning)
The second stage is improving: Once both experiences are roughly aligned, then we can go back and make the changes in both to support the language better.
@rjmholt I think what they’re getting at is that the current regex based highlighter treats the name in a function definition like a command (which doesn’t have the flag).
Personally I’d rather have the name in a function definition be parsed as a bare word than the current situation (that’s how both the ISE and PSRL work currently). But a fix for both might be just keeping track of if the previous token kind was
Function
. Then also useTokenFlags.CommandName
.