Ctrl+Space is not showing proposals. e.g sysout or arr. is not working. I tried to restore default from Content Assist-> Advanced.
But, the changes which I make does not get saved and it reverts back to the original settings in preferences. Has anyone encountered this before? Any help will be much appreciated.
This is actually kind of common in eclipse.
Although this link doesn't describe the exact symptoms you have stated, the solution it proposes may be able to solve your issue:
http://mschrag.blogspot.co.nz/2009/01/open-type-cant-find-your-class.html
Quit Eclipse
Go to workspace/.metadata/.plugins/org.eclipse.jdt.core
Remove *.index and savedIndexNames.txt
Restart Eclipse and search Ctrl+T for the offending type. The indexes will be rebuilt.
Try doing that. If it still doesn't work, try to delete the class itself, and re make it. Just copy and paste. Again, you mentioned the default preferences:
Windows > Preferences > Java > Editor > Content Assist > Advanced
The Eclipse help page tells to restore:
Select the proposal kinds contained in the 'default' content assist list:
Other Java Proposals,
SWT Template Proposals,
Template Proposals,
Type Proposals
Now, also go in here:
Window > Preferences > Java > Appearance > Type Filters
And make sure that you didn't filter out random stuff that you don't want to filter out. Also try to just disable everything there.
Let me know if it helped!
I have the same problem on Eclipse Neon.
It may be linked to Code Recommenders because only the "Java Proposals (Code Recommenders)" item will be saved when checked.
But when you uncheck this item it will allow you to save some other items. I don't understand why but some items will still remained unsaved.
Related
Is there any option that I can use to type faster without spelling mistakes?
I have already searched menus of eclipse but couldn't find.
CTRL + Space will show you a list of proposals.
If this is not enough, you can go to Window > Preferences > Java > Editor > Content Assist. You'll be able to play around with the settings there.
ctrl-space key to trigger an auto-complete
Type few alphabets e.g st and then press Ctrl+space together it will show options which start with st:
Then select one which you need, this way you can type faster and without making any syntactically incorrect name. Though it does not guarantee spelling mistake as such. I prefer IntelliJ over Eclipse.
I used to have a window that show me in a explorer tree structure where my errors and warnings where, but now i dont know how to show it again, i'm using netbeans 8.0.2.
I don't think it was a plugin, i think it was by default. i have seen other questions but the all refer to the action task list that show the errors in a list and i already have that.
Or if there's already a plugin to do this i would like to try it.
I'm sorry that i dont have a picture do show how was the window that i want to show again.
I think your are talking about Static Code Analysis
You can found it in source / inspect
Here is a problem with MyEclipse. While I input "." after some variables e.g. list.size(), in the past Eclipse automatically suggested me all possible methods and options. But now this function is not working. And also I have already enabled the Auto Activation option in Eclipse preferences.
MyEclipse Version = 10.7.1
If someone knows about this problem, please suggest me how to solve.
Check the value of the content assist trigger.
Since I do not have all your Eclipse setting, I would suggest going to the Preference -> Java->Editor->Content Assist and click Restoring Defaults.
I use Eclipse for Java development. I like the auto-activation feature because I can add all the letters and numbers so I can see class members while I'm typing; making it behave similarly to Visual Studio. If I don't add all of the letters and numbers to the auto-activation list, it will only pop up with class information when I'm typing the first letter after the '.' delimiter, and then it disappears.
The real problem arises when I'm typing in a variable name or something else. As soon as I hit space, the auto-complete types a bunch of crap following what I've typed in attempt to complete it. It's driving me crazy!
Any way to turn this off?
The checkbox you have to check is: "Disable insertion triggers exept 'Enter' "
(under Java -> Editor -> Content assist)
I'm on Eclipse 2018-12 and C_H's answer had no effect on the behavior:
I believe what you'll want is to deactivate "Insert single proposals automatically"
EDIT: It seems this answer is now outdated. It may work for old Eclipse versions. For any more recent versions refer to #ChrisP's answer from 2019.
Open menu Window, then Preferences. Follow path Java -> Editor -> Content assist. Now mess around with the settings to find your ideal setup. I believe what you'll want is to deactivate Insert single proposals automatically.
If anyone wants to know how to stop the auto-complete for brackets:
Toggle off: "Edit --> Smart Insert Mode"
Version: Eclipse Photon
In continuation to #G_H's answer :
This worked for me although I am sure there is another and a better way.
Window -> Preferences -> Java -> Editor -> Content Assist -> Set Auto Activation Delay(ms) : 200ms from 0ms in my case.
You may want to increase/decrease the value 200 depending on your typing speed.
The reason this worked is because of the hitting of "Spacebar" before the delay arrives.
I have been wracking my brain trying to figure this out. For the first time I used jEdit the other day and I was pleasantly surprised that it auto indented my code (meaning that I'd put in the following code:
int method () {
_ //<-- and it put me here automatically
I've tried to get the same thing working with eclipse but with no success. I got into the code formatter but I don't see how to make that happen.
Is it possible to do this? Also while I'm here, is there a such thing as a eclipse plugin that will allow you to search the methods and classes of the standard java library?
Thanks
Personally all I use for this is the format options Window->preferences under Java->Code Style ->Formatter.
I once took the time to tweek how I like my code to look like when I work and exported the whole thing. After that I just code without too much bother on what it looks like. When I find the code looks messy by pressing the combination ctrl+shift+f and the whole class becomes pretty again, comments and all.
After a while it pretty much became a reflex...
code code code
ctrl-s, ctrl-b (cause I disable auto build sometimes), ctrl-shift-f
code some more etc...
Once I got used to this I never really cared how it presented the code as i was typing because I knew it would look all pretty as soon as the loop/if/switch/method etc is finished
My clean eclipse install does this by default.
Have you changed any options? Make sure the file you are editing has the .java file extension. The preference options that control the typing automations are under Java -> Editor -> Typing in the Window -> Preferences menu.
Also, I find that the auto-indenting, and most of the other auto-complete functions of eclipse do not function well if the file I am editing has errors in it which prevent compilation. Make sure that your curly-braces are matched correctly, this is the main one that I've noticed blocks auto-indent.
Regarding searching through the standard Java libraries, use the Search -> Java.. menu option, and check the JRE libraries checkbox, then search away. You can also use the Hierarchy view to see how the classes relate. Also, in the Package and Project views you can expand the JRE System Library, and then expand rt.jar which holds pretty much all the standard Java pacakges.
Eclipse has always done this for me by default.
One really cool thing about eclipse is that you can search preference pages. Just right click and go to prefrences. Go to the "Window" menu, and click "Prefrences". Then at the top of the tree view there's a text box that says "type filter text". Replace that with "indent" and it should bring up the page where the indent option is.
Make sure that eclipse recognizes your file as a java file, that you're using the Java distribution, the latest version, etc.
Iv been trying to work around the eclipse indenting and other supposed features for years, and it seems that the bottom line is this ...
It only works for the programming style of the authors, so to use it you need to modify your style to comply.
This would be OK except that the authors of eclipse have some very strange ideas about common shortcut keys.
One horrid example is the search features, eg when did Ctrl+K become "Find Next occurrence" and why doesnt F3 or n work?
That all being said I use eclipse because if you have the time to wait around while it starts up - or never close it - and you can modify everything youve learned about using an editor - why why why - then it will certainly increase your efficiency.
Please note that there is a preference setting for indenting, it can be set for a project, a workspace, or globally, but no matter how you set it eclipse will still chuck tab characters in where you dont want them.
In fact its indent crazy, like it wants to indent everything, even if its already indented.
Like I said Iv been using it for years and it STILL drives me nuts with its random behavior.
Follow these steps for Eclipse:
Select all text: ctrl+A
Correct indentation: ctrl+I
You should check:
Hidden features/tricks for Eclipse?
What is your favorite hot-key in Eclipse?