Skip to content

Java Extension no longer highlights all occurrences of the word under the cursor in Java files #3787

Closed

Description

@vitalyla

After recent update of VS Code and Java Language Support extension(s), the highlight of the elements under cursor no longer working (please see snapshots below).

Environment
  • Operating System: MacOS Sonoma 14.7, Win 10/11
  • JDK version: 17
  • Visual Studio Code version: 1.93.1
  • Java extension version: v1.35.0
Steps To Reproduce
  1. Open any Java source file.
  2. Put the cursor on any variable (field, parameter).
Current Result
  • Highlight of the same elements as under the cursor doesn't happen.

image

Expected Result
  • Highlight of the same elements as under the cursor does happen.

image

Activity

  1. snjeza commented on Sep 29, 2024

    @snjeza
    Collaborator

    I can't reproduce the issue on Linux or Windows.
    @vitalyla could you attach a project example reproducing the issue?

  2. Obscure2020 commented on Sep 30, 2024

    @Obscure2020

    I can reproduce the issue on Windows. Tell me, does this issue go away if you revert to version 1.34.0 of the extension? (In the extensions menu, click the gear icon on the extension and select Install Specific Version...)

  3. vitalyla commented on Sep 30, 2024

    @vitalyla
    Author

    Hi @Obscure2020 , @snjeza ,

    I will try with version 1.34.0. and update.

    Meanwhile, I just updated to version 1.35.1 of the extension and the issue persists. Also, when I double-click the element the "yellow" marks on the minimap, showing all occurrences, no longer available as well.

    Thanks
    Vitaly L.

  4. vitalyla commented on Sep 30, 2024

    @vitalyla
    Author

    Hi @Obscure2020 , @snjeza ,

    I tested with 1.34.0 and 1.32.0 and the issue is the same. However, I noticed something interesting that can hint to the root cause.

    Steps:

    1. keep cursor on a curtain field or method parameter
    2. close (Cmd+Q) VScode
    3. open VScode, cursor remembers last position, the highlight is working. But, as soon as I change cursor's position the issues reproduced.

    Thanks
    Vitaly L.

  5. simogab98 commented on Oct 1, 2024

    @simogab98

    I had same problem. Disabling all Spring Boot extensions solved the issue.

  6. vitalyla commented on Oct 7, 2024

    @vitalyla
    Author

    Hi,

    Any update on the issue? The current behavior noticeably reduces the work experience with Java projects, especially long and legacy ones.

    Thanks
    Vitaly L.

  7. ashbostock commented on Oct 8, 2024

    @ashbostock

    Can confirm that it seems the Spring Boot extensions are conflicting somehow, as @simogab98 said disabling these allows it to work again

  8. vitalyla commented on Oct 8, 2024

    @vitalyla
    Author

    Yes, verified the same as well, however, disabling Spring Boot extension is not the solution. It shows possible root cause but requires to be taken forward to understand where is a clash between two extensions. Both of them are needed for efficient and productive work on Java Spring (Boot)-based projects.

    Vitaly

  9. snjeza commented on Oct 8, 2024

    @snjeza
    Collaborator

    @vitalyla you can try to add

    "boot-java.embedded-syntax-highlighting": false,
    

    to your settings.json and restart VS Code

  10. marcelopbarros commented on Oct 8, 2024

    @marcelopbarros

    @vitalyla you can try to add

    "boot-java.embedded-syntax-highlighting": false,
    

    to your settings.json and restart VS Code

    I tried changing that setting, but it had no effect on the issue.

  11. marcelopbarros commented on Oct 8, 2024

    @marcelopbarros

    I can reproduce the issue on Windows. Tell me, does this issue go away if you revert to version 1.34.0 of the extension? (In the extensions menu, click the gear icon on the extension and select Install Specific Version...)

    @Obscure2020 I tried:

    • v1.32.2024062619
    • v1.33.2024073108
    • v1.34.2024082308
    • v1.35.2024092508
    • v1.35.2024092508
    • v1.36.2024100808

    All versions presented the same problem.

  12. marcelopbarros commented on Oct 8, 2024

    @marcelopbarros

    I'm also using MacOS, Sonoma 14.6.1.

    It seems like the only thing that works as a workaround is freezing Spring Boot Dashboard to version v0.13.1.

  13. fbricon commented on Oct 8, 2024

    @fbricon
    Collaborator

    @martinlippert does that ring a bell?

  14. marcelopbarros commented on Oct 8, 2024

    @marcelopbarros

    I'm also using MacOS, Sonoma 14.6.1.

    It seems like the only thing that works as a workaround is freezing Spring Boot Dashboard to version v0.13.1.

    I think my test was not accurate, sorry for that. As @vitalyla pointed, highlight seems to work for a few seconds after restart VSCode. I realize downgrade doesn't seem to really solve the problem.

    3. open VScode, cursor remembers last position, the highlight is working. But, as soon as I change cursor's position the issues reproduced.
    

    I was also using VSCode 1.93.1, exactly the same as @vitalyla, but I tried a newer version (1.94.1) with no success.

    For now, it seems the only way to work is disabling Spring Boot Tools.

  15. martinlippert commented on Oct 9, 2024

    @martinlippert
    Contributor

    This seems to be a similar issue: #3789
    Looking into this.

  16. martinlippert commented on Oct 9, 2024

    @martinlippert
    Contributor

    I can reproduce this with the Spring Boot Tools extension being active. As soon as I disable that extension, the highlighting works again nicely. This seems to be unrelated to the Spring Boot Dashboard extension.

    (there might be some confusion coming up because the dashboard extension depends on the Spring Boot Tools extension and is therefore automatically disabled as well when you disable the Spring Boot Tools extension)

    I filed spring-projects/spring-tools#1380 to track work on this in the Spring Tools extension. Sorry for causing this issue.

  17. martinlippert commented on Oct 9, 2024

    @martinlippert
    Contributor

    I pushed a fix for this to the Spring Tools, now waiting for CI builds to ship this to you as a pre-release... Stay tuned...

  18. martinlippert commented on Oct 9, 2024

    @martinlippert
    Contributor

    The latest pre-release of the Spring Boot Tools extension got published if you want to give it a try.

    Switch to the latest pre-release from within your VSCode installation works by looking up the Spring Boot Tools in the list of installed extensions and then "Switch to Pre-Release Version".

  19. vitalyla commented on Oct 9, 2024

    @vitalyla
    Author

    Hi @martinlippert ,

    Thanks a lot! I just tried pre-release of the SB Tools and syntax highlighting works flawlessly. Looking forward to official release of the SB Tools, for now staying with pre-release.

  20. fbricon commented on Oct 9, 2024

    @fbricon
    Collaborator
  21. vitalyla commented on Oct 28, 2024

    @vitalyla
    Author

    Hi,

    I installed the recent release version of SBT extension, Spring Boot Tools v1.58.0, and highlighting in Java files works as before.

    Thanks everyone for the help and timely resolution.

    Vitaly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions