languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Support semanticTokens

Open Real-YueWu opened this issue 8 months ago • 9 comments

Describe the bug After upgrading the extension to 2.8.6, the highlight (which means the color) of non-base packages disappeared.

To Reproduce Steps to reproduce the behavior:

  1. Upgrade vscode-R extension to 2.8.6
  2. Write a function like dplyr::mutate()
  3. See error

Can you fix this issue by yourself? (We appreciate the help)

No

Expected behavior The function should be highlighted (with color).

Screenshots

Image

Environment (please complete the following information):

  • OS: macOS
  • VSCode Version: 1.100.3
  • R Version: 4.4.3
  • vscode-R version: 2.8.6

Additional context Seems this bug is caused by R-syntax extension, because when I downgraded the vscode-R extension to 2.8.5, the function highlight still not work.

Real-YueWu avatar Jun 10 '25 15:06 Real-YueWu

By the way, is there anyway to highlight variables?

Real-YueWu avatar Jun 10 '25 15:06 Real-YueWu

It is intentional to bring more consistency to other languages such as python.

randy3k avatar Jun 11 '25 00:06 randy3k

Emmm, but no matter in the default theme (Dark+) in VSCode or the One Dark Pro theme, python always has function syntax highlight? Here is the screenshot:

Screenshot of Dark+ theme Image

Screenshot of One Dark Pro theme Image

Real-YueWu avatar Jun 11 '25 03:06 Real-YueWu

Are you sure that you have the default python syntax definition?

This is my highlight under visual studio dark+ theme.

Image

randy3k avatar Jun 11 '25 03:06 randy3k

I just realized that your lightlight may be due to "Semantic highlighting" of the python language server, for example Pylance.

randy3k avatar Jun 11 '25 03:06 randy3k

I just realized that your lightlight may be due to "Semantic highlighting" of the python language server, for example Pylance.

Yes! Sorry I am not familiar with these terminologies😢

Real-YueWu avatar Jun 11 '25 03:06 Real-YueWu

The vanilla highlight is expected and working as intended. To provide better dynamic highlight support, languageserver needs to support semantic token.

randy3k avatar Jun 11 '25 04:06 randy3k

@randy3k However, in fact, older versions supported function name and variable name highlighting。

Image

CreatorZZY avatar Jun 18 '25 08:06 CreatorZZY

I vote to reintroduce function highlighting. Guess I will be stuck with RStudio for now.

dainank avatar Jun 24 '25 19:06 dainank