-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Snippets + Auto-closing pairs don't compliment each other #104952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's a javascript example for array destructuring: "arraydestructuring": {
"prefix": "[a",
"body": [
"[a, b, ...next] = ${1:array}"
],
"description": "arraydestructuring"
} which gets you:
when you type: |
better example! A javascript example for "SymbolIterator": {
"prefix": "[Symbol.iterator",
"body": [
"[Symbol.iterator]: () => {",
" return {",
" next: () => {",
" return { value: value, done: false };",
" }",
" };",
"}"
]
} which gets you: [Symbol.iterator]: () => {
return {
next: () => {
return { value: value, done: false };
}
};
}]
when you type: |
for verification, this:
should get you:
on insert mode replace (default is SHIFT + ENTER) |
I'll note that it works fine in non-json files, but is reversed in a json file (as are the insert/replace hints in the suggestion box). W10 |
that seems like a separate issue not related to this fix. Can you open a new issue? |
Yes, I'll open another issue. |
Version: 1.49.0-insider
Commit: 11dc5a8
Date: 2020-08-17T17:11:16.078Z (1 day ago)
Electron: 9.2.0
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0
Steps to Reproduce:
Add the following python snippet:
or PowerShell snippet:
[
which will cause auto-closing pair... (at this point you have[|]
where|
is the cursor)x
orpsc
and hit TAB or ENTER on the intellisense itemExpected
Python
PowerShell
Actual
Python
PowerShell
NOTE THE TRAILING
]
. Snippets and auto-closing pairs should play nice together so that the whole experience generates valid code.Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: