# completion by pressing Tab behaves differently Follow

When I've got this piece of code (overly simplified):

double x = Math.cos(Math.PI);

...and I want to change "cos" to "sin", I'd delete "cos", type 's' after the dot, hit Ctrl+Tab, choose "sin" and hit Tab.

Previously it would result in:

double x = Math.sin(Math.PI);

Currently it results in:

double x = Math.sin();Math.PI);

...which is very annoying, because now I have to remove the unwanted closing parenthesis and semicolon.

Is it a bug or a feature? If it's a feature, is it possible to configure IDEA to use the "old" behaviour?

Please sign in to leave a comment.

I'm quite sure this is a bug - and an annoying one. Please file a JIRA

for it.

Sergei S. Ivanov wrote:

Yep been noticing this a lot myself recently...

Martin Fuhrer wrote:

>> When I've got this piece of code (overly simplified):

>> double x = Math.cos(Math.PI);

>> ..and I want to change "cos" to "sin", I'd delete "cos", type 's'

>> after the dot, hit Ctrl+Tab, choose "sin" and hit Tab.

>> Previously it would result in:

>> double x = Math.sin(Math.PI);

>> Currently it results in:

>> double x = Math.sin();Math.PI);

>> ..which is very annoying, because now I have to remove the unwanted

>> closing parenthesis and semicolon.

>> Is it a bug or a feature? If it's a feature, is it possible to

>> configure IDEA to use the "old" behaviour?

The last days I tried to find out, what I have done wrong :)

Hope this will be fixed soon.

Sometimes I am not sure whether those IntelliJ guys use their own

software ;).

Johannes Schneider

Martin Fuhrer wrote:

>> When I've got this piece of code (overly simplified):

>> double x = Math.cos(Math.PI);

>> ..and I want to change "cos" to "sin", I'd delete "cos", type 's'

>> after the dot, hit Ctrl+Tab, choose "sin" and hit Tab.

>> Previously it would result in:

>> double x = Math.sin(Math.PI);

>> Currently it results in:

>> double x = Math.sin();Math.PI);

>> ..which is very annoying, because now I have to remove the unwanted

>> closing parenthesis and semicolon.

>> Is it a bug or a feature? If it's a feature, is it possible to

>> configure IDEA to use the "old" behaviour?

Done:

http://www.jetbrains.net/jira/browse/SELENAMS-117

on 7.0M1a it works as you describe it should.

resulting in

double x = Math.cos(Math.PI);

Not Tab only, same with Space: http://www.jetbrains.net/jira/browse/IDEA-12605

Maybe because 7.0M1a is build 6827 and I am on EAP 6913 now.

Yes, I've been noticing this as well.

I think it's been fixed in 6951. Thanks, JetBrains.