Eclipse jumping to function name on Ctrl-S - java

When I press Ctrl-S to save my Java file in Eclipse it's jumping to the function name. This is very annoying. Someone know what to do about this?

Go to Window->Preferences->General->Keys (you can also search for Keys in the main Preferences window). You most likely have added a binding which makes eclipse jump to the function name when you press ctrl+s.
Another place to look is Window->Preferences->Java->Code Style->Clean Up and Window->Preferences->Java->Editor->Save Actions. That is where all actions are defined which happen when you save/clean up a document.

Try looking at your keyboard bindings. I certainly don't have this problem on either of my Eclipse installs. You might have Ctrl-S assigned to two different actions?

This was really annoying problem for me also.
Solved it by going to Preferences->General->Workspace and unchecking "Refresh on access" checkbox.

I had a similar problem with Ctrl+C malfunctioning in Eclipse.
Here is a similar question regarding it.
Maybe try upgrading to the latest version if the above solutions do not work.

Related

In IntelliJ is there an easier way to set up the "Complete Current Statement" like eclipse?

I have used Eclipse for Java for the last few years and am trying out Intellij. I'm not using it permanently because it isn't as useful for quick programming (like how you can't just drag in files into the src folder) but for doing certain things, I think it will be faster for me.
I know there is Ctrl+Shift+Enter, but this is just annoying to press. Not because it is awkward to press, but because it takes so much time compared to just pressing enter like you can in Eclipse. I tried to rebind it to enter, but then it just doesn't work.
Is there a way to set up the Complete Current Statement so that it happens when I press enter?
Like, is there a way that I can bind it to Enter, but have it checked before the editor checks for enter as move to next line?
If you want only basic Code completion and not Type completion, use Ctrl+Space
IntelliJ and Android Studio are pretty highly customisable. You can rebind shortcuts too, I believe. Have you looked here? https://www.jetbrains.com/idea/help/configuring-keyboard-shortcuts.html
Also cheatsheet might be of use: https://www.jetbrains.com/idea/docs/IntelliJIDEA_ReferenceCard.pdf
And Android specific bindings: https://developer.android.com/sdk/installing/studio-tips.html

How do I turn on auto code completion in IntelliJ?

As the title says, how?
I have looked around the internet and found a bunch of answers saying to go to
Settings|Code|Code completion
but it seems that settings category is gone in version 14 of IntelliJ, which is the one I am using. The reason that it's off in the first place is because the teacher in my Java course has made his own custom code inspection .JAR-file, which when I installed it, turned my automatic code completion off. I have changed that profile back to the default one in every category of the settings that I have found so far, without results. Please help!
Check this option.
If it is not worked, check "keymap" option.
Maybe key was using for other action.

Ctrl+Shift+G no longer works in eclipse

I'm a huge fan off Eclipse hotkeys, Ctrl+Shift+G being one of my favorite. However, I recently had to completely toss out my workspace and load a new one to switch to a new branch after some merge-cause had occured. Either that, or a later checkin which messed with some classpath files, seems to have broken my ability to search using Ctrl+Shift+G. I now always find nothing.
I have multiple maven projects which all link to each other, and I thought the issue originally was with maven. However, I can't even find methods in the same project, or even the exact same file, using Ctrl+Shift+G now.
Can anyone suggest the process I take to make my eclipse aware of my source code such that it can properly search it?
EDIT:
I don't know how I missed this previously. It seems that eclipse is throwing a class-not-found exception looking for the class
org.eclipse.wb.internal.core.utils.dbt.core.project utils
Before this exception is thrown I can do search as normal, after this exception the search breaks. So the issue is actually the exception i'm sure. A reboot does fix things temporarily, Unfortunately, the exception keeps getting thrown after I use eclipse for awhile. So now I'm looking into the cause of the exception. I may post an answer here and/or open a new question depending on how much luck I have researching the cause of the exception on my own.
Open the Preferences dialog. (On Windows, choose the menu item Window>Preferences).
Choose the preferences page General>Keys.
Navigate down to the command References in Workspace. Select it. If the displayed binding is not Ctrl+Shift+G, you can set it by:
Pressing the desired key combination Ctrl+Shift+G.
Pressing the Apply or OK button.
Just an update on this issue. Once I realized the exception was the cause of my issue I researched it on Stack Overflow. I found another question that addressed the issue, though I'm afraid I don't have the link now. The suggested answer though was to start Eclipse with the --clean option. The issue appears to have gone away as soon as I did this.
I have upvoated both the other answers as thank-you for you responses. They were good answers given the information I original provided, it was my fault I wasn't aware of the full issue when I posted the question.
i believe maybe your hotkey was unprogramed somehow, try readding it
Window -> Preferences -> General -> Keys
Mac: Eclipse -> Preferences -> General -> Keys
Hope this helps

Can't Edit JFrame Form after NetBeansUpdate

Lately, I've been working on a project in NetBeans using the GUI editor that's built in. Before I noticed that it generated an XML ".form" file that didn't appear in the Project Explorer Pane which makes sense. Earlier I was working on the form in the "Design" tab when it notified me about 15 updates. I just updated without reading anything which was probably a bad idea but when I restarted the IDE, it showed my GUI ".class" file and ".form" file separately in the Project Explorer and I couldn't switch between "Source" and "Design". I also noticed that the generated code that was usually not editable was now editable.
P.S. I'm able to create a new frame just fine and the design editor still works with new frame
I have encounter the same problem and I have solved it.
The key in this problem, I think, is particular plugins for JFrame in Netbeans are not active after updating, so we only need to activate them. The easiest way to achieve this is create a new JFrame class, so in this progress, NetBeans can activate all relevant plugins for us. Finally, restart NetBeans, then everything would be fine.
Thank you very much for all of you that you give me some idea and clues in this situation:)
Work on a similar problem led me to this discussion concerning Guarded blocks inside form Java source file. I'm not sure it's related to your situation, but it may help you recover.
If you are trying to recover the lost state of the backing xml for the form I don't know what to tell you.
This has happened to me, but I tend to highly componentize the forms (break up the forms into little pieces), which makes this not such a big deal. Have you tried the NetBeans forums? You might get better luck there:
http://forums.netbeans.org/
Nevermind, simple solution.
I finally decided that, after plenty of tinkering, to restart the IDE which I should have though of first. The Java SE Plugin must have crashed or something, anyway it's fixed.
Thanks for the help!
Or just right click on the corresponding .form file and select open. The Design tab/editor reestablishes.

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable's value. Instead, hover behaves as if I were in normal Java perspective:
alt text http://michaelzanussi.com/wp-content/uploads/2009/11/debug_hover.png
I've tried cleaning the project, re-importing it, etc., all to no avail. Anything I'm missing here?
I went to Window - Preferences - Java - Editor - Hovers, hit "Restore Defaults" and "Apply" and that fixed it for me, even though nothing actually changed in the settings...
Go to Window - Preferences - Java - Editor - Hovers.
Is "Combined Hover" selected? Uncheck it; apply; close the window; restart debugging session; go back; check it again; apply.
If the above doesn't help, you can check "Variable Values" option and specify a modifier key for it. Not as convenient as "combined", but should work.
I had this problem too once, I "just" had to restart eclipse, after that the hover mechanism worked again.
The problem was "fixed" by renaming the package.
For whatever reason, this refactoring triggered something in Eclipse, and immediately I was able to view variable values during debugging. Also, when I go back into Preferences under Hovers, I can now see the "Variable Values" option.
I had a similar issue and when I came across this question. My problem was that windows hover time was set to 20s or so (you can test if this is your problem by putting the mouse on a mistake and waiting for a min or so). The registry key "MouseHoverTime" was set to a large value of 200000 ms (normally 400). Fix it by going to start -> run -> "regedit" -> HKEY_CURRENT_USER\Control Panel\Mouse double click "MouseHoverTime" and setting it back to 400.
I think this had been done on my computer a while back to prevent hover popups in another program. Anyway, sorry that my answer doesn't directly apply to this question, but I'm hoping it'll help somebody like me that comes across this thread with a similar issue.
For C++ project, please add -ggdb -0g to the compiler option. Hope this solution can help eveyry C++ programer face with the same issue.

Categories

Resources