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.

Syntax highlighting consistency

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m filing this as a feature request as it seems to be an issue with vanilla VS Code. However, I think vscode-R does some syntax highlighting improvements and I hope this can be added. Request: Make the syntax highlighting rules more consistent.

Describe the solution you’d like All function calls should look the same, object references should look the same.

Describe alternatives you’ve considered Perhaps this is more an issue with the particular theme. I’m not too sure the contributions between VS Code + vscode-R + theme. I’ve tried editing editor.tokenColorCustomizations with no success.

Additional context VS Code using Monokai theme below (other themes have same issue including Abyss, Solarized Light). Note that the mutate function and my_function are not blue. x,y,z are styled differently depending on the surrounding punctuation, etc. Screen Shot 2021-09-14 at 1 29 58 PM

Compare this with the same code in Sublime below for desired feature. Screen Shot 2021-09-14 at 1 30 03 PM

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
renkun-kencommented, Jan 22, 2022

@wkeahi Yes, the color is indeed theme-specific. If you use other themes, it is more likely that different colors are assigned to variables and function calls.

1reaction
ElianHughcommented, Sep 16, 2021

I have this issue as well. It might be worth taking a closer look at vscode-R’s syntax definitions in general, as there are outstanding syntax issues (e.g. raw vectors)


It also might be worth looking into unit tests for syntax highlighting, as there appears to be edge cases that pop up unexpectedly when altering the syntax. I saw some libraries for this in passing, will update if I see them again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A case against syntax highlighting - Linus Åkesson
Syntax highlighting doesn't improve legibility. It encourages you to skim through code rather than understand it. It makes you focus on syntax ...
Read more >
How can I get consistent javascript syntax highlighting in note ...
A problem I am running into is that syntax highlighting is inconsistent between various apps. I'm a 'weekend coder', trying to learn things ......
Read more >
Syntax Highlighter - Visual Studio Marketplace
Incremental parsing system ensures high performance. All these advantages enable accurate and consistent syntax highlighting.
Read more >
Syntax highlighting is backwards | benkuhn.net
I guess what I was trying to say is that I think syntax highlighting (i.e. a consistent, unique color) for keywords like “def”...
Read more >
Syntax Highlighting | Collaborator Documentation
Syntax highlighting schema denotes what fragments of text should be highlighted as keywords, strings, constants, comments, and so forth. It also specifies a ......
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