Skip to content

Snippet support for tabstop, camel/pascal case transforms #2067

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

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions _specifications/lsp/3.18/language/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -935,24 +935,27 @@ Below is the grammar for snippets in EBNF ([extended Backus-Naur form, XML varia

```
any ::= tabstop | placeholder | choice | variable | text
tabstop ::= '$' int | '${' int '}'
tabstop ::= '$' int
| '${' int '}'
| '${' int transform '}'
placeholder ::= '${' int ':' any '}'
choice ::= '${' int '|' choicetext (',' choicetext)* '|}'
variable ::= '$' var | '${' var }'
| '${' var ':' any '}'
| '${' var '/' regex '/' (format | formattext)* '/' options '}'
| '${' var transform '}'
transform ::= '/' regex '/' (format | formattext)* '/' options
format ::= '$' int | '${' int '}'
/* Transforms the text to be uppercase, lowercase, or capitalized, respectively. */
| '${' int ':' ('/upcase' | '/downcase' | '/capitalize') '}'
/* Transforms the text to be uppercase, lowercase, capitalized, camelcase, or pascalcase, respectively. */
| '${' int ':' ('/upcase' | '/downcase' | '/capitalize' | '/camelcase' | '/pascalcase') '}'
/* Inserts the 'ifOnly' text if the match is non-empty. */
| '${' int ':+' ifOnly '}'
/* Inserts the 'if' text if the match is non-empty,
otherwise the 'else' text will be inserted. */
| '${' int ':?' if ':' else '}'
/* Inserts the 'else' text if the match is empty. */
| '${' int ':-' else '}' | '${' int ':' else '}'
regex ::= Regular Expression value (ctor-string)
options ::= Regular Expression option (ctor-options)
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 ::= ([^$}\] | '\$' | '\}' | '\\')*
Expand Down