Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable assignment/reference syntax highlighting lost between v1.53.0 and v1.54.0 #1249

Closed
dbmckie opened this issue May 8, 2024 · 4 comments
Assignees
Labels
for: vscode something that is specific for VSCode type: bug

Comments

@dbmckie
Copy link

dbmckie commented May 8, 2024

I use the Spring Boot Tools Extension for VS Code. Between versions 1.53.0 and 1.54.0 local variable lose syntax highlighting when they are referenced.

Highlighting is fine when variable is initially defined but when later referenced or assigned, highlighting is lost. All things the same, v1.53.0 works fine.

This is on a clean install of VS Code with only the Java Extension Pack and Spring Boot Extension Pack installed.

image
V1.53.0

image
V1.54.0

@martinlippert
Copy link
Member

The only thing that comes to my mind is the new semantic token support that we have in place. I wonder why and how that could cause this, but we need to investigate this. Thanks a lot for reporting this.

@BoykoAlex
Copy link
Contributor

Looks like there is some kind of conflict between java semantic highlighting and ours for embedded HQL/JPQL. Needs to be investigated. One thing i could fix quickly is if one disables the JPQL support then java semantic token highlight works the same as before. However, seems that for both working well together language client in vscode might need to be involved

@BoykoAlex
Copy link
Contributor

I pushed something that allows the setting "JPA Query Support" (boot-java.jpql) to properly disable JPQL/HQL syntax highlighting: 8f691f3
If you grab a snapshot build of the extension from the bottom of this page: https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html it should highlight Java code properly (accounting for JDT LS semantic tokens highlighting) if JPQL support is off in the settings.

I noticed that VSCode semantic tokens support would honour the first semantic token provider that provides non-null tokens and ignore the tokens coming from the rest of them. This isn't promising at all :-\ Seems like this is a design decision... I may try tokens for a range rather than for a whole doc as it may work differently.

@BoykoAlex
Copy link
Contributor

We've pushed a fix for the issue which is kind of a workaround until VSCode properly supports multiple semantic tokens providers for the same language: 6243fee
We'll track the VSCode side of things via #1251 separately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: vscode something that is specific for VSCode type: bug
Projects
None yet
Development

No branches or pull requests

3 participants