2024-04-03 09:57:02 +08:00
{
// 插件 id 及名称
"name" : "variable-conversion" ,
2024-04-05 01:46:37 +08:00
"displayName" : "Variable Conversion [Under development(正在开发中)]" ,
2024-04-06 14:17:42 +08:00
"description" : "A variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), lower, upper case, and more. \n变量名转换插件, 支持右键菜单、快捷键、底栏等多种方式使用, 支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、连字符(脊柱式)、全小写、全大写等常用命名方式(及组合)转换。" ,
2024-04-03 09:57:02 +08:00
// 版本号
2024-04-06 14:17:42 +08:00
"version" : "0.0.3" ,
// logo
"icon" : "image/logo.png" ,
2024-04-05 01:46:37 +08:00
"publisher" : "coder-xiaomo" ,
2024-04-03 09:57:02 +08:00
"engines" : {
"vscode" : "^1.87.0"
} ,
"categories" : [
"Other"
] ,
// 仓库地址
"repository" : {
"type" : "git" ,
2024-04-03 10:35:59 +08:00
"url" : "https://github.com/coder-xiaomo/variable-conversion-vscode-extension.git"
2024-04-03 09:57:02 +08:00
} ,
2024-04-03 10:35:59 +08:00
"repositories" : [
{
"type" : "git" ,
"url" : "https://git.only4.work/coder-xiaomo/variable-conversion-vscode-extension.git"
} ,
{
"type" : "git" ,
"url" : "https://gitee.com/coder-xiaomo/variable-conversion-vscode-extension.git"
}
] ,
2024-04-03 09:57:02 +08:00
"main" : "./out/extension.js" ,
2024-04-06 14:27:10 +08:00
"activationEvents" : [
"onStartupFinished" , // 当编辑器完成启动时激活
"onTextSelected" // 当用户选中文本时激活
] ,
2024-04-03 09:57:02 +08:00
"contributes" : {
"commands" : [
2024-04-04 15:35:25 +08:00
/ * *
* 右 键 菜 单
* /
2024-04-03 18:23:56 +08:00
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.convertCase" ,
2024-04-03 18:23:56 +08:00
"title" : "字符串转换"
} ,
2024-04-04 15:35:25 +08:00
/ * *
* 右 键 菜 单 - 子 菜 单
* /
// group-1-camel
2024-04-03 09:57:02 +08:00
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toCamelCase" ,
2024-04-05 00:59:57 +08:00
"title" : "小驼峰(驼峰)命名 (Camel Case) [ fooBar ]"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toPascalCase" ,
2024-04-05 00:59:57 +08:00
"title" : "大驼峰(帕斯卡)命名 (Pascal Case) [ FooBar ]"
2024-04-03 09:57:02 +08:00
} ,
2024-04-04 15:35:25 +08:00
// group-2-snake
2024-04-03 09:57:02 +08:00
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toSnakeCase" ,
2024-04-05 00:59:57 +08:00
"title" : "下划线(蛇形)命名 (Snake Case) [ foo_bar ]"
2024-04-03 09:57:02 +08:00
} ,
2024-04-04 15:35:25 +08:00
{
"command" : "variable-conversion.toSnakeUpperCase" ,
2024-04-05 00:59:57 +08:00
"title" : "下划线(蛇形) + 全大写命名 (Snake Upper Case) [ FOO_BAR ]"
2024-04-04 15:35:25 +08:00
} ,
2024-04-03 10:35:59 +08:00
{
2024-04-05 00:59:57 +08:00
"command" : "variable-conversion.toSnakePascalCase" ,
"title" : "下划线(蛇形) + 大驼峰(帕斯卡)命名 (Snake Pascal Case) [ Foo_Bar ]"
} ,
{
"command" : "variable-conversion.toSnakeCamelCase" ,
"title" : "下划线(蛇形) + 小驼峰(驼峰)命名 (Snake Camel Case) [ foo_Bar ]"
2024-04-03 10:35:59 +08:00
} ,
2024-04-04 15:35:25 +08:00
// group-3-kebab
2024-04-03 09:57:02 +08:00
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toKebabCase" ,
2024-04-05 00:59:57 +08:00
"title" : "连字符(脊柱式)命名 (Kebab/Spinal Case) [ foo-bar ]"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toKebabUpperCase" ,
2024-04-05 00:59:57 +08:00
"title" : "连字符(脊柱式) + 全大写命名 (Kebab Upper Case) [ FOO-BAR ]"
} ,
{
"command" : "variable-conversion.toKebabPascalCase" ,
"title" : "连字符(脊柱式) + 大驼峰(帕斯卡)命名 (Kebab Pascal Case) [ Foo-Bar ]"
2024-04-04 15:35:25 +08:00
} ,
{
2024-04-05 00:59:57 +08:00
"command" : "variable-conversion.toKebabCamelCase" ,
"title" : "连字符(脊柱式) + 小驼峰(驼峰)命名 (Kebab Camel Case) [ foo-Bar ]"
2024-04-03 09:57:02 +08:00
} ,
2024-04-04 15:35:25 +08:00
// group-4-upper-lower
2024-04-03 09:57:02 +08:00
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toLowerCase" ,
2024-04-03 09:57:02 +08:00
"title" : "全小写 (Lower Case) [ foobar ]"
2024-04-04 15:35:25 +08:00
} ,
{
"command" : "variable-conversion.toUpperCase" ,
"title" : "全大写 (Upper Case) [ FOOBAR ]"
2024-04-03 09:57:02 +08:00
}
// 隐藏命令
// {
// "command": "editor.action.transformToCamelcase",
// "title": "[VSCode 自带] 驼峰式大小写 (Camel Case) [ fooBar ]",
// "enablement": "false"
// },
// {
// "command": "editor.action.transformToKebabcase",
// "title": "[VSCode 自带] Kebab 命名 (Kebab Case) [ foo-bar ]",
// "enablement": "false"
// },
// {
// "command": "editor.action.transformToTitlecase",
// "title": "[VSCode 自带] 词首字母大写 (Title Case) [ Foo Bar ]",
// "enablement": "false"
// },
// {
// "command": "editor.action.transformToLowercase",
// "title": "[VSCode 自带] 转换为小写 (Lower Case) [ foo bar ]",
// "enablement": "false"
// },
// {
// "command": "editor.action.transformToUppercase",
// "title": "[VSCode 自带] 转换为大写 (Upper Case) [ FOO BAR ]",
// "enablement": "false"
// },
// {
// "command": "editor.action.transformToSnakecase",
// "title": "[VSCode 自带] 转换为蛇形命名法 (Snake Case) [ foo_bar ]",
// "enablement": "false"
// }
] ,
2024-04-03 23:54:38 +08:00
// docs: https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keys
2024-04-03 09:57:02 +08:00
"keybindings" : [
// 绑定快捷键
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.convertCase" ,
2024-04-03 09:57:02 +08:00
"key" : "shift+alt+t" ,
"when" : "editorTextFocus"
}
] ,
// docs: https://code.visualstudio.com/api/references/contribution-points#contributes.menus
"menus" : {
// 编辑器右键菜单
"editor/context" : [
2024-04-03 18:23:56 +08:00
{
"when" : "editorTextFocus" ,
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.convertCase" ,
2024-04-03 18:23:56 +08:00
// "group": "1_modification@9"
"group" : "navigation@9"
} ,
2024-04-03 09:57:02 +08:00
{
2024-04-03 10:02:44 +08:00
"when" : "editorTextFocus && _textSelectionLength >= 1" ,
2024-04-04 14:38:42 +08:00
"submenu" : "variable-conversion.stringConversionMenu" ,
2024-04-03 09:57:02 +08:00
// docs: https://code.visualstudio.com/api/references/contribution-points#Sorting-of-groups
// "group": "1_modification@9"
"group" : "navigation@9"
}
] ,
2024-04-04 14:38:42 +08:00
"variable-conversion.stringConversionMenu" : [
2024-04-03 09:57:02 +08:00
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toCamelCase" ,
2024-04-04 15:35:25 +08:00
"group" : "group-1-camel@1"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 14:38:42 +08:00
"command" : "variable-conversion.toPascalCase" ,
2024-04-04 15:35:25 +08:00
"group" : "group-1-camel@2"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toSnakeCase" ,
"group" : "group-2-snake@1"
2024-04-03 23:54:38 +08:00
} ,
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toSnakeUpperCase" ,
"group" : "group-2-snake@2"
2024-04-03 23:54:38 +08:00
} ,
{
2024-04-05 00:59:57 +08:00
"command" : "variable-conversion.toSnakePascalCase" ,
2024-04-04 15:35:25 +08:00
"group" : "group-2-snake@3"
2024-04-03 09:57:02 +08:00
} ,
2024-04-05 00:59:57 +08:00
{
"command" : "variable-conversion.toSnakeCamelCase" ,
"group" : "group-2-snake@4"
} ,
2024-04-03 09:57:02 +08:00
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toKebabCase" ,
"group" : "group-3-kebab@1"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toKebabUpperCase" ,
"group" : "group-3-kebab@2"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-05 00:59:57 +08:00
"command" : "variable-conversion.toKebabPascalCase" ,
2024-04-04 15:35:25 +08:00
"group" : "group-3-kebab@3"
2024-04-03 09:57:02 +08:00
} ,
2024-04-05 00:59:57 +08:00
{
"command" : "variable-conversion.toKebabCamelCase" ,
"group" : "group-3-kebab@4"
} ,
2024-04-03 09:57:02 +08:00
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toLowerCase" ,
"group" : "group-4-upper-lower@1"
2024-04-03 09:57:02 +08:00
} ,
{
2024-04-04 15:35:25 +08:00
"command" : "variable-conversion.toUpperCase" ,
"group" : "group-4-upper-lower@2"
2024-04-03 10:02:44 +08:00
}
// 隐藏菜单项
2024-04-03 09:57:02 +08:00
// {
// "command": "editor.action.transformToCamelcase",
// "group": "group-vscode",
// "when": "false"
// },
// {
// "command": "editor.action.transformToKebabcase",
// "group": "group-vscode",
// "when": "false"
// },
// {
// "command": "editor.action.transformToTitlecase",
// "group": "group-vscode",
// "when": "false"
// },
// {
// "command": "editor.action.transformToLowercase",
// "group": "group-vscode",
// "when": "false"
// },
// {
// "command": "editor.action.transformToUppercase",
// "group": "group-vscode",
// "when": "false"
// },
// {
// "command": "editor.action.transformToSnakecase",
// "group": "group-vscode",
// "when": "false"
// }
]
} ,
// docs: https://code.visualstudio.com/api/references/contribution-points#contributes.submenus
"submenus" : [
{
2024-04-04 14:38:42 +08:00
"id" : "variable-conversion.stringConversionMenu" ,
2024-04-03 09:57:02 +08:00
"label" : "将字符串转换为..."
}
]
} ,
"scripts" : {
"vscode:prepublish" : "npm run compile" ,
"compile" : "tsc -p ./" ,
"watch" : "tsc -watch -p ./" ,
"pretest" : "npm run compile && npm run lint" ,
"lint" : "eslint src --ext ts" ,
"test" : "vscode-test" ,
2024-04-05 01:46:37 +08:00
"package" : "echo \"start `vsce package`\" & vsce package" ,
"publish" : "vsce publish"
2024-04-03 09:57:02 +08:00
} ,
"devDependencies" : {
"@types/mocha" : "^10.0.6" ,
"@types/node" : "18.x" ,
"@types/vscode" : "^1.87.0" ,
"@typescript-eslint/eslint-plugin" : "^7.4.0" ,
"@typescript-eslint/parser" : "^7.4.0" ,
"@vscode/test-cli" : "^0.0.8" ,
"@vscode/test-electron" : "^2.3.9" ,
"eslint" : "^8.57.0" ,
"typescript" : "^5.3.3"
}
}