Short version- is there a way to turn off Visual Studio Intellisense for the object keyword.
Long version- I'm using Visual Studio 2008 and I'm basically using anonymous types. I begin typing something like:
Assert.AreEqual("/SomePath/Stuff", GetOutboundUrl(
I type in new {
Then I see that Visual Studio has recognised that the method GetOutboundUrl
takes an object and changed the code to new object{
. Now must of the time this is great, except for two reasons:
1) I rarely have code that uses the type object.
2) I am actually trying to create an anonymous type not a object, so this feature is actually serving as a hindrance.
The signature for GetOutboundUrl is as follows (from the book Pro ASP.NET MVC framework if anyone is interested):
private string GetOutboundUrl(object routeValues)
I am wondering if there is a way to turn this feature off but only for the keyword object- I would like to see if I actually miss the autocomplete on object (personally I don't think that I will).
I realise that I can turn this off for all keywords by unchecking "Place keywords in completion lists", but I only want to turn it off for object.
Without changing an actual Visual Studio setting (which I doubt exists), you could type "new ", then ESC, followed by "{". It's not ideal, but it keeps you from having to delete the word "object" each time.
You could address this particular situation by editing the options: "Text Editor" -> "C#" -> "IntelliSense" => "Committed by typing the following characters:". Remove the "{".
I made a ReSharper Live template:
Shortcut: new
Contents:
new { $END$ }
Now I can type n-e-w-TAB and I end up with "new { }" and my cursor between the curlies.
It's not ideal, but it's better.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With