Closed idleberg closed 5 years ago
:+1:
This would be huge
Yeah I can see using this like
import $1 from '{$1:toLowerCase};
I use a feature like this in IntelliJ's live templates regularly. It would be cool to use this in Atom as well. :+1:
+1
+1
+1 !
This would be great :+1:
maybe better like this: ${1:Word | upper}
As @aysner referred to, the following kinds of regex syntax have already worked: ${1/(.)/\\U$1/}
, which will be converted to upper-cased $1
.
There's one extra feature that I brought over from TextMate format strings: the ability to control case through the \u, \l, \U, \L, and \E flags: \u and \l will force the next character to uppercase or lowercase, respectively. \U and \L will force the rest of the string to uppercase or lowercase, respectively (or until we encounter a different case directive or \E). \E stops the effects of \U and \L.
Besides, README.md says:
This package supports a subset of the features of TextMate snippets, documented here. The following features are not yet supported:
- Variables
- Interpolated shell code
- Conditional insertions in transformations
I wonder this issue may be closed.
Yeah, missed this one. Fixed in #260. Thanks!
There's one feature I miss compared to Sublime Text: controlling case used in snippets. Here's an example from the NSIS package:
The result would look like this:
Notice the
/\U\1/
part which converts the string (in this case the word “English”) to uppercase letters. There's also a/\L\1/
counterpart to convert the string to lowercase. (I'm not sure what the number 1 does in there!)Edit: If I'm not mistaken, the number sets the amount of times the preceding string is inserted (once in the example)