Auto Complete activates after 2 characters Eclipse - eclipse

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.

Related

eclipse autocomplete

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".

Eclipse: Enable autocomplete / content assist

How can I enable autocomplete in Eclipse? I can't find it!
If you would like to use autocomplete all the time without having to worry about hitting Ctrl + Spacebar or your own keyboard shortcut, you can make the following adjustment in the Eclipse preferences to trigger autocomplete simply by typing several different characters:
Eclipse > Preferences > Java > Editor > Content Assist
Auto Activation > Auto activation triggers for Java
Enter all the characters you want to trigger autocomplete, such as the following:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
Now any time that you type any of these characters, Eclipse will trigger autocomplete suggestions based on the context.
By default in Eclipse you only have to press Ctrl + space for autocomplete. Then select the desired method and wait 500ms for the javadoc info to pop up.
If this doesn't work go to the Eclipse Windows menu → Preferences → Java → Editor → Content assist and check your settings here
window->preferences->java->Editor->Contest Assist
Enter in Auto activation triggers for java:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._
Apply and Close
other method:
type initial letter then ctrl+spacebar for auto-complete options.
For auto-completion triggers in Eclipse like IntelliJ, follow these steps,
Go to the Eclipse Windows menu -> Preferences -> Java -> Editor -> Content assist and check your settings here
Enter in Autocomplete activation string for java:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._#
Apply and Close the Dialog box.
Thanks.
For anyone having this problem with newer versions of Eclipse, head over to Window->Preferences->Java->Editor->Content assist->Advanced and mark Java Proposals and Chain Template Proposals as active.
I am not sure if this has to be explicitly enabled anywhere..but for this to work in the first place you need to include the javadoc jar files with the related jars in your project. Then when you do a Cntrl+Space it shows autocomplete and javadocs.
If you are only unfamiliar with the auto-complete while typing syntax or inbuilt methods in the eclipse you can simply type the desired syntax or method name and press Ctrl+Space that will display the list of desired options and you can select one of them.
If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist
If the auto-complete option is not enabled then you have to check your settings from Windows menu -> Preferences -> Java -> Editor -> Content assist->Advanced and mark Java Proposals and Chain Template Proposals .
In Eclipse click Windows Drop-Down > Click Preferences > Navigate to Java > Editor > Content Assist
In order to Make the Auto suggestion/completion to work you have to set trigger that invoke the Auto Completion.
Now go to,
Auto Activation > Auto activation triggers for Java
Enter all the characters you want to trigger autocomplete to be
invoked in Eclipse IDE, such as the following:
Alpahabets: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
OR
Special Characters: ~!##$%^&*()_+=-:;'"|?/.,
OR
Any combination of Alpahabets & Special Characters.
Now based on the references, Eclipse will trigger autocomplete suggestions for you.
For me, it helped after I changed the theme to 'mac' since I am running on a MacOSX.
Eclipse: >Preferences > General > Appearance > Choose 'Mac' from the menu.

Ctrl Space Not Working in Eclipse Helios on Win 7

