Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Visual Studio's intellisense when using lambda expressions in Razor

When in a Razor .cshtml file, I want to create the line:

@this.Html.LabelFor( x => x.Name )

However, after typing the first 'x', Visual Studio's intellisense attempts to auto-complete this for me.

Is there a way to disable the autoselect when a lambda expression may be typed, as it does in standard .cs files?

I don't want to untick the "Committed by pressing the space bar" option in the Tools/Text Editor/C#/IntelliSense menu.

like image 756
DangerMoose Avatar asked Mar 25 '11 12:03

DangerMoose


People also ask

How do I disable IntelliSense in Visual Studio 2010?

It's actually easy for most languages: Select Tools/Options on the menu. On the Options dialog box, select Text Editor, then select the language you use, then select "General". Uncheck "Auto list members" and "Parameter completion".

How do I change autocomplete in Visual Studio?

Go to Tools | Options | Text Editor | C/C++. This dialog displays a window that allows you to toggle Automatic brace completion. Automatic brace completion is the feature where, when you type { , a corresponding } is automatically typed for you.

Does Visual Studio support IntelliSense?

Visual Studio Code IntelliSense is provided for JavaScript, TypeScript, JSON, HTML, CSS, SCSS, and Less out of the box. VS Code supports word based completions for any programming language but can also be configured to have richer IntelliSense by installing a language extension.


1 Answers

There don't seem to be any options to specifically control intellisense in Razor, in lambdas. However, you could turn on "low impact intellisense" by pressing Ctrl+Alt+Space when you're typing one (and the same to turn it off). This will stop the intellisense automatically select things (you have to manually pick them). Sure, it's a pain to turn on/off all the time, but it might be better than nothing.

like image 175
Danny Tuppeny Avatar answered Oct 04 '22 14:10

Danny Tuppeny