Stop default Autocomplete behavior when hitting spacebar in Visual Studio 2015

C#IdeSettingsVisual Studio-2015Options

C# Problem Overview


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.

C# Solutions


Solution 1 - C#

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."

Solution 2 - C#

For all who have the same problem in Visual Studio Code, add this line to the User Settings:

"editor.acceptSuggestionOnCommitCharacter": false

Solution 3 - C#

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.

  1. 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

  2. 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.)

Solution 4 - C#

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

Solution 5 - C#

change the setting for Editor: Accept Suggestion On Enter to off

Solution 6 - C#

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.

Solution 7 - C#

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.

Solution 8 - C#

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.

Solution 9 - C#

Default IntelliSense completion mode

Another option for VS19 Enterprise: > Visual Studio 2019 Enterprise -> Options -> Text Editor -> Advanced -> Default IntelliSense completion mode -> Dropdown -> Tab-only

Solution 10 - C#

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: Accept Suggestion On Commit Character

Solution 11 - C#

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeremy HolovacsView Question on Stackoverflow
Solution 1 - C#RobbieView Answer on Stackoverflow
Solution 2 - C#DionysosView Answer on Stackoverflow
Solution 3 - C#FXQuantTraderView Answer on Stackoverflow
Solution 4 - C#EncoderXView Answer on Stackoverflow
Solution 5 - C#Chris ConcannonView Answer on Stackoverflow
Solution 6 - C#jk7View Answer on Stackoverflow
Solution 7 - C#leishengView Answer on Stackoverflow
Solution 8 - C#Sayyor YView Answer on Stackoverflow
Solution 9 - C#pawelelView Answer on Stackoverflow
Solution 10 - C#HackissView Answer on Stackoverflow
Solution 11 - C#user3386826View Answer on Stackoverflow