When editing a C# source file, I type
new {
Visual Studio auto-corrects it to
new object{
Is there a way to stop this behavior?
When editing a C# source file, I type
new {
Visual Studio auto-corrects it to
new object{
Is there a way to stop this behavior?
Have you checked your auto-complete options for ReSharper? I just tried this in a new (empty) class with the default ReSharper settings and couldn't duplicate it. What version of studio/ReSharper are you using?
Try typing the left brace first, then going back and typing new. VS2008 does this for me (without ReSharper) and, if I remember, this is what I do. It's less typing than deleting the inserted "object".
What are you typing before the new {
?
I've just tried it and it auto-completes with the object type, so if I type:
Button test = new {
it becomes:
Button test = new Button{
But if I type:
var test = new {
it leaves it alone.
I haven't configured my VS2008 install in any way.
You can configure which characters being typed commit the current intellisense selection. In Tools | Options | Text Editor | C# | IntelliSense.
Remove "{" and ensure committed by the space bar is not checked.