Refactor Rename oddity

I have a block of code like this:

...
catch (Exception excp) {
...
}

And I want to use Refactor-->Rename to rename "excp" to just "ex".

Except I can't. I type "ex" into the red oulined box, and it shows a
suggestion of "exception" as a possible variable name. That's fine, but I
don't want that, I just want "ex". Really, I do. Honest. But anything I
type ... enter, tab ... selects "exception" and renames "excp" to
"exception" instead of to "ex", which is what I typed, and which is what I
want.

I'm sure there has to be a way to do this. Am I just being dumb? Or is
this an issue with Resharper?

This is just one example, I've encountered others. I've ended up just
giving up on the rename refactoring, and just changing the name manually
everywhere, which is fine for local variables or parameters, but not so good
for method names.



1 comment
Comment actions Permalink

Hello Paul,

PB> I'm sure there has to be a way to do this. Am I just being dumb?
PB> Or is this an issue with Resharper?
Resharper tries to guess name from type. If you don't want this behaviour
- hit ESC when you are presented with suggestion list, then type what you
want.

Sincerely,
Ilya Ryzhenkov


0

Please sign in to leave a comment.