vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Apostrophes auto-complete to single quotes when used in a comment

Open duncanhorn opened this issue 10 years ago • 12 comments

E.g. if I'm trying to type:

// ya'll

I'll end up with:

// ya'll'

and will manually need to delete the extra apostrophe

duncanhorn avatar Aug 02 '16 00:08 duncanhorn

Is there an update about this? It's rather annoying.

devnoname120 avatar Mar 05 '17 00:03 devnoname120

You can disable it by adding "editor.autoClosingBrackets": false, to your settings.json file, but we'll need to talk to the VS Code folks and figure out why this might be happening. We don't get a callback for it and I don't reproduce this problem in TypeScript files, so it could possibly be an issue with the atom grammar for C++.

bobbrow avatar Mar 06 '17 16:03 bobbrow

This is fixed in the latest version of VS Code (1.12.1)

bobbrow avatar May 09 '17 05:05 bobbrow

This is still an issue for me in VS Code 1.12.2.

taniarascia avatar Jun 07 '17 16:06 taniarascia

Can you elaborate or give an example of what you're doing when you see this happen? I don't repro in 1.12.2.

Other characters (paren, curly brace, double quote) still do auto-closing brackets inside comments because those almost universally need to be closed. Single quotes should not insert an auto-closing char when inside a comment so the original issue reported is fixed. If there is something else broken that we need to innvestigate, can you please reopen this issue or create a new one?

bobbrow avatar Jun 07 '17 18:06 bobbrow

Hi @bobbrow,

I'm currently using Visual Studio Code 1.12.2. If I leave the editor.autoClosingBrackets setting to default (true), apostrophes in comments are duplicated.

Here is an image both displaying my version number, and the issue that happened.

screen shot 2017-06-07 at 1 58 00 pm

From what I can tell, this GitHub issue is the exact one I'm having, which is why I didn't open a new issue. I'd be happy to reopen this issue if necessary. My issue is solved by changing the preferences ("editor.autoClosingBrackets": false) but I feel like that shouldn't be necessary.

Thanks for your response, have a great day.

taniarascia avatar Jun 07 '17 19:06 taniarascia

Yeah, it doesn't repro on any of my machines either, including Mac.

sean-mcmanus avatar Jun 07 '17 19:06 sean-mcmanus

@taniarascia, do you also have version 0.11.4 of the C/C++ extension installed?

bobbrow avatar Jun 07 '17 19:06 bobbrow

Oh, and also, can you verify if the status bar in the lower right corner shows "C" or "C++" as the active language? The text in your screenshot is not green, so I suspect that the editor has not detected you are in a comment block.

status

bobbrow avatar Jun 07 '17 19:06 bobbrow

Ah, this is my fault, I didn't know this issue was C++ specific. I'm working in another language. I'm sorry for taking your time.

taniarascia avatar Jun 07 '17 19:06 taniarascia

Yeah, it is specific to whatever language you are working with and it not something that extensions handle. You can log an issue with the VS Code team if it is a language that they have a grammar for already or you can request they add a grammar for your language.

bobbrow avatar Jun 07 '17 19:06 bobbrow

Thanks for letting me know. In my case, it's for PHP.

taniarascia avatar Jun 07 '17 19:06 taniarascia