-
Notifications
You must be signed in to change notification settings - Fork 816
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
Clarify snippet placeholder structure #2032
base: gh-pages
Are you sure you want to change the base?
Clarify snippet placeholder structure #2032
Conversation
Would it make more sense to leave these unchanged, and instead change
currently the grammar technically implies that there can only be one top-level |
Yeah, maybe. This more feels like a style preference. I don't think grammar is a place for implications, so not sure if the first (or the broadest) definition should be treated as top level. But having an explicit mention about top level snippet parts might be useful indeed. |
For sure. And just to be clear, either way the grammar right now is incorrect in that it only allows one
such that now |
39bdf54
to
96ca492
Compare
Now grammar implies that placeholder value should be a single `any` node, while in most applications it can be any number of consecutive `any` nodes. For example, as described in earlier "Placeholders" section: `${1:another ${2:placeholder}}`. Adding `+` quantifier to `any` seems to be more precise. This seems to also fix the grammar for initial snippet input (which is implied to be `any`).
96ca492
to
ceb1ada
Compare
I finally remembered why I chose the route of not updating @dbaeumer, maybe you have own reservations about this (and #2033, for that matter)? |
Ah makes sense, thx for linking |
Now grammar implies that placeholder value should be a single
any
node, while in most applications it can be any number of consecutiveany
nodes. For example, as described in earlier "Placeholders" section:${1:another ${2:placeholder}}
.Using
any+
instead ofany
seems to be more precise.