Hiding tip?

Is there any way to hide or disable resharper suggestion to split
declaration and assignment? A tip I simply can't believe is offered since I
think it's a big anti pattern, and it annoys me constantly.


5 comments
Comment actions Permalink

A tip I simply can't believe is offered since I
think it's a big anti pattern


I find it a very useful intermediate step to
prepare the code for other refactorings.


Ramon Leon schrieb:

Is there any way to hide or disable resharper suggestion to split
declaration and assignment? A tip I simply can't believe is offered since I
think it's a big anti pattern, and it annoys me constantly.


0
Comment actions Permalink

I feel compelled to comment on this:

given:

foreach (int i in ii)
{
int j = foo(i);
if (j == 3) break;
}

if now I want to use j outside of the block:
foreach (int i in ii)
{
int j = foo(i);
if (j == 3) break;
}
bar(j);

I need to split the j declaration and promote it to the next enclosing
scope, this is where the split declaration is very useful:
foreach (int i in ii)
{
int j;
j = foo(i);
if (j == 3) break;
}
bar(j);

==>
int j;
foreach (int i in ii)
{
j = foo(i);
if (j == 3) break;
}
bar(j);

"Ramon Leon" <rleon@insario.com> wrote in message
news:ds8of0$iqs$1@is.intellij.net...

Is there any way to hide or disable resharper suggestion to split
declaration and assignment? A tip I simply can't believe is offered since
I think it's a big anti pattern, and it annoys me constantly.



0
Comment actions Permalink

And then, we are really looking forward to:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=5114


"Amir Kolsky" <kolsky@actcom.net.il> wrote in message
news:dsa2f8$jlo$1@is.intellij.net...
>I feel compelled to comment on this:
>

given:

>

foreach (int i in ii)
{
int j = foo(i);
if (j == 3) break;
}

>

if now I want to use j outside of the block:
foreach (int i in ii)
{
int j = foo(i);
if (j == 3) break;
}
bar(j);

>

I need to split the j declaration and promote it to the next enclosing
scope, this is where the split declaration is very useful:
foreach (int i in ii)
{
int j;
j = foo(i);
if (j == 3) break;
}
bar(j);

>

==>
int j;
foreach (int i in ii)
{
j = foo(i);
if (j == 3) break;
}
bar(j);

>

"Ramon Leon" <rleon@insario.com> wrote in message
news:ds8of0$iqs$1@is.intellij.net...

>> Is there any way to hide or disable resharper suggestion to split
>> declaration and assignment? A tip I simply can't believe is offered
>> since I think it's a big anti pattern, and it annoys me constantly.
>>
>



0
Comment actions Permalink

I find it a very useful intermediate step to
prepare the code for other refactorings.


Were it in the refactoring menu, and not popping up and bugging me, I
wouldn't mind it. I tend to see the little light bulb as things that need
to be done, rather than refactorings.


0
Comment actions Permalink

It has two different colors, red and yellow.

I suspect the yellow color was meant to make
things accessible very conveniently (Alt-Enter)
without detours to the menu, whereas the red
color offers ways to fix something that needs
to be fixed.

Ramon Leon schrieb:
>> I find it a very useful intermediate step to
>> prepare the code for other refactorings.


Were it in the refactoring menu, and not popping up and bugging me, I
wouldn't mind it. I tend to see the little light bulb as things that need
to be done, rather than refactorings.

0

Please sign in to leave a comment.