Transform and regex in Code Snippets in VSCode - Docs

…衆ロ難τιáo~ 提交于 2021-02-18 18:42:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!