Steps to reproduce:
- Create a new console application.
- In the Main(…) method, start at an empty line
- Write "StringBuilder builder=new"
I now naturally want to make a space and then type "StringBuilder();"
BUT, when I enter the space bar CodeRush will instead replace my variable name "builder" with "StringBuilder". (seems to execute som "new" template or something)
NOTE: It only happens when you write that in a flow/sequence. Copy pasting etc prevents it from happening.
Only way to prevent it is to press the escape key, before the space bar.
Here are my settings for Coderush for Roslyn
Hi Marcus,
I have tried to reproduce the issue following your steps and using provided settings, but failed - there is no template expansion or name replacement. Here is a screen cast of my attempts:
https://www.screencast.com/t/w36sL1Xswx4Y
Could you please provide us with a screencast demonstrating the issue in action?
Hi,
I did a screen capture of it. Multiple tries after each other.
Only keys I pressed (which you don't see) is the spacebar. So it is when I press the spacebar after "new" that is behaves strange.
Just for clarification: I disabled the Coderush plugin in Visual Studio and retried.
No problems, behaves as expected (doesn't rename my variable).
So it is related to Coderush. I also have this behavior on two different computers where I copied the CodeRush settings between from one to the other (same configuration as I provided earlier). The second computer was brand-new with a fresh installation of VS 2017.
Marcus,
Thank you for the screencast. I have reproduced the issue using your steps. Our team is working on it.