Vscode: autoClosingPairs in language-configuration.json doesn't allow multiple entries that use quotes.

Created on 13 Sep 2018  路  12Comments  路  Source: microsoft/vscode

I'm looking for a way to support autoClosingPair of:

' ', " ", @' '@, and @" "@

However, when I add, for example:

["@'","'@"] to the language-configuration.json it doesn't work and still autocloses just ' so it looks like @''.

If I remove this entry from the autoClosingPairs, then @' closes properly to become @''@. But then ' no longer completes.

Is there a way to do what I'm trying to do?

editor-autoclosing feature-request verification-needed verified

Most helpful comment

Since this is an extensibility issue, I find it hard to believe that this will get the required likes to not be closed.

Please consider not doing that...

This can be viewed as a bug (or at least a silly limitation) as I can have auto closing pairs of ' and auto closing pairs of @' but not together.

All 12 comments

It looks like this is related to #72177, which is a slightly different issue but probably caused by the same underlying bug.

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Since this is an extensibility issue, I find it hard to believe that this will get the required likes to not be closed.

Please consider not doing that...

This can be viewed as a bug (or at least a silly limitation) as I can have auto closing pairs of ' and auto closing pairs of @' but not together.

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding

Pls no

It's up to 25 votes now, so I think it's safe. But I agree with what you wrote in https://github.com/microsoft/vscode/issues/91714#issuecomment-595524174 about how the autoclose process selects against extension-related issues since a lot fewer people experience them.

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@TylerLeonhardt This works fine for me on latest VS Code. If I add:

{ "open": "@'", "close": "'@", "notIn": ["string", "comment"]},

to extensions/powershell/language-configuration.json, this is the behaviour I get:

Kapture 2020-04-14 at 10 29 41

I believe this got addressed as a side effect of https://github.com/microsoft/vscode/commit/37981d8fd5d4ba1619f69dc8a0f4670543d39650 . Can you please confirm?

Awesome - let me give this a test.

Why was this closed? The change will need to be in this repo so that the maximum amount of people are affected (aka those that don't install the PowerShell extension but edit a PowerShell script).

@TylerLeonhardt I closed the issue because I considered the initial issue is resolved. So now "autoClosingPairs in language-configuration.json does allow multiple entries that use quotes".

Was this issue meant to be about PowerShell specifically? I thought that was given just as an example. Do you want that we add @' and '@ as auto-closing pairs to the built-in PowerShell language configuration?

Thanks @alexdima, makes sense! Yes we should add those to the built-in PowerShell language configuration. I was about to send a PR your way 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

villiv picture villiv  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

trstringer picture trstringer  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

sirius1024 picture sirius1024  路  3Comments