You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
There are a few features of snippets that are missing. E.g., choices and variables. This issue is to request the snippet implmentation be changed / improved to implement the rules as described below here.
While improving Atom's own snippet handling, it also makes it easier to use completions provided by language servers directly. Technically, they should currently be sanitised to remove unsupported features.
In summary (some of this is already implemented):
Tab stops: $n for cursor locations
Placeholders: ${1:foo} for preselected placeholder values
Nested placeholders: Support of ${1:foo ${2:bar}} is required
Choice: ${|one,two,three|} prompts the user to pick a value (not sure how prompt should work)
Variables: Allows replacements to use context such as file name, selected text, etc.
Variable transforms: Regex applied to variables.
I'm not sure how the current \u and friends fit in, but could potentially be an enhancement if not already supported by the regex.
Here's the EBNF grammar provided in the link
any ::= tabstop | placeholder | choice | variable | text
tabstop ::= '$' int | '${' int '}'
placeholder ::= '${' int ':' any '}'
choice ::= '${' int '|' text (',' text)* '|}'
variable ::= '$' var | '${' var }'
| '${' var ':' any '}'
| '${' var '/' regex '/' (format | text)+ '/' options '}'
format ::= '$' int | '${' int '}'
| '${' int ':' '/upcase' | '/downcase' | '/capitalize' '}'
| '${' int ':+' if '}'
| '${' int ':?' if ':' else '}'
| '${' int ':-' else '}' | '${' int ':' else '}'
regex ::= JavaScript Regular Expression value (ctor-string)
options ::= JavaScript Regular Expression option (ctor-options)
var ::= [_a-zA-Z] [_a-zA-Z0-9]*
int ::= [0-9]+
text ::= .*
The text was updated successfully, but these errors were encountered:
Description
There are a few features of snippets that are missing. E.g., choices and variables. This issue is to request the snippet implmentation be changed / improved to implement the rules as described below here.
While improving Atom's own snippet handling, it also makes it easier to use completions provided by language servers directly. Technically, they should currently be sanitised to remove unsupported features.
In summary (some of this is already implemented):
$n
for cursor locations${1:foo}
for preselected placeholder values${1:foo ${2:bar}}
is required${|one,two,three|}
prompts the user to pick a value (not sure how prompt should work)I'm not sure how the current
\u
and friends fit in, but could potentially be an enhancement if not already supported by the regex.Here's the EBNF grammar provided in the link
The text was updated successfully, but these errors were encountered: