You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auto close single and double quotes aren't working #26820
bugIssue identified by VS Code Team member as probable bugeditor-autoclosingEditor automatic closing of parens / brackets / etc.keyboard-layoutKeyboard layout issuesmacosIssues with VS Code on MAC/OS XverifiedVerification succeeded
For some odd reason, single and double quotes are not self closing.
Brackets and parentheses are working fine though.
VSCode Version: April 2017 (1.12) OS Version: macOS Sierra (10.12.4)
Reacted by Rogerio Prado de Jesus, Stanley Nguyen, GoodFolk Agency, Ruben, Arno B., Julio Coelho, forgng, Rafael Ribeiro, Himanshu Mandal, Jason Bacchetta and 20 more
Reacted by CS, Rogerio Prado de Jesus, GoodFolk Agency, Alexander, Changa Imara SA, Kacper Kozak and André Mácola
Vinicius Vinhas (@vvinhas) can you try to run Code without any extension by code --disable-extensions? Besides, can you open Help --> Developer Tools and see if there is any error there?
Same bug here. Version 1.15.1 and macOS 10.12.6.
Maybe it has something to do with my keyboard using the double and single quotes key as also accent triggers, for letters such as é, á, ä? (in my case Portuguese).
Because for me the same thing also happens for backtick brackets, not only single and double quotes. However, this is not a keyboard isolated bug, since I tested Sublime and Atom and they did not show this behavior.
@vtr83 the problem with this approach is that in languages like portuguese, we accentuation in words for exemple á é í ó ú and we do that with the same single quote key
Reacted by Vinicius Vinhas, Lucas Tormin and Ivan Aponte
I also use a Brazilian keyboard (Brazilian Pro is the name of the keyboard configuration in macOS). I just added the standard U.S. keyboard, and it no longer bugs with quotes, however, I can no longer use accented characters such as á, é, í, ó, ú that way, because the keyboard now treats the quotes simply as quotes, not helper keys for accents. I do not wish to need to keep switching around all the time while coding, when I need to write a string in Portuguese. So the problem is VS Code can't handle that keyboard configuration for some reason. Other editors I've tested have that behavior for quotes if you press once and then space, which is the expected behavior in that case.
Learnt Portuguese a little bit (my first language doesn't have accents) and pushed a fix for this issue. The auto closing will be triggered when you press an acute accent like ' and press space. Please note that the auto closing logic is the same as when you use US keyboard layout.
Techinically auto close doens't kick in before the fix because inserting ' in US international or Portuguese will switch the IME to composition mode, a following space quits the composition mode but we didn't try to see if we should do an auto closing.
You can have the fix from tomorrow's Insiders and next month's Stable.
To verifiers (VSCode team member):
Please verify on different keyboard layouts which support acute accents
Please verify auto close language configuration works properly
Reacted by Vinicius Vinhas, eqperes, Vitor Hugo de Oliveira, Danilo de Carvalho Souza and Alan Raso
Peng Lyu (@rebornix) I've made some tests and when I select and try to wrap the text with single or double quotes, the text is replaced by the quotes. Another strange behavior that I noticed happens when you are in a single line comment in a javaScript file for example, the single and double quotes doesn't work properly.
Lúcio Henrique (@lucheol) the open and close the quotes bug was solved but there is another bug when you try to wrap a word with quotes. Peng Lyu (@rebornix) Did you read my comment about the bug when you select a word and try to wrap it with quotes?
bugIssue identified by VS Code Team member as probable bugeditor-autoclosingEditor automatic closing of parens / brackets / etc.keyboard-layoutKeyboard layout issuesmacosIssues with VS Code on MAC/OS XverifiedVerification succeeded
Activity
rebornix commentedon May 26, 2017
Vinicius Vinhas (@vvinhas) can you try to run Code without any extension by
code --disable-extensions? Besides, can you open Help --> Developer Tools and see if there is any error there?vvinhas commentedon May 26, 2017
NP Peng Lyu (@rebornix)
Unfortunately, the same thing happens and no errors are shown in the console.

rebornix commentedon May 26, 2017
Vinicius Vinhas (@vvinhas) can you share the extensions list with me ? Or even better together with your settings file.
vvinhas commentedon May 27, 2017
Yup!
Extensions
Settings
{ "editor.fontFamily": "Fira Code", "editor.fontLigatures": true, "editor.fontSize": 14, "editor.fontWeight": "300", "editor.lineHeight": 22, "editor.tabSize": 4, "editor.detectIndentation": false, "editor.insertSpaces": true, "editor.formatOnType": true, "files.exclude": { "**/*.cs.meta": true }, "workbench.colorTheme": "One Dark Pro", "workbench.iconTheme": "vscode-icons", "workbench.editor.tabCloseButton": "right", "window.zoomLevel": 1, "emmet.syntaxProfiles": { "javascript": "jsx" }, "newFile.defaultBaseFileName": "script", "newFile.defaultFileExtension": ".js", "[javascript]": { "editor.tabSize": 2 }, "[javascriptreact]": { "editor.tabSize": 2 }, "sync.gist": "", //hidden "sync.lastUpload": "", //hidden "sync.autoDownload": false, "sync.autoUpload": false, "sync.lastDownload": "", "sync.forceDownload": false, "sync.anonymousGist": false, "sync.host": "", "sync.pathPrefix": "", "sync.quietSync": false, "eslint.autoFixOnSave": false }vvinhas commentedon Aug 2, 2017
Using version
1.14.2and the bug persist.melquic commentedon Aug 19, 2017
Same bug here. Version 1.15.1 and MacOS 10.12.5
tormink commentedon Aug 20, 2017
Same bug here. Version 1.15.1 and macOS 10.12.6.
Maybe it has something to do with my keyboard using the double and single quotes key as also accent triggers, for letters such as é, á, ä? (in my case Portuguese).
Because for me the same thing also happens for backtick brackets, not only single and double quotes. However, this is not a keyboard isolated bug, since I tested Sublime and Atom and they did not show this behavior.
andremacola commentedon Aug 31, 2017
Same problem here with 1.15.1 (1.15.1) OSX El Capitan
andremacola commentedon Sep 5, 2017
@vtr83 the problem with this approach is that in languages like portuguese, we accentuation in words for exemple á é í ó ú and we do that with the same single quote key
tormink commentedon Sep 6, 2017
I also use a Brazilian keyboard (Brazilian Pro is the name of the keyboard configuration in macOS). I just added the standard U.S. keyboard, and it no longer bugs with quotes, however, I can no longer use accented characters such as á, é, í, ó, ú that way, because the keyboard now treats the quotes simply as quotes, not helper keys for accents. I do not wish to need to keep switching around all the time while coding, when I need to write a string in Portuguese. So the problem is VS Code can't handle that keyboard configuration for some reason. Other editors I've tested have that behavior for quotes if you press once and then space, which is the expected behavior in that case.
55 remaining items
rebornix commentedon Jun 8, 2018
Learnt Portuguese a little bit (my first language doesn't have accents) and pushed a fix for this issue. The auto closing will be triggered when you press an acute accent like
'and press space. Please note that the auto closing logic is the same as when you use US keyboard layout.Techinically auto close doens't kick in before the fix because inserting
'in US international or Portuguese will switch the IME to composition mode, a following space quits the composition mode but we didn't try to see if we should do an auto closing.You can have the fix from tomorrow's Insiders and next month's Stable.
To verifiers (VSCode team member):
aeciolevy commentedon Jun 8, 2018
I am using a mac from the US, I guess the problem is the atom shortcut that I got, but it was a really good insight Peng Lyu (@rebornix) .
rebornix commentedon Jun 8, 2018
Aecio Levy (@aeciolevy) feel free to ping if the fix doesn't work for you, there are probably other issues that leads to unexpected behavior.
dandeveloper commentedon Jun 27, 2018
Peng Lyu (@rebornix) I've made some tests and when I select and try to wrap the text with single or double quotes, the text is replaced by the quotes. Another strange behavior that I noticed happens when you are in a single line comment in a javaScript file for example, the single and double quotes doesn't work properly.
georgehossa commentedon Jul 6, 2018
Hello, i solved this issue with this extension:
https://marketplace.visualstudio.com/items?itemName=konstantin.wrapSelection
i hope this feature could be by default in coming versions.
Thanks.
lucheol commentedon Jul 11, 2018
Peng Lyu (@rebornix), now its working in this last update! Thank you! I'm from Brazil, using Mac and Brazil Pro layout in US Int keyboard (PT_BR).
gfpacheco commentedon Jul 11, 2018
Still not working on Mac using US International keyboard layout
robertotcestari commentedon Jul 11, 2018
dandeveloper commentedon Jul 11, 2018
Lúcio Henrique (@lucheol) the open and close the quotes bug was solved but there is another bug when you try to wrap a word with quotes.
Peng Lyu (@rebornix) Did you read my comment about the bug when you select a word and try to wrap it with quotes?
lucheol commentedon Jul 11, 2018
Danilo de Carvalho Souza (@dandeveloper) really, only the open and close quotes are solved. Wrap quotes still not working here too.
jeffersonRibeiro commentedon Jul 16, 2018
İlber Bektaş (@CentaurWarchief) Fiz uma alteração no keybiding da Ruth John (@Rumyra) para funcionar com a configuração de teclado "Brazilian Pro" do Mac.