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

regular Java document highlighting broken in VSCode when extension is active #1380

Closed
martinlippert opened this issue Oct 9, 2024 · 6 comments
Assignees
Labels
for: vscode something that is specific for VSCode type: bug

Comments

@martinlippert
Copy link
Member

This is the follow-up from redhat-developer/vscode-java#3787
Looks like regular document highlighting in Java source code is broken when the Spring Boot Tools extension is active.

@martinlippert
Copy link
Member Author

martinlippert commented Oct 9, 2024

Maybe a similar issue as we had with semantic tokens not being merged when coming from different language servers? (just guessing here, came to my mind then looking into this)

@martinlippert martinlippert self-assigned this Oct 9, 2024
martinlippert added a commit that referenced this issue Oct 9, 2024
… hightlights found to avoid confusion on the client side
@martinlippert
Copy link
Member Author

I looked into this and it seems like returning an empty list of document highlights causing the client to take only that empty list from the spring tools language server into account and ignoring other document highlight results (e.g. from the Java language server).

Fixed with 16f4d0c.

But probably worth to report this to VSCode itself and propose that document highlights coming from multiple sources are merged instead of "pick one and ignore the others".

@BoykoAlex, what do you think? Interested in reporting this to VSCode (and maybe proposing a PR for that)?

@martinlippert
Copy link
Member Author

Closing this here already, since the fix seems to work nicely. Nevertheless, we should look into the VSCode side as well @BoykoAlex.

@BoykoAlex
Copy link
Contributor

@martinlippert I agree, yes, will report to VSCode... If I'm to work on the PR I'd start with semantic tokens though. It's been reported a while ago, it has been idle for a long time and it affects us more as we have rather ugly workaround ;-)

@BoykoAlex
Copy link
Contributor

Raised microsoft/vscode#230946 but I would not say we are affected much by this issue... The range is the parameter. If range is inside the query unlikely Java would provide anything. If the cursor is at Java method parameter and we'd like to highlight that parameter in the query then this would be a problem... I feel semantic tokens not merged is far more painful then this...

@martinlippert
Copy link
Member Author

@BoykoAlex Thanks for raising this with the VSCode team. And I agree that the fix that we have in place for now (returning null instead of an empty list) is good enough here. Once the VSCode piece got fixed, we can think about the special case that you mentioned.

And yes, getting the semantic tokens merged is far more important, totally agree.

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

2 participants