Eclipse autocomplete change variable names - java

just a dumb question but its hard to search because there are so many topics about eclipse auto complete and its hard to find something matching to my problem.
so there problem is:
If i write :
"MyClass MyVarName" and then hit space, (to add the " = new MyClass()")
Eclipse automatically adds : "MyClass MyVarName_MyClass " or something like that to the variable-name..... (just without underscore.... stackoverflow just wont to mark as bold else...)
That is really annoying, and because i imported the eclipse configuration of a co-worker... I really don't know how to disable....
thanks in advance
//EDIT:
It seems to be the same effect as i type "MyC" and then press space, it also completes the "MyClass" and not add just the space... its like hitting enter. but i dont want to automplete on space...
i also didn't found a custom key option on space or else.... :(

In Window->Preferences->Java->Editor->Content Assist:
check the box at "Disable Insertion triggers except 'Enter' ".
I've found all other answers to also disable the auto-suggestion features of Eclipse, which are rather useful in my opinion.

Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced: In the top list box, uncheck "Java Non-Type Proposals", "Java Proposals" and "Java Proposals (Task-Focused)".

I cannot find a way to solve it decently.
So, just, press Esc before press Space.

Look into
Window -> Preferences -> Java -> Code Style
There you can see Conventions for variable names. Make sure all prefixes and suffixes are empty. Also check in
Window -> Preferences -> Java -> Editor -> Content Assist

Looks to me that you might have the Control key pressed without knowing it. Happens sometimes on laptops with Fn key that Fn+Ctrl kind of "locks" the Ctrl. I conclude this because Eclipse auto-complete feature should not work on pressing Spacebar only. Normally you should get the effect you describe only by pressing CTRL+Spacebar. Thus, try pressing Fn+Ctrl to unlock the "pressed down" Ctrl key and then you should be fine.

In Window -> Preferences -> Java -> Editor -> Content Assist, there is the option "Auto Activation". If you have it checked, it will activate even if you don't press ctrl and you'll see that behaviour. Uncheck it and you'll only get content assist when you use ctrl+space.
S!

My suggestion, and what I do, is similar to GreenEyed's approach but instead of disabling auto activation put it to a reasonable value for the delay, like 3000 (3 seconds).

I had plain Eclipse IDE for Java EE Developers and installed the Spring plugin to try it out. I didn't like it and didn't use it so I uninstalled it. After uninstalling, it still had the setting that you describe. So annoying!
After search for hours, I finally found out how to disable it.
Windows > Preferences > Java > Editor > Content Assist
Set Auto activation triggers for Java to: .
That's all that's necessary.
If you want to restore other Eclipse defaults regarding content assist:
Set Auto activation delay to 200.
I had previously disabled Java Proposals, Java Proposals (Task-Focused), and Java Type Proposals, as others recommended, but these should actually stay checked, so I re-enabled them.

Related

I can't type curly braces in Eclipse

