As described in this question one can have auto complete (Content Assist) appear automatically as you type. There is, however, a problem with this setup.
Eclipse figures it's a good idea to accept the first suggested completion when LOADS of different keys are pressed. Such as space, braces and other stuff you really need to type often without inserting a suggestion.
Any Eclipse wiz out there who knows how to turn this auto insertion off without disabling the suggestions?
Open Window --> Preferences. Type "Content Assist" in the filter, and disable it for your editor (or change activation preferences).
Go to Window -> Preferences -> Java -> Editor -> Content Assist -> Auto Activation -> Auto activation triggers for Java and type ".abcdefghijklmnopqrstuvwxyz" . You can add or remove any characters, on pressing which the auto-complete menu gets triggered.
In your case make sure that you do not have a whitespace, ( or < included in the Auto activation triggers for Java
Related
I use Netbeans 7.2.1, when I type private String a(Java code), the IDE shows a tip window aString which asks me to name a variable with its type as postfix. In addition, when I continue to type ;, it completes the code with private String aString;. Actually, I do not like this naming style, so, how to change the settings?
For windows :
Go to Tools > Options > Editor > Code Completion
Select Language Java from dropdown
Auto pop-up on typing any Java identifier part
You can take help from the images below:
Under Preferences -> Editor -> Code Completion is where you can find the auto complete properties. You can disable the 'Auto Popup Completion Window' to keep it from automatically popping.
You can bring up the auto complete popup with the hotkey: control+space
Also while the completion window is displayed, pressing the esc will close it without inserting an autocomplete value.
Go to: Preferences -> Editor -> Formatting.
In the drop-down box "Language", choose "Java".
There are many other categories you can choose from and you can customize your code formatting style there.
I have noticed that qtCreator handles the auto-completion much better than eclipse.
For example, if I have a line that says object.firstItem() and put my cursor between . and f, and then delete the first word (thus becoming object.|item()) and then press ctrl+space and choose secondItem(), qtCreator guesses object.secondItem();, whereas eclipse chooses object.firstItem()Item().
There could well be other features that are present in qtCreator, too, but not in eclipse, though it's the only one I really noticed. But why not share all good ideas since they all are open source ? I would be interested in all good features of qtCreator and eclipse combined.
Is there a way to have such a behaviour in eclipse too, through configuration or through a plugin ?
This feature is supported by Eclipse, too. (Or more specifically, the Eclipse Java Development Tools.)
Just hold down the ctrl key when selecting the item from the list of proposed completions to toggle between inserting and overwriting completion mode.
To change the default behaviour, go to Preferences -> Java -> Editor -> Content Assist and change the top-most radio button from "Completion inserts" to "Completion overwrites".
Is there anyway to make Eclipse activate autocomplete after I type 2 characters without a space, sort of like Flash Develop?
Also is there a way to turn off variable name suggestions?
Thanks
What type of code are you autocompleting? If you go to Window -> Preferences in Eclipse and filter by Content Assist, you can get to the preferences that you can change for your autocompletion. The options available depend on which Eclipse editor you're using though. Also, hitting Ctrl + Space at any time should activate autocompletion.
How do you disable content assist in Eclipse?
I do not mind allowing it to come up when I press ctrl & space, but I do not like how it automatically comes up as I am typing. It just messes me up. For instance it, I would end up scrolling through the options when I just want to go up a line. It is getting tedious having to press escape whenever it decides to pop up.
I have found the page in the preferences for it, but I cannot seem to find out how to disable the auto-pop-up.
EDIT: I am using the application for android development. I have already disabled "auto-activation" for both Java and XML, but it does not seem to have an effect. The window will still pop up automatically.
EDIT2: I tried restarting the program after making the changes, but it still had no effect. I made sure that the option changes were still in effect, and they were still in effect.
This Eclipse3.6 Help page on Content assist can help (it is for C++, but the same idea applies for Java on the Java > Editor > Content Assist preference page.):
The idea is to disable what triggers the content assist.
Go to Window → Preferences.
In the filter text search bar, type "typing".
Go to Editor → Typing.
Uncheck all that you don't want.
Don't know if you did get it to disable but I was having the same trouble as you.
I did the following:
Window > Prefrences > Content Assist
Uncheck all and hit apply
Java > Editor > Content assist > Advanced
Uncheck all and hit apply.
Hope this works if you still haven't found an answer.
It's not readily obvious and there doesn't appear to be a global option to turn it off all over the place. This may sound obvious, but it's important to make sure to turn off Auto-Activation on all of the different structured editor types that you do not want it active on.
In Eclipse Mars.1 :-
go to Window then->preferences -> Java -> Editor -> Content Assist ->Advanced -> Restore Default ->Apply and then OK.
Go to Window -> Preferences -> PHP -> Editor -> Content Assist -> Auto Activation
Untick the box "Enable auto activation"
I'm trying to disable the automatic closing of brackets in Eclipse, and while I've mostly succeeded, I can't stop the editor from inserting a closing parenthesis for a method call. The result is that when I type:
myBool.equals(true);
it inserts a closing parenthesis as soon as I type the opening parenthesis, and what I actually get is:
myBool.equals(true);)
I've disabled all of the auto-complete options in the Preferences -> Java -> Editor -> Typing menu, as well as Preferences -> Java -> Editor -> Content Assist -> Fill method arguments and show guessed arguments. I also disabled the smart insert mode option under the Edit menu. Is there another option somewhere else I need to use to stop Eclipse from doing this?
This is with Eclipse 3.5.2 (Build ID M20100211-1343) in case it matters.
Edited to add: I should also mention that this only happens if I wait for the "intellisense" pop-up with suggested method names to appear after I type the period. If I just continuously type the code without waiting for the suggestion box to appear, the closing parenthesis doesn't get inserted.
I don't know how to disable the method parenthesis auto-complete - so I'm not sure, if you'll be satisfied with my answer. But to avoid ending up with
myBool.equals(true);)
you can actually enable (Parenthesis, [square] and <angle> brackets in the Preferences -> Java -> Editor -> Typing menu. This inserts the parenthesis automatically (which you probably don't want), but you can just continue typing normally, as you would in an editor without "intelligence": Your closing parenthesis will simply overwrite the automatically inserted parenthesis, so you won't end up with );).
If I understand the problem correctly, here is the solution! I had the same problem.
Main Menu | Window | Preferences | <The language you are using> | Editor | Typing
In the section "Automatically close," uncheck the options you don't want.
I don't know if this functionality is new. I just started using Eclipse again and haven't ever used it much.
I found the answer on this stackoverflow page.
As you noticed, it only happens if you wait for the proposals ("intellisense") box to pop up.
The "solution" is to disable proposals under one or both of the following, although doing so is probably more of a hassle because of what you'll be giving up.
Preferences -> Java -> Editor -> Content Assist -> "Insert single proposals automatically"
Preferences -> Java -> Editor -> Content Assist -> Advanced