Eclipse doesn't highlight references anymore

后端 未结 11 1331
离开以前
离开以前 2020-12-07 07:35

I have an odd problem. In Eclipse Ganymede, I used to be able to highlight a variable, and it would highlight the use of that variables in that method. However through some

相关标签:
11条回答
  • 2020-12-07 08:20

    In addition, you have to go to General->Editors->Text Editors->Annotations, choose Occurrences and check the "Text as" and choose Highlighted. This will make you happy.

    0 讨论(0)
  • 2020-12-07 08:23

    I had this too and my Mark Occurrence options were already all checked. As always, try restarting Eclipse, it worked for me.

    EDIT: It actually kinda worked. There's a bug on Eclipse that when you open a project in a new window (in case your first Eclipse window is a mess full of projects) it starts not to work. In case you need you can select an item and toggle the highlighter in the toolbar or use Alt+Shift+O, but you're gonna have to do it every time you select an item.

    0 讨论(0)
  • 2020-12-07 08:25

    Press alt-shift-O.

    It toggles the "Mark Occurrences" feature of Eclipse; which provides the highlighting functionality you're missing.

    0 讨论(0)
  • 2020-12-07 08:27

    There's a little "highlighter" icon on the toolbar - it toggles "Mark Occurrences".

    You probably accidentally pressed it when trying to select a menu item at some point. I had a friend who did that with the "show selected element only" toolbar button...

    You can either press it again or configure as Rytmis says.

    0 讨论(0)
  • 2020-12-07 08:28

    That is probably how the 'mark occurences' got turned off... I was using Ctrl+Shift+O to organize imports and by mistake chosen Alt instead of Ctrl. So it can be turned on again by Alt+Shift+O.

    0 讨论(0)
  • 2020-12-07 08:31

    To me it didn't work anymore because there was an error in the code. It generally works, but sometimes it might not, make sure your code has no errors if nothing else works.

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