IDEA pickier when refactoring?

Hi there,

I've noticed, recently, that IDEA fails to perform some simple refactorings when there are some errors in the code (unrelated to the attempted refactoring).

I don't remember having to deal with this type of problems before, but this is the second time I encountered this with the latest Maia builds. I attached a picture showing a failed attempt to inline a variable (the account variable in the picture). In this case, the problem is the incomplete if statement two lines below (commenting it out solves the "problem" and the inlining works as expected).

The other similar limitation was related to a change signature refactoring, failing to initiate when some code was not completely flushed out somewhere else in the method body the refactoring was attempted from.

I haven't checked in older builds (I don't have one handy at the moment), but I've always enjoyed IDEA's capability to deal with incomplete code when performing refactorings (as opposed to Eclipse which is very picky in these cases).

Is this a regression? Can we have it fixed so unrelated errors don't stop the refactorings?

Thx,
Andrei



Attachment(s):
failInline.png
0
3 comments

I've noticed this too, for while now. Kind of like Eclipse...

0
Avatar
Alexander Chernikov

Hello Andrei,

With such code I get the same error message in IDEAs 8.1.3 and 7.0.4. So,
it's hardly a regression.

On the other side, an improvement issue can always be submitted to the tracker.

Hi there,

I've noticed, recently, that IDEA fails to perform some simple
refactorings when there are some errors in the code (unrelated to the
attempted refactoring).

I don't remember having to deal with this type of problems before, but
this is the second time I encountered this with the latest Maia
builds. I attached a picture showing a failed attempt to inline a
variable (the account variable in the picture). In this case, the
problem is the incomplete if statement two lines below (commenting it
out solves the "problem" and the inlining works as expected).

The other similar limitation was related to a change signature
refactoring, failing to initiate when some code was not completely
flushed out somewhere else in the method body the refactoring was
attempted from.

I haven't checked in older builds (I don't have one handy at the
moment), but I've always enjoyed IDEA's capability to deal with
incomplete code when performing refactorings (as opposed to Eclipse
which is very picky in these cases).

Is this a regression? Can we have it fixed so unrelated errors don't
stop the refactorings?

Thx,
Andrei

Alexander.


0

Hello Alexander,

I see. Thanks for checking. I'll file an enhancement request, as I'm quite
sure you can make IDEA friendlier here.

Best,
Andrei

AC> Hello Andrei,
AC>
AC> With such code I get the same error message in IDEAs 8.1.3 and
AC> 7.0.4. So, it's hardly a regression.
AC>
AC> On the other side, an improvement issue can always be submitted to
AC> the tracker.
AC>


0

Please sign in to leave a comment.