Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to turn off double quotes auto-completion in Visual Studio 2019 for C++ editor?

After updating to version 16.1 of Visual Studio 2019, the code editor for C++ completes double quotation characters. When I type one double quote " it automatically completes it as "".

How to turn this feature off? I tried to look into settings, but could not find in C++ Editors settings or All Languages settings.

Update: it actually only completes when I type wide string literal starting with L. For example, when I type L" it auto-completes it to L""

Update 2: it happens for some .cpp files but not for others. I currently do not see any pattern. Seems like a bug.

like image 385
Maris B. Avatar asked May 22 '19 09:05

Maris B.


People also ask

How do I turn on autocomplete in Visual Studio?

The suggestion list of Automatic completion appears as soon as you start typing a new identifier. The suggestion list of Basic completion appears when you press the default Visual Studio IntelliSense shortcut Ctrl+Space .

How do you escape double quotes in C#?

To escape double quotes on “Csharp”, we use the @ symbol at the start of the string and place the double quotes inside the other pair of the double quote (like this “Csharp”). You must put @ symbol before this string.


2 Answers

Update October 2019: it is fixed now starting from version 16.3.2. If not, then check your settings carefully.

Short version: This is a bug in Visual Studio, and hopefully will be fixed. You can up-vote it here.

Longer version: I decided to report this bug to Visual Studio Team, but someone already did that. So if you are affected by this issue, consider up-voting it.

Link to VS bug tracker: Brace completion when member list is up does not put the character in the right position

Note, that while title of above bug may sound like only Code Analysis is affected, VS Team have marked another - more relevant bug as a duplicate to the above bug (C++ automatic quote completion). And it is not possible to vote closed bug, so only option is to vote the first one I mentioned.

like image 108
Maris B. Avatar answered Dec 29 '22 00:12

Maris B.


Double quote auto-completion is disabled when automatic brace completion is disabled.

You can disable that in the Tools->Options->Text Editor->C/C++->General menu.

Options menu screenshot

As noted in one of the other answers, that option doesn't work properly in some older versions of Visual Studio 2019.

like image 31
Adam Avatar answered Dec 29 '22 01:12

Adam