问题
I need list of transormations, like downcase, upcase, capitalize. Where is the list of such? Good documentation.
回答1:
The official documentation is snippets grammar. It shows the transforms but only provides one example. The built-in transforms are
/upcase or /downcase or /capitalize or /pascalcase
/pascalcase
was added by a commit on October 2, 2018 but hasn't made it into the documentation (as of June, 2019). It works to do this:
some-file-name.js => SomeFileName
// or another separator like _
or any [^a-z]/i
character.
Since the capability of snippet transforms has recently been enhanced, see placeholder transforms, v1.25 release notes (with another example) there should be more examples arriving on SO soon.
For examples, see capitalized a snippet and
transform foo_bar to FooBar, camelCase and
capitalize classNames of variables and lowercase a component name.
来源:https://stackoverflow.com/questions/51227382/transform-and-regex-in-code-snippets-in-vscode-docs