19

I used Visual Studio 2022 for some time now and it has a really annoying behaviour. When I enter a quotation mark ›"‹ before existing text, to wrap this text in quotation marks, Visual Studio instead enters two quotation marks before the text.

In earlier versions this only happened if you'd entered the quotation mark at the end of the line, but not before existing text.

Very often, I only want to enter one quotation mark and Visual Studio writes two. I thought maybe I get used to this behaviour, but I didn't.

Has anyone an idea how to deactivate this behaviour.

I already deactivated all Extensions just to be sure this behaviour was not caused by an extension.

3
  • It seems, despite what I wrot in the question, Visual Studio 2019 is behaving the same way. Either I remember it wrong or it got changed with a recent update. Anyway, I would still like to deactivate that behaviour (at least when putting a quotation mark directly before existing text, where this behaviour is the most annoying). Jan 18, 2022 at 17:40
  • OK, I tried it again in Visual Studio 2017. Entering a quotation mark at the end of the line enters two quotation marks, but entering a quotation mark before existing text only enters one. I will change my question accordingly. Jan 18, 2022 at 17:44
  • This is a serious issue for me as well -- not only it inserts an additional unwanted quote before text, it also reformats the following text! For example if it was Call failed, error = %08lx it becomes Call failed, error = % 08lx -- good luck finding all the changes in a longer line of text unless you immediately hit Undo. Whoever thought this behavior is helpful has obviously never written a single line of code. Apr 15, 2022 at 10:26

2 Answers 2

12

Automatic Brace Completion is per-language setting, you can disable it for a language or for all of them:

Note that it will affect not only quotes, but also { or (.

enter image description here

4
  • 5
    Ok, thanks, but actually I don't want to deactivate it for Braces and stuff. Only for quotation marks. But if this button deactivates both, than this probably will not be possible 😢. Jan 18, 2022 at 17:53
  • @MartiniBianco unfortunately, quotes are considered a form of brace in this case.
    – Jimmy
    Jan 18, 2022 at 23:59
  • After investigating a little further, I realized that the actual behaviour is buggy in current version of Visual Studio. 2019 also had this behaviour to add second quotation mark, but only in certain places, like at the end of a line etc. When entering one directly before a character, than of course no second mark was added. But current version Visual Studio 2019 and 2022 add a second mark there, what of course really don't make sense. Feb 8, 2022 at 9:15
  • 3
    This feature should be turned off by default and buried in the source code.
    – Watson
    Mar 29, 2022 at 18:31
0

In case of C++, you will need to set "Complete Parenthesis in Raw String Literals" to False at Options -> Text Editor -> C/C++ -> Advanced -> Brace Completion -> Complete Parenthesis in Raw String Literals.

enter image description here

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.