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
Revisit PSCustomObject Accelerator Intellisense Formatting #70786
Comments
This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. Happy Coding! |
Hi 👋 this probably shouldn't have been closed. Can some one help with this? |
I think it's a snippet issue? |
The described behavior is how it is expected to work. If you disagree, please explain what is expected and what is not in more detail. See also our issue reporting guidelines. Happy Coding! |
This is actually not an issue with snippets because the snippet-prefix defines what portion gets detected and hence replaced. As shown in PowerShell/vscode-powershell#1595 (comment) that is |
@jrieken there are 2 problems here still... It's set to Instead of showing the actual name of the snippet. Also, if I type This is a tougher problem... I know, but I want to call it out as an experience that customers will likely hit. |
Where did this responsibility land? |
Ping @jrieken. |
Another gentle ping, @jrieken |
I'd really like this behavior to be improved... who owns this? |
This, I believe, falls on the vscode team because the biggest problem is that auto-closing pairs and snippets are conflicting with each other for a subpar experience. @jrieken is the guy to talk to about this, but he hadn't gotten back to us. |
@TylerLeonhardt I actually stopped reading after this
The rule is 1 problem, 1 issue |
Sounds good @jrieken that is a respectable policy. Would you prefer I open two new issues? For context: Issue one using Python as the example language snippet: {
"listcompPy": {
"prefix":"x for x in",
"body":[
"[x for x in range(1,20) if x%2==0 ]"
]
}
} typing [[x for x in range(1,20) if x%2==0 ]] Issue two using your suggestion of adding {
"listcompPy": {
"prefix":"[x for x in",
"body":[
"[x for x in range(1,20) if x%2==0 ]"
]
}
} typing [x for x in range(1,20) if x%2==0 ]] |
Well, one exits #26012 and other is the acknowledgement of the limitations of static snippets. Details:
I wasn't suggesting that your snippet-prefix is Suggestion: knowing that vscode auto closes brackets by default you could adjust your snippet to not insert brackets as well... |
This is a reasonable suggestion if the brackets come at the start and end of the snippet, but that's not always the case. For example the snippet that this issue was originally opened for is: [PSCustomObject]@{
}
I'll investigate this as a workaround but that said, #26012 would certainly fix this issue. Snippets and auto-closing pairs playing nicer together is ideal. @mpearon + @sba923: #26012 is the language agnostic issue that we should put examples into and use for further tracking. |
REFERENCE: PowerShell/vscode-powershell#1595 #62744
Details Output
VSCode version: 1.32.3 | a3db5be | x64
VSCode extensions:
PSES version:
PowerShell version:
When using the [PSCustomObject] Accelerator, the initial [ is not removed.
Expected Behavior
I think that the if an initial [ is detected, it should be removed.
Actual Behavior
The [ is duplicated when using Tab and when selecting the autocomplete option.
I've seen that if I type PSCustomObject, then hit tab or select the option, the bracket is not added - but I naturally begin typing the actual expression. Maybe I'm being a bit too picky.
Attached Files
The text was updated successfully, but these errors were encountered: