Okay, so my issue is when I am creating a variable, lets say for example "Object o" while I am typing "o" it'll suggest something like "object". Which is okay but when I press space it auto fills in the new name. Basically I don't want to turn off auto completion I just want to disable space auto filling the suggestion in. Even to disable variable naming suggestions would work.
I'm using Eclipse Juno Service Release 1.
I know it's an old question but since non of the answers here worked for me, and this problem was really annoying me too, I am adding solution that helped me.
In your Eclipse go to:
Window/Preferences/Java/Editor/Content Assist
and enable:
Disable insertion triggers except 'Enter'
screen/shotted
Hopefully that will work for everyone!)
As there isn't any definitive solution for this yet, what I find works best is to disable the alphabetic characters from triggers:
Windows > Prefereces > Java > Editor > Content Assist > Auto activation triggers for Java
This will mean no class name / type completion, but method name completion will still be suggested when you pressed dot, however at least Eclipse stop messing with my variable name
Go to Window/Preferences/Java/Editor/Content Assist and choose settings that works for you.
I realize this is a 3 year old post, but...
From what I can gather, there isn't an option to disable this, it was hard coded into the content assist feature. But there is a plugin that you can download from the answer to this stack overflow question that will disable this feature
Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced
I turned off Java Type Proposals and made sure Java Proposals is turned on. By the way this is in Spring Tool Suite I haven't checked using eclipse.
Related
Edit: I am a dumbass who repeatedly went into CA for JavaScript instead of Java. This is what happens when you blindly use the search box, folks.
I know this question has been asked and answered here before, but there's a problem. The solution just isn't there anymore.
I have the exact same problem as this good fella. I saw the answers, they say it's been patched in the 2018-12 release, which I assume is about 18 months old (I've only recently started using eclipse). I'm on the 2020-03 release and, as I said, the Disable insertion triggers except 'Enter' just isn't there anymore. See below:
Eclipse Preferences->Editor->Content Assist Window in 2020-03 release:
I tried looking for it elsewhere in Preferences but I can't find it. When I try to google it all that comes is this same solution, and nothing useful comes up if I filter the searches for time. Does someone know where this option went or if there is another way I can fix this? It's driving me nuts.
Your screenshot shows the JavaScript, not the Java content assist preference page where this setting has never existed:
Window (macOS: Eclipse) > Prefences: JavaScript > Editor > Content Assist
The Java content assist setting described in the mentioned answer can still be found at the same place:
Window (macOS: Eclipse) > Prefences: Java > Editor > Content Assist
I have a quick question that might save me a few seconds of annoyance every day. I know that eclipse can do a lot of autocomplete magic, so this might be possible:
As a programmer who learned with python, I constantly forget to surround contitions in control structures (like if or while) with parentheses. How do I make eclipse autocomplete opening and closing parentheses when I finish typing while or if?
I am aware that I can autocomplete whole structures with ctrl-space, but how can I configure eclipse to do this by itself?
Any help is appreciated.
So in stock Eclipse, the usual way to bring up assisted content is to type Ctrl+Space. The problem with this is that it brings up both Help Proposals and Template Proposals, with the Help Proposals displayed first. You end up wasting time scrolling down to find what you actually want from the Template Proposals. And there's just that much more clutter to choose from.
The solution is this:
Go Window->Preferences->General->Keys. In the type filter text search for "Template". This should bring up a "C++ Content Assist (Template Proposal)" line. Click on it. Now map this to whatever shortcut you'd like (I did Shift+Space because that's an easy one to do while typing). Make sure to click on the "Binding" option to do this. Click "Ok" and you're done!
If you ever want to add or change what is brought up by that shortcut, and for which specific strings it works, just go Window->Preferences->C/C++->Editor->Templates and you can edit those to do exactly what you'd like when using that newly assigned shortcut.
Hope this helps.
EDIT: I am unable verify if this works for PyDev, as I'm running Eclipse Oxygen, which doesn't currently offer PyDev or the Eclipse Marketplace Client plugin. However, my guess is this would still work in PyDev. Best of luck!
Sources:
Setting auto complete shortcuts in Eclipse
How to change the Control+Space autocomplete shortcut keys in Eclipse for Android
Thanks for any help, but the only thing that seems to work are workarounds. My prefered "solution" is to change the Auto activation triggers for Java in Preferences>Java>Editor>Content Assist from . to .iwfs, so that the autocomplete dialog automatically pops up when I start typing if, while, for or switch. Then hitting enter will do exactly what I needed.
I have installed GGTS, on ubuntu and am trying to edit .Groovy files with the built in editor.
The autocomplete is extremely annoying because while it will recognize my domain objects i.e. my User class etc.. It doesn't recognize basic groovy, for instance I start typing "def" to define a variable then hit space and it will autocomplete to "Default", similarly if I try to type in "return" it autocompletes to "RETURN" while I am typing as soon as I hit space, which is very annoying.
Like i said it will recognize classes, so if I type def u = new User(), the User part will complete ok, but the problem is that the variable u I defined earlier isn't recgonized later in the code.
I hope you guys get my meaning... No idea how to fix it, short of not using the groovy editor and treating it as plain text. I even tried disabling content assist, but that didn't seem to work for some reason
I was having this problem in GGTS 3.4.0.RELEASE today, and getting very angry with the situation.
Somehow my workspace had the "Auto activation triggers for Java" set to "_.abcd....z" (all the lowercase letters)
Window -> Preferences
Java -> Editor -> Content Assist
"Auto activation triggers for Java" set to just "."
This seems to have helped dramatically.
I'm still not sure what caused my workspace to have this setting.
Make sure that you're in the Grails perspective; that can impact some of the Groovy/Grails features and how Eclipse (even GGTS) leverages them. You'll find the perspective button in the upper right. If you're in Java or Debug, odd things like this may occur.
Also, how are you creating and opening your Groovy files? Do you use the context menus or the Grails command prompt tool to issue orders like "create-controller"? If you're creating the files in some other way, try using those methods to generate them, and see if you get the same results.
I found an interesting Stackoverflow topic, but it is an old one and I'm afraid people won't be reacting anymore, so I hope it is ok to create a new one.
First of, I am using Netbeans 7.2 and I want to use automatic code completion more. It works nice on methods/classes with the '.' already, but I would like it for the variable names aswell.
So I found this topic: How can I make auto completion in netbeans include both variables as well as methods? , more precisly the accepted answer.
This is what I have always wanted! Except one issue, it decides to automatically insert the name if only one result is available, while I am still typing unaware of that fact.
I have tried disabling Insert Single Proposals Automatically (Tools -> Options -> Editor -> Code Completion), and it does kind of work. But once I type the next letter, it still decides to complete it automatically.
Does anyone know a fix for this or another way to achieve the same?
Regards.
Ah, I found it now: If you want it as I described in the opening post, then set this for Completion Selectors in Java:
[.,;:([+-=] (Note the extra white space on the end, it is important.
Now it will not autocomplete on any character anymore, but still give you the suggestions box.
Go to (Tools -> Options -> Editor -> Code Completion)
Select Language Java
add tick to Auto Popup on Typing Any Java Identifier Part
and you can tick Subword Completion
One thing I like about Visual Studio is that you can automatically insert the first choice of the content assist instead of pressing Ctrl+Space and then choose the first option from the menu.
Is there a similar way to map a special key combination to always insert the first choice in Eclipse ?
If such option is not a native option in Eclipse, is there a plugin for that ?
I have seen a similar question in SO : Content assist without choosing in Eclipse but the solution suggested there was to rename the content assist tag that is triggered to something unique, I'm looking for something that works for everything.
Nope auto-insert only works when there is only one choice.
You may open an enhancement request for this feature against JDT/Text - https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT