Skip to content
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

Bug report: The new snippets use the wrong format of ${0} #2605

Closed
doggy8088 opened this issue Jul 31, 2022 · 1 comment · Fixed by #2606
Closed

Bug report: The new snippets use the wrong format of ${0} #2605

doggy8088 opened this issue Jul 31, 2022 · 1 comment · Fixed by #2606

Comments

@doggy8088
Copy link
Contributor

doggy8088 commented Jul 31, 2022

Code snippets in VSCode should treat $0 as a ending position. Some of the snippets such as new use $0 as a replacement which is wrong.

"newObject": {
"prefix": "new",
"body": [
"${0:Object} ${1:foo} = new ${0:Object}();"
],
"description": "Create new Object"
},

Also, some snippets (see below) use {0:TODO} as a replacement which is not handy for coding.

"trycatch": {
"prefix": "try_catch",
"body": [
"try {",
"\t$1",
"} catch (${2:Exception} ${3:e}) {",
"\t$4//${0:TODO}: handle exception",
"}"
],
"description": "try/catch block"
},
"tryresources": {
"prefix": "try_resources",
"body": [
"try ($1) {",
"\t$2",
"} catch (${3:Exception} ${4:e}) {",
"\t$5//${0:TODO}: handle exception",
"}"
]
},

doggy8088 added a commit to doggy8088/vscode-java that referenced this issue Jul 31, 2022
@doggy8088 doggy8088 changed the title Bug report: Code Snippets used the wrong format of ${0} Bug report: The new snippets use the wrong format of ${0} Jul 31, 2022
@jdneo jdneo added the snippets label Aug 2, 2022
@fbricon fbricon added the bug label Aug 2, 2022
@fbricon fbricon added this to the End August 2022 milestone Aug 2, 2022
@rgrunber rgrunber linked a pull request Aug 9, 2022 that will close this issue
@rgrunber
Copy link
Member

Not sure why this didn't close. Closing ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants