Skip to content

Auto close single and double quotes aren't working #26820

Closed

Description

For some odd reason, single and double quotes are not self closing.
Brackets and parentheses are working fine though.

Screencast

VSCode Version: April 2017 (1.12)
OS Version: macOS Sierra (10.12.4)

Activity

  1. rebornix commented on May 26, 2017

    @rebornix
    Contributor

    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?

  2. added
    info-needed
    on May 26, 2017
  3. vvinhas commented on May 26, 2017

    @vvinhas
    Author

    NP Peng Lyu (@rebornix)

    Unfortunately, the same thing happens and no errors are shown in the console.
    VSCode Extensions Disabled

  4. rebornix commented on May 26, 2017

    @rebornix
    Contributor

    Vinicius Vinhas (@vvinhas) can you share the extensions list with me ? Or even better together with your settings file.

  5. vvinhas commented on May 27, 2017

    @vvinhas
    Author

    Yup!

    Extensions

    FallenMax.mithril-emmet-0.6.1
    HookyQR.beautify-1.0.2
    KTamas.laravel-blade-0.0.1
    Kasik96.format-indent-1.3.0
    Shan.code-settings-sync-2.7.0
    Shan.code-settings-sync-2.8.0
    TwentyChung.jsx-0.0.1
    WallabyJs.quokka-vscode-1.0.33
    WallabyJs.quokka-vscode-1.0.34
    abusaidm.html-snippets-0.1.0
    christian-kohler.path-intellisense-1.4.2
    dbaeumer.vscode-eslint-1.2.11
    dkundel.vscode-new-file-3.0.2
    donjayamanne.githistory-0.2.0
    felixfbecker.php-debug-1.10.0
    felixfbecker.php-intellisense-1.2.1
    felixfbecker.php-intellisense-1.2.2
    ikappas.phpcs-0.7.0
    neilbrayfield.php-docblocker-1.1.0
    onecentlin.laravel-blade-1.8.1
    robertohuertasm.vscode-icons-7.7.0
    robinbentley.sass-indented-1.4.1
    xabikos.javascriptsnippets-1.4.0
    xabikos.reactsnippets-1.3.0
    zhuangtongfa.material-theme-2.7.8
    zhuangtongfa.material-theme-2.8.0
    

    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
    }
  6. vvinhas commented on Aug 2, 2017

    @vvinhas
    Author

    Using version 1.14.2 and the bug persist.

  7. melquic commented on Aug 19, 2017

    @melquic

    Same bug here. Version 1.15.1 and MacOS 10.12.5

  8. tormink commented on Aug 20, 2017

    @tormink

    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.

  9. andremacola commented on Aug 31, 2017

    @andremacola

    Same problem here with 1.15.1 (1.15.1) OSX El Capitan

  10. andremacola commented on Sep 5, 2017

    @andremacola

    @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

  11. tormink commented on Sep 6, 2017

    @tormink

    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.

  12. 55 remaining items

  13. rebornix commented on Jun 8, 2018

    @rebornix
    Contributor

    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
  14. aeciolevy commented on Jun 8, 2018

    @aeciolevy

    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) .

  15. rebornix commented on Jun 8, 2018

    @rebornix
    Contributor

    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.

  16. dandeveloper commented on Jun 27, 2018

    @dandeveloper

    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.

  17. added
    macos
    verified
    on Jun 28, 2018
  18. georgehossa commented on Jul 6, 2018

    @georgehossa

    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.

  19. lucheol commented on Jul 11, 2018

    @lucheol

    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).

  20. gfpacheco commented on Jul 11, 2018

    @gfpacheco

    Still not working on Mac using US International keyboard layout

  21. robertotcestari commented on Jul 11, 2018

    @robertotcestari
  22. dandeveloper commented on Jul 11, 2018

    @dandeveloper

    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?

  23. lucheol commented on Jul 11, 2018

    @lucheol

    Danilo de Carvalho Souza (@dandeveloper) really, only the open and close quotes are solved. Wrap quotes still not working here too.

  24. jeffersonRibeiro commented on Jul 16, 2018

    @jeffersonRibeiro

    İ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.

      {
        "key": "shift+'",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
          "snippet": "$1\""
        }
      },
      {
        "key": "'",
        "command": "editor.action.insertSnippet",
        "when": "editorTextFocus",
        "args": {
          "snippet": "$1'"
        }
      }
    
  25. locked and limited conversation to collaborators on Jul 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugeditor-autoclosingkeyboard-layoutmacosverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions