Do Eclipse have a plugin for type ahead autocompletion like Visual Studio, so I don't have to destroy my spacebar by pressing Ctrl+Space all the time? (If you don't know how it works in Visual Studio, please don't bother answering.)
And also, can I limit the autocomplete to imported packages, rather than every single Java class on earth? It's fustrating seeing suggestions from awt and swing etc., when I'm working with GWT. And I don't want to add every single Java class to the filter, that's just stupid. (Again, like how it's done in Visual Studio!)
Step 1: Open your Eclipse or Spring Tool Suite, then go to the Window > Preferences as shown in the below image. Step 2: In the next screen go to the Java > Editor > Content Assist > Auto activation triggers for Java as shown in the below image.
it only works after you have created some variables. you type the first letter/letters and when you click ctrl + space you get a list of all the variables that start with that letter/letters. it's an auto-complete tool...
To enable the Content Assist window to open automatically, go to the Content Assist Preferences page, accessed from Window | Preferences | PHP | Editor | Content Assist and mark the 'Enable auto-activation' checkbox.
My answer may come too late, but maybe will help others searching this feature in eclipse. This workaround works for me (eclipse helios):
Go to Windows -> Preferences -> Java -> Editor -> Content Assist
.
Here, enable Auto activation and set Auto activation delay to a low value, let's say 50 ms.
Then comes the workaround: In Auto activation triggers for java, simply put all the characters: abcdefghijklmnopqrstuvwxyz
.
And there you go, just type something.
Regarding your second part, yes you can
- Open Eclipse
- Select Window/Preferences from the menu
- Expand Java/Appearance/Type Filters from the menu on the left
- Click the "Add package" button, enter "java.awt" (without the quotes) and click OK
- OK your way out
This will make Eclipse remove any matching classes from the java.awt package from your type ahead list. Very nice...
So "type-ahead" exists in Eclipse (mentioned in this status report in June 2006), but is synonym of auto-completion, most often triggered by CTRL+ Space... (which is not exactly what you are looking for)
To be more specific, the kind of automatic auto-completion (completion while you are typing, with a "Common" or "All" list of possible completions) you have in Visual Studio is not there in Eclipse (actually read below):
Original answer January 2010:
At least, not without a dedicating plugin.
And even with that plugin, it would have to follow aTemplateCompletionProcessor
, meaning it would need a list of characters triggering said completion (again, not what you are looking for), by redefining methodgetCompletionProposalAutoActivationCharacters()
.
Update November 2011:
Cristi mentions in his answer (upvoted) a great workaround, which consists adding all the letters as Auto activation triggers for java.
See also "Automatically opening completion window in Eclipse".
From the thread "Eclipse auto-completion ":
Windows -> Preferences -> Java -> Editor -> Content Assist
- Set delay to: 0 (actually >0 is better: 50, it avoids CPU picks because of constant listening)
- Set triggers to:
.(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV WXYZ@
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With