Closing brackets for autocomplete

Hello!

Can anyone explain to me the reason for the following behaviour:

"Independently on this option group, if a method is void the autocompletion
inserts both opening and closing brackets as well as a semi-colon (the caret
will be positioned inside the brackets or right after them, depending on
whether a method requires parameters or not)."

I cannot see how void-ness of the method can affect the usage of the
parentheses. Anyway, I do not quite like it. In particular, if I have

logger.debug(message);

and delete "debug" method name, then press ctrl-space and select "warn" from
the menu. "Warn" is inserted with parentheses and semicolon, wich is totally
out of line.

Thank you for consideration,
Michael J.


3 comments
Comment actions Permalink

I agree, more of a nuisance, I think there should be a check for a () following immediately after the insert point, and not add them if they're there. You should file a request for that. I think that's a bug really.

0
Comment actions Permalink

Hello,

You can get your intended behaviour if you use Tab instead of Enter to accept the item in the auto-complete list.

For example, if you have:

logger.|debug(message);

And the caret is after the . as shown, and you pressed Ctrl+Space, and you selected warn, Press Tab instead of Enter to get :

logger.warn(message);

Hope this helps,
Best Regards,
Mohamed.

0
Comment actions Permalink

Can anyone explain to me the reason for the following behaviour:

>

"Independently on this option group, if a method is void the

autocompletion

inserts both opening and closing brackets as well as a semi-colon (the

caret

will be positioned inside the brackets or right after them, depending on
whether a method requires parameters or not)."


The reason is inserting ';' in case of void method (I guess it's obvious how
this depends on voidness).

parentheses. Anyway, I do not quite like it. In particular, if I have

>

logger.debug(message);

>

and delete "debug" method name, then press ctrl-space and select "warn"

from

the menu. "Warn" is inserted with parentheses and semicolon, wich is

totally

out of line.


Just use Tab instead of Enter when choosing from the lookup list. This issue
does not depend on method voidness.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"


"Michael Jouravlev" <mikus@mail.ru> wrote in message
news:auso8o$67a$1@is.intellij.net...

Hello!

>

Can anyone explain to me the reason for the following behaviour:

>

"Independently on this option group, if a method is void the

autocompletion

inserts both opening and closing brackets as well as a semi-colon (the

caret

will be positioned inside the brackets or right after them, depending on
whether a method requires parameters or not)."

>

I cannot see how void-ness of the method can affect the usage of the
parentheses. Anyway, I do not quite like it. In particular, if I have

>

logger.debug(message);

>

and delete "debug" method name, then press ctrl-space and select "warn"

from

the menu. "Warn" is inserted with parentheses and semicolon, wich is

totally

out of line.

>

Thank you for consideration,
Michael J.

>
>


0

Please sign in to leave a comment.