37

I have a very annoying problem in Visual Studio. (My version is 2010 and I have ReSharper and VsVim installed, but I don't think that matters.) When I go to add text before some code at the beginning of some existing code, autocomplete likes to overwrite some of the existing code.

Take this example code:

initial code example

When I begin to insert some code at the beginning of the string.Format:

enter image description here

And then I use Tab to autocomplete, it overwrites string, whereas what I wanted was the autocompleted code to be inserted before string:

enter image description here

I don't want it to automatically delete the text after what I am autocompleting. If I want the text deleted, I can delete it myself very easily (particularly with VsVim). Is there any way I can prevent this behavior? I find myself working around it all the time.

Keith Pinson
  • 7,835
  • 7
  • 61
  • 104

3 Answers3

16

With Reshaper 2018.3 I found this is how to disable the behavior you're encountering

Go to Resharper -> Options -> Enviroment -> Intellisense -> Completing Characters

For the option Tab Key choose Insert instead of the default Replace

Michael C.
  • 161
  • 1
  • 2
13

Try using Enter or Space instead of Tab.

Keith Pinson
  • 7,835
  • 7
  • 61
  • 104
azed
  • 156
  • 2
  • 4
  • 2
    You just made my life so much better. Is there a way to remap these to Tab, I wonder...? – Keith Pinson Nov 20 '14 at 19:47
  • 2
    I have VS2013, and neither enter nor space prevent it from overwriting. :( – Nick May 08 '15 at 18:11
  • 1
    I withdraw my above comment. You need to toggle completion mode with Ctrl+Alt+Space or go Edit > Intellisense > Toggle Completion Mode. – beruic Feb 10 '16 at 16:02
  • Not so good for me, when I just write a part of a word and hit space or enter, I actually type a space or newline. It only works when I begin selecting suggestions with arrows, so the next answer is better for me – Yuri Kovalenko Mar 19 '20 at 08:28
1

I cured this in Visual Studio 2015 (resharper ultimate 2016.3.1) by disabling Resharper IntelliSense.

Go to...

Resharper -> Options -> Environment -> IntelliSense -> General

...and select "Visual Studio".

Phil
  • 77
  • 6