I need to present a C# application's code as part of a presentation and it must be presented in the IDE itself. Thus, I want to disable any IntelliSense / compiler notices / warnings / code suggestions that might pop up mid-presentation, leaving only color coding.
For example, I do not wish dotted green and blue lines under fields like so:
How can I turn those off, and how can I turn them back on after presentation?
(Note: I use resharper for C#.)
There is no easy way to fully disable IntelliSense in Visual Studio. However, you can turn off (most of) those features that you want to hide.
For example, to prevent the display of those squiggles (for errors and warnings), use the following.
From the "Tools" menu, select "Options." In the pop-up, open the "Text Editor" node in the left-hand window and select the "General" sub-option. Then, in the right-hand pane, uncheck the "Show error squiggles" box.
You can disable/enable (many) other 'annoying' features in a similar manner, although finding where to do so is not always trivial. Remember to look also in the "All Languages" and "C#" sub-nodes (in the left-hand pane) for other features to disable/enable.
Using c#
My Visual Studio suddenly stopped autocompleting me while I write.
for clarification, it does show me the normal completion options but it doesn't highlight the best one, meaning I can't just click enter and it will complete for the best match.
example:
when I write "flo", it suggests "float" but I can't just click enter and it will auto-complete.
any suggestions?
example: when I write "flo", it suggests "float" but I can't just click enter and it will auto-complete.
It sounds like you want the other Intellisense mode, the option is called "toggle IntelliSense suggestion/completion mode" and in the C# configuration the shortcut is Ctrl+Alt+Space:
I've a project on Visual Studio 2019 (with Resharper Ultimate enable) and has been a terrible experience because I can't read the entire line of the code (I've myopia so my font size is 15~18)
But I see that this margin occupies so much space.
Is there any way to change this? I want to keep the number of lines.
For vs 2022 you must set this:
Disable the "Inheritance Margin": Options -> Text Editor -> C# -> Advanced -> Inheritance Margin -> Uncheck "Show inheritance margin"
config
source
Just go to the menu Tools and select the Options submenu.
Then go to the Text Editor node, expand it and go to All Languages node.
Here you will find the Line Numbers option.
Just remove the check to hide the line numbers
Turn off glyph margin in Settings. (I'm currently using VS Code in ubuntu 18.04... should be similar in other OS I think
In settings
It will remove the excess space used for adding breakpoints,etc
Before:
Before
After:
After
I am trying to make VS 2013 stop putting my opening braces on new lines when the code block is not a type. I've gone to Tools -> Options -> Text Editor -> C# -> Formatting -> New Lines and unchecked everything except new lines for types, query expression clauses, and the keyword options.
I hit "OK", and VS STILL keeps putting ALL my opening braces on new lines every time I finish a statement or block or otherwise trigger an auto format. I've even tried restarting VS. No luck.
The settings SAY that they are set to what I wanted, but Visual Studio refuses to obey them. EXTREMELY frustrating. Can anyone help?
Thanks to Lucas Trzesniewski in the question comments, the problem has been found and solved: ReSharper.
I'm working on a machine that another dev was using before me. They installed ReSharper into Visual Studio, which overrides VS's settings with its own. I didn't even know that ReSharper existed--hence my confusion.
For anyone else who didn't know about ReSharper, here's how to set up your opening brace formatting:
Go to Tools -> Options. In the collapsible lists on the left, go to ReSharperPlatformVs12 -> General and click the Options... button that appears on the right.
There will be another set of collapsible lists on the left of the window that pops up. In these, go to C# -> Formatting Style -> Braces Layout.
On the right side, you should find a set of options in a collapsible "Braces Layout" list, each with a drop-down full of all the many ways you can make it treat opening braces for that option. Go ham and set them how you wish :D
NOTE The keyword here is "default". I know I can hit escape and the default behavior gets aborted. I don't want to hit the escape key every time the IDE thinks it knows what I want. I didn't have to do this in 2013.
ADDENDUM 2 It seems I'm still having difficulty communicating what I'm after here. What I want to happen is nothing when I press the space bar... I just want a space character to show up on my screen. The only time I want the IDE to actually insert a suggestion is when I hit the tab bar. I hope that's clearer?
This is driving me nuts. 2013 and before allowed you to set completion characters (maybe that was resharper?) But in 2015 I see no way to stop the default behavior of autocomplete.
For example, say I have a class Foo, but I don't have the namespace specified already, yet I have a class FooBar in one of the specified namespaces, if I type:
public void DoSomething(Foo// <-- then a space)
...it automatically puts FooBar. How the heck do I turn off this behavior?
I should mention that I still want Autocomplete, just on tab though.
Edit -> Intellisense -> Toggle Completion Mode
From : https://msdn.microsoft.com/en-us/library/hcw1s69b.aspx
"You can also change to suggestion mode, in which only the text you type is inserted into the code. For example, if you enter an identifier that is not in the list and press TAB, in completion mode the entry would replace the typed identifier. To toggle between completion mode and suggestion mode, press CTRL+ALT+SPACEBAR or click Edit/IntelliSense/Toggle Completion Mode."
For all who have the same problem in Visual Studio Code, add this line to the User Settings:
"editor.acceptSuggestionOnCommitCharacter": false
change the setting for Editor: Accept Suggestion On Enter to off
If you're using Resharper and Visual studio 2017, you may need to use a combination of the existing answers to stop getting the autocomplete behaviour when pressing space. This is too long for a comment so added an answer.
Make sure in Visual studio that intellisense Toggle Complete Mode is off/unselected (as noted in other answers). Note: If you turn on the "Text editor" icons in the VS toolbar at the top, you'll see an extra icon that gets highlighted on and off showing you whether intellisense is toggled on or off.
AND
In the resharper dropdown on the toolbar (Resharper > Options...), Go to IntelliSense > Completing Charactes > and then uncheck the "Complete on space" box for C#.
Now autocomplete doesn't occur when pressing space (can still use tab, etc to autocomplete).
(Related aside: This autocomplete on space is really bad if you use VSVim, because you can't by default use the typically vim ESC key to 'get out' of the autocomplete mode. e.g. it's very difficult to even type in the static modifier for a variable/function without it changing to some other autocomplete choice.)
If you use Vs2017 and the setting resets everytime you launch Vs, i created a small script that automatically disables space completion at launch using Visual Commander Extension:
enter link description here
Visual Studio 2019 Pro -> Options -> Text Editor -> Advanced -> disable "Responsive code completion"
This disables Completion Mode, but doesn't take effect when VS is restarted.
You have to enable & disable it again after each restart, which is worse than using the Toggle Completion Mode menu option.
Since it is in Options, it is probably supposed to be a permanent setting.
Since Visual Studio is constantly changing, I imagine there will constantly be new answers for this. None of the other answers worked for me on Visual Studio 2019 Community Edition. What did work (as of January 2022) was:
Edit > IntelliSense > Switch between automatic and tab-only
IntelliSense completion
Alternatively, you can just toggle it with Ctrl+Alt+Space. Hopefully this helps someone else. Also, I've noticed Visual Studio doesn't seem to remember this setting, and I've had to toggle it again the next time I used VS.
For those looking for the same thing in VSCode (2022)
File -> Preferences -> Settings and search for Accept Suggestion On Commit Character.
Make sure this setting is unchecked:
For the current version of Visual Studio Code (2020), you can change to suggestion mode by going to File > Preferences > Settings and then going to Extensions > TypeScript and then checking TypeScript: Disable Automatic Type Acquisition. Or, after going to Settings, you can search for "Type Acquisition" in "Search Settings" and then check TypeScript: Disable Automatic Type Acquisition.
Default IntelliSense completion mode
Another option for VS19 Enterprise:
Visual Studio 2019 Enterprise -> Options -> Text Editor -> Advanced -> Default IntelliSense completion mode -> Dropdown -> Tab-only
I just did this in Visual Studio by going to:
File > Preferences > Settings > toggle "Suggest on Trigger Characters"
I also toggled off "Auto Suggestion on Commit Character" and "Accept Suggestion on Enter"
- however you may want those settings.