I have shifted by Dev Env recently to Eclipse Helios on Windows 7. After that the Ctrl + Space Content Assist feature is not working. I found out that that key option is utilized by Language Settings. I have tried disabling it. But it still doesn't work in Eclipse.
Any help is much appreciated.
Configure Eclipse’s content assist, go “Preferences>Java>Editor>Content Assist>Advanced“. Make sure “Other Java Proposals” is ticked.
http://www.mkyong.com/java/content-assist-ctrl-space-is-not-working-eclipse/
In my case nothing happens after pressing Ctrl+Space. Right now I have set a different short cut for the same and solved
Check your "Keys" preferences: maybe the Content Assist" shortcut has been overridden by another command which would also use Ctrl+Space.
That could happen with the installation of a new plugin, coming with its own set of commands and shortcuts: the bug 303894 for the XText plugin is a good example.
You probably have another application (in systray) that uses Ctrl+Space for something else. In my case I have a small utility which when I press Ctrl+Space makes the active window on top.
The solution for you would be to (1) exit that application which overrides the keys or (2) in Eclipse change Ctrl+Space to some other set of keys.
This was solution for me to get rid of windows key shortcuts:
Go to Start > Type in regedit and start it
Navigate to HKEY_CURRENT_USER/Control Panel/Input Method/Hot Keys
Select the key named: 00000070 for the Chinese (Traditional) IME -
Ime/NonIme Toggle hotkey 00000010 for the Chinese (Simplified) IME -
Ime/NonIme Toggle hotkey
In the right sub-window, there are three subkeys. Key Modifiers
designate Alt/Ctrl/Shift/etc and is set to Ctrl (02c00000). Virtual
Key designates the finishing key and is set to Space (20000000).
Change the first byte in Key Modifiers from 02 to 00
Change the first byte in Virtual Key from 20 to FF
Log off and log back on. I don't think it's necessary to restart.
Do not change the Hot keys for input languages in Control Panel,
unless you want to do this all over again.
https://superuser.com/questions/327479/ctrl-space-always-toggles-chinese-ime-windows-7
I have seen a similar problem in Eclipse Juno (version 4.2.0).
Since you have already tried Eclipse/Java code completion not working, I would check to see if there are any key conflicts. Go to Window -> Preference -> General -> Keys. In the filter box, replace the light gray "type filter text" with the word "Content"; the first item should be "Content Assist." Select it. It should have nothing in the Conflicts box in the lower right-hand portion of the screen.
If you have no conflicts, then it is likely that there is another program, outside of Eclipse, that is binding to Ctrl + Space.
I worked around this with an ugly solution. I copied the Content Assist. In the Binding field, I entered held down the Ctrl + Alt keys and pressed space. This restored the Content Assist function, but it required a brain remap when I am using one machine.
!Screenshot of Eclipse Juno, I had the same problem, then I changed it to different key combination, then it works.1
This is what solved my problem.
Goto Control Panel -> Clock, Language and Region -> Change keyboards or other input methods -> Change keyboards... -> Advanced Key Settings. For some reason I had ctrl + space set as Key sequence for language hot keys. I changed them to something else and rebooted.
Make sure to reboot because it did not work for me without the reboot.
On my Ubuntu, Xfce, ctrl space was allocated to switch language on the iBus preferences (if you have this running, you will see the 'i' icon on the task bar, right click and choose preferences). To change this, bring up the IBus Preferences, on the General tab, see the "Enable or disable:" option, click the ellipses and provide a different keyboard assignment.
This sorted me out without need to restart Eclipse.
I use eclipse indigo and had this problem. Creating a new workspace did not worked.
Go to Windows->preference->General->Keys->"Restore Default" - This fixed my issue
Note that I just had English(US) on windows 7 [Control Panel-> Clock,Language and Region ->Change keyboard or other input methods-> Keyboards and Languages->change Keyboards...->General ==>Default language is English and Installed Services I just had English(US) alone
After doing this some you might need to restart the system if it does not fix.
This is how I fixed my problem on Ubuntu 12.04 regardless of the eclipse version. My problem was that the ibus was overriding the shortcut so I deleted this shortcut configuration.
Type ibus in the dash:
Then select Keyboard Input Methods. From there click on the first three dots next to the Enable or disable textfield. This windows should appear:
If there is something bound to Ctrl + Space simply delete it.
#Polac - Thx. That's what fixed it for me. I'd hit ctrl+space and I'd get a popup for chinese character selection. I have Windows 7 so for me it was:
Control Panel -> Region and Language -> Keyboards and Languages tab -> Change keyboards... button -> Advanced Key Settings tab
Be warned, its stubborn. I tried to just clear them, but as soon as I applied the settings they reset back to using the original key bindings. If I change the key binding to something obscure they still reset sometimes. It's annoying. Maybe its just my OS installation that's goofed, but it could be a Microsoft bug.
Didn't need Chinese on my system, so I removed it as an installed language in the first tab and that finally got rid of the hardcoded Chinese key bindings.
In Eclipse you can use the Alt-/ character sequense instead of Control-Space. This is an old problem which Eclipse and Chinese keyboards, which they addressed by adding this short cut.
I found the answer.
Windows / UV Elements - was OFF! I don't know how but they were off. And when you click Ctrl+Space he working, but your all elements are off and you think that it is not working. You must on all UV elements and after your Ctrl + Space will be work.

Disable content assist in Eclipse

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"

Eclipse help box

I am using Eclipse to program Android apps and I love how the little helper box thing comes up when you start to type and suggests things to you.
However, this only happens sporadically and I was wondering if there was a way to keep it visible for longer or, even better, a key combo I could press to bring it up. If I start to type something, it either helps me by suggesting things or doesn't appear.
Try Ctrl+Space. The feature is known as "content assist," "code completion," "auto-complete." In the Visual Studio world, I think it's called "Intellisense."
If you want the suggestions to appear immediately (I prefer this) you can change the delay by going to Window → Preferences → Java → Editor → Content Assist and change the Auto activation delay to 0. In my version of Eclipse (Helios for Java EE), that field is third from the bottom.
An easier way of finding this preference screen is to use the search box in the upper-left-hand corner of the prefs (as before, Window → Preferences), and typing completion. From there you can see all of the different content assist preferences that Eclipse offers. Mine has Java, JavaScript, CSS, HTML, JSP, and XML - most of those because I'm using a fancier version of Eclipse.
By default, when writing Java code, the . (period) key triggers auto-activation of content assist. You can change this setting in the same screen as the auto-activation delay.
I think its Control+Space for Code completion. Try that
Also go easy with the code completion popup delay. Dont set it to 0, i remember a strange behaviour in Eclipse where there was no popup at all.
Ctrl+Space is the shortcut for Content Assist.
Ctrl+1 is the shortcut for Quick Fix.
Ctrl+2 is the shortcut for a menu of Quick Assists. (Ctrl+2, F is the shortcut for Quick Assist - Assign to var/field, and in place of F you can also type L or R for other options.)
To see and/or modify available shortcuts you can go to Window > Preferences > General > Keys.