question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Semantic Syntax is incorrectly highlighting arguments as commands

See original GitHub issue

Any bare (unquoted) string argument that has a - in it is being highlighted as a command:

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
TylerLeonhardtcommented, Aug 11, 2020

So I think we need to take this in two stages.

  1. 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)

  2. 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.

2reactions
SeeminglySciencecommented, Aug 5, 2020

@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 use TokenFlags.CommandName.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found