I have been working with Java in an Eclipse IDE. I can type every single character just fine except for the '{' character. I need to resort to Ctrl+c and Ctrl+v every single time when I want to create a new block of {}.
In the Window>Preferences>Editor>Typing Braces are on, and they autocorrect just fine after I manage to copy a {.
Outside eclipse, in a text editor, or even in this question, I can type { by hitting Atl Gr + B, so I am thinking the problem is inside Eclipse.
Any help would be really appreciated, this error is getting quite annoying.
The problem is with the skip breakpoints option.
After unbinding the Alt+B key command, try to unbind the Ctr+Alt+B (skip brakepoints).
This solved my problem.
If you try to type the "{" you can see the skip breakpoint option flashing.
Go Windows-> Preferences type in search field 'binding' click on Keys, look up for Alt+B, click on it and then click Unbind Command.
Because people work differently and on different things, Eclipse makes it easy to change shortcuts and also to view shortcuts for the commands you use a lot.
In your case:
Window->Preferences->Keys -> ctrl+alt+b Unbind Command should do the trick. It also the same in Spring Tool Suite 4(It is an Eclipse-based development environment.) There is a usefull article about eclipse commands: How do you manage keyboard shortcuts
Solution: Window → Perspective → Customize Perspective → Debug - → point on Skip All Breakpoints → Key bindings and change it form Ctrl + Alt + B to Ctrl + Alt + M.

How can I prioritize variable names over types in Eclipse's content assist?

My Eclipse seems really bad at choosing what I want for my content assist. As you can see in this picture below, I literally have a variable defined on the previous line called "deleteTable", yet when I type "deT" and hit ctrl+space, it gives me suggestions for random classes which start with "Det" which I've never used before in my life.
In my Preferences -> Java -> Editor -> Content Assist -> Advanced options, in the first section, I only have the options "Java Proposals (Code Recommenders)" and "Template Proposals" as the two types of proposals I have enabled. And in the second section, I have cycling turned off (so when I hit ctrl+space multiple times by accident it doesn't change the suggestion drop-down).
What can I do to fix these unintuitive content assist suggestions?
This behavior is due to a bug Code Recommenders’ Subwords completion, which has since been fixed. Update to the newest version of Code Recommenders from the stable update site.

IntelliJ show JavaDocs tooltip on mouse over

In Eclipse, when hovering over a method, variable, etc. a tooltip is displayed with the corresponding JavaDocs. Is there such a feature in IntelliJ?
For IntelliJ 13, there is a checkbox in Editor's page in IDE Settings
EDIT: For IntelliJ 14, the option has been moved to Editor > General page. It's the last option in the "Other" group. (For Mac the option is under the menu "IntelliJ Idea" > "Preferences").
EDIT: For IntelliJ 16, it's the second-to-last option in Editor > General > Other.
EDIT: For IntelliJ Ultimate 2016.1, it's been moved to Editor > General > Code Completion.
EDIT: For IntelliJ Ultimate 2017.2, aka IntelliJ IDEA 2017.2.3, there are actually two options:
In Editor > General > Other (section) > Show quick documentation on mouse move - delay 500 ms
Select this check box to show quick documentation for the symbol at caret. The quick documentation pop-up window appears after the specified delay.
In Editor > General > Code Completion (sub-item) > Autopopup documention in 1000 ms, for explicitly invoked completion
Select this check box to have IntelliJ IDEA automatically show a pop-up window with the documentation for the class, method, or field currently highlighted in the lookup list. If this check box is not selected, use Ctrl+Q to show quick documentation for the element at caret.
Quick documentation window will automatically pop up with the specified delay in those cases only, when code completion has been invoked explicitly. For the automatic code completion list, documentation window will only show up on pressing Ctrl+Q.
EDIT: For IntelliJ Ultimate 2020.3, the first option is now located under Editor > Code Editing > Quick Documentation > Show quick documentation on mouse move
Up until IntelliJ version 11, no, not just by hovering over it. If the cursor is inside the method- or attribute name, then CTRL+Q will show the JavaDoc on *nix and Windows. On MacOSX, this is CTRL+J.
Quote: "No, the only way to see the full javadoc is to use Quick Doc (Ctrl-Q)." -- http://devnet.jetbrains.net/thread/121174
EDIT
Since IntelliJ 12.1, this is possible. See #ADNow's answer.
It is possible in 12.1.
Find idea.properties in the BIN folder inside of wherever your IDE is installed, e.g. C:\Program Files (x86)\JetBrains\IntelliJ\bin
Add a new line to the end of that file:
auto.show.quick.doc=true
Start IDEA and just hover your mouse over something:
After doing CTRL+Q, you can
Pin the tooltip (top right corner)
Check Docked Mode (under gear in top right after pinning)
Size as desired
Click icon for Auto show documentation for selected item
Then when you move your cursor, the documentation will appear in this box. It costs you a little screen real estate, but I find it's worth it.
I'd post a screenshot but SO won't let me post images.
For Intellij 15, use the checkbox in File > Settings > Editor > General option Show quick documentation on mouse move.
You can also get there by typing "quick" or something similar in the search box:
In Intellij13, you can use Editor configuration like below:
IntelliJ IDEA 14.0.3 Ultimate: Press Ctrl+Alt+S, then choose Editor\General choose Show quick domentation on mouse move
Tips: Look at the top right conner (gear icon) at JavaDoc pop-up window, You can choose:
- Show Toolbar
- Pinded Mode
- Docked Mode
- Floatting Mode
- Split Mode
Adding on to what ADNow said. On the Macintosh:
Right click on IntelliJ IDEA 12
Click on the Show Package Contents menu option
Open the bin folder
Open idea.properties
Add the line:
auto.show.quick.doc=true
The easiest way, at least for me, was:
Ctrl+Shift+A
Type: show document
Show quick documentation on mouse move (set it to ON)
From IntelliJ Ultimate 2018.1.5, aka IntelliJ IDEA 2018.1.5, till 2019.3 , there are actually two options under File -> Preferences:
In Editor > General > Other (section) > Show quick documentation on mouse move - delay 500 ms
Select this check box to show quick documentation for the symbol at caret. The quick documentation pop-up window appears after the specified delay.
In Editor > General > Code Completion (sub-item) > Auto-display documentation in 1000 ms
Select this check box to have IntelliJ IDEA automatically show a pop-up window with the documentation for the class, method, or field currently highlighted in the lookup list. If this check box is not selected, use Ctrl+Q to show quick documentation for the element at caret.
Quick documentation window will automatically pop up with the specified delay in those cases only, when code completion has been invoked explicitly. For the automatic code completion list, documentation window will only show up on pressing Ctrl+Q.
In IntelliJ IDEA 14, it has moved to: File -> Settings -> Editor -> General -> "Show quick doc on mouse move"
In Intellij 2019, I did: File > Settings > Editor > General option Show quick documentation on mouse move.
File-->Settings-->Editor
Check "Show quick doc on mouse"
Now when you put the mouse over a method a tooltip with the documentation will appear. Sometimes the tooltip size is too small and you will have to resize it moving the mouse down to the bottom of the tooltip.
IDEA has "find action":
Open "Help" menu, type "doc", move cursor to "Quick Documentation" it will be highlighted.
Also "find action" can be called from hot key (you can find it in settings->hotkeys)
On mac in IntelliJ Ultimate (trial) 14 I have mine under Settings > Editor > General > Code completion. The tooltip short is F1 on my laptop.
It's called "Autopopup documentation in (ms):"
A note for Android Studio (2.3.3 at least) users, because this page came up for my google search "android studio hover javadoc", and android studio is based on Intellij:
See File->Settings->Editor->General: "show quick documentation on mouse moves",
rather than File->Settings->Editor->General->Code Completion
"Autopopup documentation in (ms) for explicitly invoked completion"
and "Autopopup in (ms)", which has been previously talked about.
I tried many ways mentioned here, especially the preference - editor - general - code completion - show documentation popup in.. isn't working in version 2019.2.2
Finally, i am just using F1 while caret is on the type/method and it displays the documentation nicely. This is not ideal but helpful.
In 2020.1 there is in editor javadocs rendering has been added. Screen shots borrowed from intellij documentation.
On my IntelliJ U on Mac I need to point with cursor on some method, variable etc. and press [cntrl] or [cmd] key. Then click on the link inside popup window which appeared to see JavaDocs
All of the above methods are useful but one basic thing missing you need to have src.zip in your JDK (C:\Program Files\Java\jdk1.8.0_171). I assumed it comes preinstalled but for some reason, it was not present in my installation. Another thing to check is if your project is using the specified (1.8.0_171 in this case) JDK.
The answer is CTRL + P (NOT CTRL + Q)
Someone else posted this answer on JetBrains forum:
The idea is a different IDE. Try to discover its features and try to make the best of it, rather than trying to emulate whatever you used before.
For the most part, Idea has very high usability (much better than Eclipse IMHO) and is streamlined for supporting code editing as best as possible (rather than relying on wizards too much for example).
Javadoc: Ctrl-Q
A quick view of the implementation: Ctrl-Shift-I
Show context: Alt-Q
Show parameters (in a method call): Ctrl-P
Show error description. Ctrl-F1
... plus many more shortcuts to navigate in code and different idea views.
I think it rather nice that you can see just the specific bit of information you are interested in with a simple keystroke.
Have a look at the menus which will also show the possibly modified shortcuts for your keymap.
0
Avatar
Jens Voß
Created June 12, 2008, 09:26
And, elsandros, in addition to what Stephen writes: Since you seem to be interested in IDEA's keyboard shortcuts, I highly recommend the "Key Promoter" plugin which helps you memorize the relevant shortcuts quickly.
Also very useful is the "Goto Action" feature, invoked by Ctrl-Shift-A. In the popup, you can enter a keyword (e.g. "Javadoc"), and the IDE tells you the available actions matching your search, along with keyboard shortcuts and the containing action groups (which often also give you a clue about how to navigate to the action using the menu).

Eclipse autocomplete similar to Netbeans [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Any way to get IntelliJ-like autocompletion in Eclipse?
Is there a way to make Eclipse autocomplete work in a manner similar to one found in NetBeans? I lack completing to the next common part (i.e. type "me", I got suggestion Message, MessageArchive, MessageRouter so the 'tab' would complete to the "Message") and also auto suggesting on "." (or "enter") when there is subsequent possibility.
Tiny things but the lack of them is extremely frustrating…
Goto Window -> Preferences -> Java -> Editor -> Content Assits
In the column Auto activation triggers for Java column, enter this:
.qwertyuioplkjhgfdsazxcvbnm_QWERTYUIOPLKJHGFDSAZXCVBNM
Add any other keys you want. You're done.
You'll have the same effect as Netbeans
Try typing "me" and then pressing Ctrl + Space.
Well if the shortcut: Ctrl+Space doesn't fireup autocompletion, you will need to activate it in your Eclipse IDE.
To do that, go to: Window->Preferences->Java->Editor->ContentAssist and there you can set the parameters that you want.
[EDIT]: Here is a capture to help you with.
The auto complete functionality should be turned on by default. Eclipse pop up a auto complete box after pressing the "." or you can manually do this by pressing STRG + SPACE on PC or CMD + SPACE on a MAC

is there Eclipse useful Add On for AutoComplete function like xCode?

I've started up with developing Java.
However, These days I've started iPhone project and gave me lazy writing code;auto code generate functionality in xCode.
Are there any non-pay free edition add-on exist that does similar to xCode?
I mean, I do know Eclipse already has partial auto method look up when you put '.' (dot) token after class name which shows the list of methods.
thank you all.
The functionality is called content assist in Eclipse. It comes as default.
To trigger content assist, normally you have to click Ctrl+Space (Windows/Linux). But as you said, on Java it will be auto-activated when user press ..
You can however change this behavior. Go to Preferences -> Java -> Editor -> Content Assist and change the Auto activation triggers for Java.
For example to get the behavior of xCode, you could change it to ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
It comes by default with eclipse.
You need to press . then ctrl + spacebar
If ctrl + space doesn't work, you may try Alt + /
I used to think the autocompletion was slow, but it turns out you can make it instant. Go to Window / Preferences / Java / Editor / Content Assist / Auto-Activation and decrease Auto activation delay to zero.
I've been using Code Recommends. This is a very useful Eclipse plugin you must have.
One of my most favorite functionality is
Subwords Completion (you don't need to remember exactly the first letter of method's name, just type in other whatever letter you remember even they're inside).
It also offers many other functionality that may meet your need.

Categories

Resources