[814] Text highlighted after silent clean-up

Scenario:
- my cursor is sitting on a line of code
- I press C-S-A-f to do a silent code clean-up. In pressing these keys, I
release the "f' before the modifier keys, and release all the keys before
the clean up is complete
- the code is cleaned up (good)
- the line of code I was on is now highlighted, ready to be moved (bad)

This does not happen all the time. It must be very sensitive to when the
keys are pressed/released.

Please fix so that a code Move is not started immediately after a slient
clean-up, unless the keys are released and pressed down again!


8 comments
Comment actions Permalink

Hello,

Please fix so that a code Move is not started immediately after a
slient clean-up, unless the keys are released and pressed down again!


The move is started only when you press the arrow keys, holding CAS just
highlights the area without entering any special mode or whatever, so you
do not have to worry about the code being moved accidentally.

The unwanted highlighting may be disturbing, and we're working on the cases
when it should be suppressed.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

I don't know if this is part of the same issue or not, but I'm noticing that sometimes after code cleanup I am finding a block of text not selected but rather highlighted in light blue as if I tried to highlight usages in file or something along those lines, and that I must press Esc to clear the highlighted block.

0
Comment actions Permalink

I get that sometimes too. Forgot to mention it in the first post.

"Jeremy Gray" <no_reply@jetbrains.com> wrote in message
news:9971257.51841212456753473.JavaMail.jive@app4.labs.intellij.net...
>I don't know if this is part of the same issue or not, but I'm noticing
>that sometimes after code cleanup I am finding a block of text not selected
>but rather highlighted in light blue as if I tried to highlight usages in
>file or something along those lines, and that I must press Esc to clear the
>highlighted block.


0
Comment actions Permalink

Hello,

I don't know if this is part of the same issue or not, but I'm
noticing that sometimes after code cleanup I am finding a block of
text not selected but rather highlighted in light blue as if I tried
to highlight usages in file or something along those lines, and that I
must press Esc to clear the highlighted block.


Could that be a leftover from some previous Highlight Usages run?


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

I haven't used highlight usages in the last couple of days (and am strongly in the habit of Esc-ing my way out of it right after using it, even if I had used highlight usages) but have done lots of code cleanup runs and am seeing this light blue block quite frequently. It isn't the size of the entire cleaned-up code, by the way, it is just a five or so line section near the top of the file. If it happens again today I'll try to pay more attention to whether or not there are any patterns in what is left highlighted.

0
Comment actions Permalink

Hello,

I haven't used highlight usages in the last couple of days (and am
strongly in the habit of Esc-ing my way out of it right after using
it, even if I had used highlight usages) but have done lots of code
cleanup runs and am seeing this light blue block quite frequently. It
isn't the size of the entire cleaned-up code, by the way, it is just a
five or so line section near the top of the file. If it happens again
today I'll try to pay more attention to whether or not there are any
patterns in what is left highlighted.


If you change the color for "ReSharper Rearrange Up/Down Code Hint" in Fonts
and Colors so that it does not match the Highlight Usages color, what would
that leftover highlighing color be?


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0
Comment actions Permalink

The color I am seeing follows the "ReSharper Rearrange Up/Down Code Hint" color as you seem to have suspected. Further, I confirmed (before noticing your reply, which is how I logged on and came to notice it in the first place ;) ) that the block of code being highlighted in this manner does not match the amount of code having been cleaned up but does, however, consistently follow this pattern:

Given the line in which the caret is positioned when cleanup is executed, that line, and anything scoped within what is declared on that line, is highlighted as a block: If the caret was in a normal line of code, that line of code is highlighted in full. If the caret was in a member declaration, that whole member is highlighted. If the caret was in a type declaration, that whole type is highlighted. If the caret was in a whitespace-only line that was removed by the clean-up process, the line on which the caret is left afterwards is highlighted using the other patterns (and generally results in highlighting an entire type or member.)

There are some exceptions: If the caret was in a namespace declaration line, nothing is highlighted. If the caret was in a whitespace-only line that was not removed by the cleanup process, nothing is highlighted.

That last one varies, however, e.g. if the whitespace-only line is at the outermost scope of the file (e.g. right below file-level using statements), in which case that line is highlighted in full from margin to margin.

Note that when I am executing cleanup and seeing the above behaviour, there is no current selection. When there is a current selection, only that selection is cleaned up and I am left with no strange highlighting.

0
Comment actions Permalink

Addendum:

(I suspect this might shed some light on why the namespace wasn't highlighted in my files...)

If the caret is in a line that has no peer at the same level (e.g. it is in the only line of code within a member, the only member declaration within a type, the only type within a namespace, the only namespace within a file), no highlighting appears.

Useful or not I can not say, but more info cannot hurt. :)

0

Please sign in to leave a comment.