Skip to content

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

Closed

Description

@martinlippert

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.

Activity

  1. added this to the 4.26.0.RELEASE milestone on Oct 9, 2024
  2. martinlippert commented on Oct 9, 2024

    @martinlippert
    MemberAuthor

    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)

  3. self-assigned this
    on Oct 9, 2024
  4. added a commit that references this issue on Oct 9, 2024
  5. martinlippert commented on Oct 9, 2024

    @martinlippert
    MemberAuthor

    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)?

  6. martinlippert commented on Oct 9, 2024

    @martinlippert
    MemberAuthor

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

  7. BoykoAlex commented on Oct 9, 2024

    @BoykoAlex
    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 ;-)

  8. BoykoAlex commented on Oct 9, 2024

    @BoykoAlex
    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...

  9. martinlippert commented on Oct 10, 2024

    @martinlippert
    MemberAuthor

    @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

Metadata

Metadata

Labels

for: vscodetype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions