VS Code 用户代码片段文件名操作
VS Code User Snippet file name manipulation
如何转换我的文件名company-controller.js
为此:
class CompanyController extends BaseController {
constructor() {
super(Company);
}
}
你必须转换变量TM_FILENAME_BASE
"ctrl": {
"scope": "javascript",
"prefix": "base",
"body": [
"class ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/} extends BaseController {",
"\tconstructor() {",
"\t\tsuper(${TM_FILENAME_BASE/(.*)-\w+/${1:/pascalcase}/});",
"\t}",
"}"
],
"description": "Extend BaseController"
}
如何转换我的文件名company-controller.js
为此:
class CompanyController extends BaseController {
constructor() {
super(Company);
}
}
你必须转换变量TM_FILENAME_BASE
"ctrl": {
"scope": "javascript",
"prefix": "base",
"body": [
"class ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/} extends BaseController {",
"\tconstructor() {",
"\t\tsuper(${TM_FILENAME_BASE/(.*)-\w+/${1:/pascalcase}/});",
"\t}",
"}"
],
"description": "Extend BaseController"
}