8

I like the functionality of autoclosing brackets, quotations, etc... but when you're inside a string for instance: "<inside here>" and you start typing a single quote or if the quotes are inverted it'll try to auto pair quotations inside the string. Is there a way to disable this functionality inside strings?

exts
  • 9,788
  • 4
  • 19
  • 21
  • 2
    There is no separate switch for selectively disabling quotation matching, only a global setting for all. – ifconfig Sep 23 '17 at 18:05
  • I've answered to this question on other place. Here is the link: https://stackoverflow.com/questions/56253814/how-to-turn-off-double-quotes-auto-completion-in-visual-studio-2019-for-c-edit/58975154#58975154 – Kiril Dobrev Nov 21 '19 at 12:59

5 Answers5

7
// Controls if the editor should automatically close brackets after opening them
"editor.autoClosingBrackets": false,

In your settings.json file will disable auto-closing brackets, parentheses, quotes, etc.

There is no separate switch for selectively disabling quotation matching, only a global setting for all.

ifconfig
  • 6,242
  • 7
  • 41
  • 65
4

There is a setting to disable auto-closing of all quotes in the latest version of VSCode as of August 2018 in VSCode 1.27. Add this to your settings.json:

"editor.autoClosingQuotes": "never"

If you want to disable this for a specific language, nest the above setting under a language-specific setting. For example, to exclusively disable this for the scheme language,

"[scheme]": {
  "editor.autoClosingQuotes": "never",
},

Unfortunately, I do not think there is an option to exclusively disable auto-closing of single quotes or double quotes.

dlq
  • 2,743
  • 1
  • 12
  • 12
0

Try (Ctrl + Shift) while marker is in the string or something like that.

Kiril Dobrev
  • 839
  • 1
  • 8
  • 12
  • This is a vscode question - does your solution work for vscode? – Mark Nov 22 '19 at 00:36
  • I'm using vs 2019 community. I had the same problem but with c#. Looked for advise in the net but found answer accidentally. I've done many test and with me works for double and single quotes. – Kiril Dobrev Nov 23 '19 at 01:21
0

I used Prettier to organized my code. when used single quote it will automatic become double quote. you can use this setting.

file>preference>setting type prettier : single quote

tick the radio button (if true, will use single instead of double quotes)

thank you

0

I tried editing the settings within the VSC settings UI and it wouldn't change it. I had to edit the settings.json file and add a line. The settings.json file is located in: C:\Users\<Your_User>\AppData\Roaming\Code\User and add this line: "editor.autoClosingBrackets": false,

WaXxX333
  • 388
  • 1
  • 2
  • 11