Extension|Author (truncated)|Version
---|---|---
vsc-material-theme|Equ|1.2.0
material-icon-theme|PKi|3.2.1
vscode-docker|Pet|0.0.23
code-settings-sync|Sha|2.8.7
npm-intellisense|chr|1.3.0
path-intellisense|chr|1.4.2
vscode-eslint|dba|1.4.4
es7-react-js-snippets|dsz|1.3.1
gitlens|eam|7.5.5
vscode-npm-script|eg2|0.3.3
prettier-vscode|esb|1.1.2
auto-close-tag|for|0.5.5
auto-rename-tag|for|0.0.15
sublime-babel-vscode|jos|0.2.9
graphql-for-vscode|kum|1.8.2
git-indicators|lam|1.2.6
atom-keybindings|ms-|3.0.4
debugger-for-chrome|msj|4.0.0
vscode-icons|rob|7.19.0
colonize|vms|2.2.2
markdown-all-in-one|yzh|1.0.2
(2 theme extensions excluded)
Steps to Reproduce:
var test = ;prop: , to represent an object, then following steps 2-5.
Reproduces without extensions: Yes
Autoclosing brackets are currently inserted only in some situtations:
I think the idea is that this feature should kick in mostly when writing new code, as opposed to when editing existing code, hence the simple heuristic above. Better suggestions are welcome!
@alexandrudima I can appreciate the perspective on the feature's intended usage situations, however I've found need for it in cases outside what you mentioned. For example:
<nav> tagclassName=...<nav className=|></nav> with my cursor position indicated by the pipe{. I expect the closing curly bracket to be added and my cursor positioned between the opening and closing curly bracket so I can type my expression. With the current functionality, this does not happen.I wouldn't consider this to be of extreme importance, it really is just a convenience. I just wanted to provide an actual use case in which this functionality would be valuable. Thanks! :)
+1 for this.
There are lots of cases need auto close before other characters.
For example:
I have: list.map(mapper);
Then I want change it to: list.map(mapper).filter(filter);
I would expect the ) show up after I type .filter(
Similar scenario happens a lot when editing existing code.
I would suggest add a config option for this.
/duplicate #35197
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.
Happy Coding!
I believe that's not a duplicate of that issue. That issue only covers curly brackets in JSX tags. JSX was only an example here. From what I've read, this issue is about automatically closing every symbol that encapsulates content, no matter what language. E.g. ", ', <, {, [, (, you get the idea.
You might want to reopen this.
I'm using that issue as a central tracking point for all auto closing enablement related issues as it was the most active of all related issues with the same root cause (auto close is not enabled before non-whitespace). If you look in the actual PR, #52634, you'll see it targets this issue's case as well.
Most helpful comment
@alexandrudima I can appreciate the perspective on the feature's intended usage situations, however I've found need for it in cases outside what you mentioned. For example:
<nav>tagclassName=...<nav className=|></nav>with my cursor position indicated by the pipe{. I expect the closing curly bracket to be added and my cursor positioned between the opening and closing curly bracket so I can type my expression. With the current functionality, this does not happen.I wouldn't consider this to be of extreme importance, it really is just a convenience. I just wanted to provide an actual use case in which this functionality would be valuable. Thanks! :)