Eclipse does not highlight matching variables

后端 未结 17 1999
忘了有多久
忘了有多久 2020-12-02 04:16

Eclipse does not highlight matching variables for me:

\"enter

I\'ve already tr

相关标签:
17条回答
  • 2020-12-02 04:49

    Try:

    window > preferences > java > editor > mark occurrences 
    

    Select all options available there.

    Also go to:

    Preferences > General > Editors > Text Editors > Annotations
    

    Compare the settings for 'Occurrences' and 'Write Occurrences'

    Make sure that you don't have the 'Text as higlighted' option checked for one of them.

    This should fix it.

    0 讨论(0)
  • 2020-12-02 04:50

    Alt + Shift + o
    will solve your problem and agree with @Korhan Ozturk as well :)

    0 讨论(0)
  • 2020-12-02 04:50

    Sometimes problems in your project build path can cause this, make sure you resolve it first, in my case the prolem was :

    enter image description here

    And when fix it highlights come back.

    0 讨论(0)
  • 2020-12-02 04:53

    There is a bug in Eclipse Juno (and probably others) but I have a workaround!

    If you have already checked all the configurations mentioned in the top answers here and it's STILL not working try this.

    To confirm the problem:

    1. Select a variable
    2. Notice the highlight didn't work
    3. Click away from eclipse so the editor loses focus.
    4. Click on eclipse's title bar so it regains focus, your variable should be highlighted.

    If this is happening for you, you must close ALL of your open files and reopen them. This bug seems to also make weird things happen with Ctrl+S saving of an individual file. My guess is that something is happening whereby internally eclipse believes a certain file has focus but it actually doesn't, and the UI's state is rendered as though a different file is being edited.

    Edit: If it's STILL not working, you might need to restart eclipse, but if you don't want to, try selecting the item you want to see occurrences of then disable and re-enable the Mark Occurences Toggle button.

    0 讨论(0)
  • 2020-12-02 04:53

    .

    Java - Editor - Mark Occurrences

    Eclipse Java EE IDE for Web Developers. Version: Photon Release (4.8.0)

    0 讨论(0)
  • 2020-12-02 04:56

    I wish I could have read the response by @Ján Lazár.

    In addition to all the configurations mentioned in the accepted answer, below setting solved my misery:

    For large files the scalability mode must be turned off. Enabling scalability mode will disable reference highlighting.

    enter image description here

    PS: @Rob Hruska It would be great if this point is added in the accepted answer. Most of the readers do not bother to read the last response.

    0 讨论(0)
提交回复
热议问题