I have just installed the 2020-12 version of Eclipse IDE, and I simply cannot get the Ctrl+Space suggestions to work. Every time I try to use them I get an empty suggestion box.
I've already searched for this of course, and I've found many who suggest how to fix it.
https://superuser.com/questions/209752/eclipse-doesnt-autocomplete-and-find-references-anymore
Eclipse - CTRL+Space autocompletion does not work any more for Java
https://mkyong.com/java/content-assist-ctrl-space-is-not-working-eclipse/
No Default Proposals in Eclipse Juno
Eclipse/Java code completion not working
Most of these say I need the Other Java Proposals in the settings, but if you look at the image you see that that option doesn't even exist! In the image the default settings are applied but I've also tried to check every single one of those boxes and still get an empty suggestion box when I press Ctrl+Space at the end of Combi (also in the image).
Image of the issue and my settings: https://imgur.com/a/CVRRgC0
There is no syntax highlighting in java files in my eclipse..This happened all of a sudden..Not sure why..
This is how it is looking now..
As mentioned in other posts..i tried to change the color from preferences window and there is nothing when i type java..something really messed up...
AAny suggestions..
Update:
It seems Java plugin is not installed..as per the below screeenshot
And when i try to install java plugin it says new version is already installed as per the below screenshot
Closing the file's tab and re-opening it fixed it for me.
(I actually closed all the tabs...)
I faced the same issue all of a sudden after a commit/update project operation.
The point is, default editor of Eclipse has changed somehow and we have to set it back to normal.
Try the below method,
1. Goto Windows -> Click Preferences
2. From the Preferences window goto General -> Editors -> Click File Associations
3. You can choose the default editor for *.java files here
When I first opened Preferences, 'Text editor' was set as the default editor for .java files and then I changed it back to 'Java Editor'.
Now it works perfectly fine.
You probably have a corrupt installation or you have recently installed a corrupt plugin.
The following steps might help.
In your Install window,
view your "already installed" plugins.
select the "Installation History" tab.
select a previous stable configuration
Click the "Revert" button
TLDR; open another workspace, then come back to the original workspace.
Ok this is odd, but for me, all the highlighting suddenly went away for Java files. I explored all of these ideas here, with no effect. I created a new workspace, planning to move everything to it. I realized that can be a pain to move many projects over, so I went back into the original workspace to look at some settings, and poof - the highlighting was working again.
I have one java class file like a text editor.
I tried following,
Select the respective java class file from eclipse.
Right click on the file and mouse hover on "Open with".
Select java editor.
Now its works.
Eclipse does not highlight matching variables for me:
I've already tried to change "Mark occurrences" via
Window -> Preferences -> Java -> Editor -> Mark Occurrences
but it didn't work. I am not sure why this is not working while others
have been able to fix the problem.
Can anyone tell me how can I set highlighting matching variables?
Looking for same variables with my eyes really bothering me too much.
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.
Alt + Shift + o
Will solve your problem and agree with #Korhan Ozturk as well :)
This is known as Toggle Mark occurrence (Alt + Shift + O), Means will highlight all occurrence of focused variable.
Same thing can be achieved from tool bar as follows
In same tool bar there is another switch if you turn that on you will see complete path for opened file, That is Breadcrumb
there are some more very useful switches like word wrap, Show white Characters just after toggle mark occurrence
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:
Select a variable
Notice the highlight didn't work
Click away from eclipse so the editor loses focus.
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.
The only that worked for me was:
Java > Editor > Mark Occurrences:
Check "Mark occurrences of te selected element in the current file."
... and maybe all the ones below.
Using Alt + Shift + o
It works for me!
For others running into this without any of the above solutions working AND you have modified the default theme, you might want to check the highlight color for occurrences.
Preferences > General > Editors > Text Editors > Annotations
Then select Occurrences in the Annotation Types, and change the Color Box to something other than your background color in your editor. You can also change the Highlight to a outline box by Checking "Text as" and selecting "Box" from the drop-down box (which is easier to see various syntax colors then with the highlights)
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.
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.
For PHP you can set
window > preferences > PHP > editor > mark occurrences
Please check first checkbox (Mark occurrences of selected element in the current file)
And also check
Preferences > General > Editors > Text Editors > Annotations
'Occurrences' and 'Write Occurrences' with different style and color
If highlighting is not working for large files, scalability mode has to be off.
Properties / (c/c++) / Editor / Scalability
.
Java - Editor - Mark Occurrences
Eclipse Java EE IDE for Web Developers.
Version: Photon Release (4.8.0)
maybe because it not supports code highlights inside scriplets. not sure though.
You can try using one of the eclipse plugin like 'glance search' which works great.
Here's a link for that-
http://code.google.com/p/eclipse-glance/
I just unchecked all, applied, checked all again, applied and it worked :) hopefully helps others.
Eclipse Toolbar > Windows > Preferences > General (Right side) > Editors (Right side) > Text Editors (Right side) > Annotations (Right side)
For Occurrences and Write Occurrences, make sure you DO have the 'Text as highlighted' option checked for all of them. See screenshot below:
I was having the same issue and the "make occurrences" and "annotations" solutions above did not help. If you are using Maven, I had to convert the project to a Maven project (right click on it in the Package Explorer and go down to configure), then build the project. Then the syntax coloring and highlighting worked correctly.
This is what worked for me (credit to YardenST from another thread):
Instead of double clicking file when opening, right click on file -> Open with -> Java editor
In Scala IDE click on this button in the toolbox to activate Mark Occurrences (off by default).
link to the screenshot
Sometimes problems in your project build path can cause this, make sure you resolve it first, in my case the prolem was :
And when fix it highlights come back.
I had this issue with Eclipse Mars for PHP developers, 64 bit edition for Windows. I now discovered that highlighting works out-of-the-box with the 32 bit version. Even with a fresh download of the equivalent 64 bit build, highlighting does not work. So I will switch back to 32 bit (this is actually not the first problem I observe with Eclipse 64 bit).
Edit:
I thought this was the solution, so I installed the 32 bit version in C:\Program Files (x86) and set a shortcut in the "Start" menu. When I started Eclipse from there, highlighting again ceased to work. I now got it working again by deleting the .metadata directory in the workspace (i.e. resetting the workspace settings) and re-importing the projects.
I'm stuck with Eclipse in one project and I would like to have autocompletion similar to that of IntelliJ - two major problems are:
Start typing and Eclipse would automatically suggest all possibilities
When there is item selected in dropdown list you can accept it not only with enter key but with dots, spacebars...
Go to Window → Preferences → Java → Editor → Content Assist.
In the column "Auto activation triggers for Java", enter this:
.qwertyuioplkjhgfdsazxcvbnm_QWERTYUIOPLKJHGFDSAZXCVBNM
Add any other keys you want. You're done. That answers your first query.
As far as second one goes, I think it already exists.
Take a look at Eclipse Code Recommenders [1] or Codetrails Connect [2]. They make Eclipse' code completion intelligent.
[1] http://eclipse.org/recommenders/
[2] http://marketplace.eclipse.org/content/codetrails-connect-community-edition/
I have to say NO. I moved from Eclipse to IntelliJ because of the intellisense and inability to make Eclipse behave like IntelliJ (or if you come from the .NET environment: inability to make Eclipse intellisense behave like ReSharper in .NET).
Do you HAVE TO work in Eclipse? I do 98% of work in IntelliJ, then convert the project into Eclipse project (IntelliJ can still access it) and finish it in Eclipse. Maybe you could try this solution.
Since Eclipse Juno, Code Recommenders Intelligent Java Proposals replaced the old JDT's Java Proposals.
It afford "Intelligent Code Completion" function, like IntelliJ did in a way.
You can get something useful through the link below:
http://code-recommenders.blogspot.jp/2012/07/code-recommenders-10-code-completion-on.html
There is something like that in Eclipse I think, certainly in the Eclipse Helios. When typing you press CTRL+SPACE, or when you typed variable name '.' will start auto-complete options.
Also here someone suggests to change auto complete delay settings to 0.
BTW you can also accept your selection with space bar, for sure.
EDIT:
Why not consider using NetBeans, my personal favourite. There you have an option to show auto-completion on start typing any Java Identifier Part. This would then look exactly as you want it. (in NetBeans Tools->Options->Editor->Code Completion, there in Language box select Java and finally check Auto Popup on Typing Any Java Identifier Part).
I just installed 64-bit Eclipse 3.5.1 on SnowLeopard. I am experiencing a rather strange problem, and I'm posting a question here to see if anyone can explain or confirm it before I go get tangled up with the Eclipse bugzilla.
I open up a Java class with some errors in it. I double-click on a reference to a field. I click right and select 'open declaration'.
The windows then shows me ONLY the declaration. I smell a feature here, but I can't figure out how to get Eclipse to go back to displaying the entire class except by closing and reopening the class.
Go into the Eclipse Preferences and under Java > Editor you will see a checkbox for "Only show the selected Java element"... what you describe sounds like the behavior when that is checked. Try unchecking it.
Good luck.