Eclipse suddenly opens all files in fully-folded mode - eclipse

Suddenly any Java file I open in Eclipse is being opened in fully-folded mode.
I don't recall changing any settings but presumably I must have hit some special hot key or accidentally clicked someplace to ask for this behavior.
Any clues on how to turn it off? I've tried simply disabling folding but with no success.
Thanks.

Windows -> Preferences -> Java -> Editor -> Folding -> Initially folded elements. Uncheck "members" or hit the "Restore defaults" button.
If you have a similar problem again, try entering a term in the preferences dialog filter box on the upper left. If you enter "folding", you come quite close to the solution already.

Related

Eclipse does not confirm exit when hitting command + q

I generally close tabs while using Eclipse with command+w, however, sometimes hit command+q by mistake. Even though I have Eclipse set-up to warn me when exiting (Preferences -> General -> Start-up and Shutdown, "Confirm exit when closing last window"), this shortcut seems to bypass the warning, which is quite annoying.
Is there a solution to this same as the way Chrome presents a warning when hitting this shortcut? A hack in some plist file maybe? Google searches have not helped much.
OK, so having the same problem with Safari and doing a google search led me to this Apple discussions page. Basically following these steps (via #evenhuis) you can re-map the quit shortcut to any other menu function:
Go to System Preference > Keyboard.
Choose Keyboard Shortcuts
Click Application Shortcuts
Press the + button
Under Application choose Eclipse
For Menu Title input "Show All". (You could use some
other innocuous menu option here)
For Short Cut use ⌘Q

Eclipse: After Editing Long Lines Editor Window Automatically Scrolls to Beginning of Line

Some of my Javascript lines of code are longer than the editor window view. I have recently upgraded to the Helios version of Eclipse and noticed that after editing one of these long lines (I am scrolled to the right), after a few seconds the editor window will automatically scroll back to the left to the beginning of the line. It breaks my concentration and it's so annoying!
Does anyone know how to stop this behavior? I've searched around and haven't been able to find anything other than others being annoyed by this same issue!
I am not willing to turn on word wrap and wrap my lines :).
I was having the same issue and found these open bugs for it on the Eclipse Bugs.
No sign there of having a fix for it, but you can prevent it from happening when you switch the Code Folding off and reload the file.
For java in eclipse :
Windows -> Preferences -> Java ->Editors ->Folding -> Enable Folding (uncheck)
For HTML, JSP, XML etc in eclispe :
Windows -> Preferences -> General -> Editors -> Structured Text Editors -> Enable Folding (uncheck)
If you're using Mac OSX, press OPTION + COMMAND + O to turn off "Toggle Mark Occurrences" - it looks like a highlighter in the toolbar.
I turned off Toggle Breadcrumb, and it fixed my problem.

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"

How can I indent a selected block of text in Eclipse 3.5.2?

I use TAB and Shift-Tab in Visual Studio to indent an entire selection. This does nothing in Eclipse, and I can't seem to find another way to do it.
Update: I wasn't really paying all that much attention to this initially and did not ask the question correctly.
I now realized that it is in XML files where TAB still does not indent a selection. I did not find a setting for this in the properties, so I assume it is not possible.
Tab and Shift+Tab are the normal ways to do this in Eclipse, just like in Visual Studio.
In addition to the keyboard shortcuts, you can also do this from the Source menu. Source -> Shift Left, and Source -> Shift Right.
Have you checked to make sure tab/shift tabbing is working as you expect in other applications? Is there a stuck key on your keyboard preventing the shortcuts from working? Could another application be stealing the keyboard shortcuts? (as odd as that sounds...)
Also, try restarting Eclipse.
ctrl + i ---> it is for making accurate indentation to a block of source code.
Go to Window Menu -> Preferences -> Java -> Editor -> Typing and make sure the `'Tab key adjusts the indentation of the current line' checkbox is ticked.

Can't disable method parenthesis auto-complete in Eclipse

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