Question

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.

Was it helpful?

Solution

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 );).

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top