Compare commits
	
		
			2 Commits
		
	
	
		
			1.0.10
			...
			2f3dc60ca2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2f3dc60ca2 | |||
| 2efac06999 | 
@@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 1.0.11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Improvement
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Imperfect support: When a sub window is activated, clicking on the status bar of the main window can correctly bring up the QuickPick menu. 不完美支持:当子窗口激活时,点击主窗口状态栏能够正确弹出快速拾取菜单
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## 1.0.10
 | 
					## 1.0.10
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Added
 | 
					### Added
 | 
				
			||||||
@@ -59,7 +65,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
- Fix bug: The infobox showed `editor is undefined` when the current active TAB was not an editor
 | 
					- Fix bug: The infobox showed `editor is undefined` when the current active TAB was not an editor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
## 1.0.4
 | 
					## 1.0.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Added
 | 
					### Added
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										71
									
								
								Publish.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										71
									
								
								Publish.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,71 @@
 | 
				
			|||||||
 | 
					# 如何发行你的插件
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vsce login coder-xiaomo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					重要!删除 out 目录,并切到 release 分支再进行打包,避免打入其他无用文件
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vsce publish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 INFO  Publishing 'coder-xiaomo.variable-conversion v0.0.1'...
 | 
				
			||||||
 | 
					 INFO  Extension URL (might take a few minutes): https://marketplace.visualstudio.com/items?itemName=coder-xiaomo.variable-conversion
 | 
				
			||||||
 | 
					 INFO  Hub URL: https://marketplace.visualstudio.com/manage/publishers/coder-xiaomo/extensions/variable-conversion/hub
 | 
				
			||||||
 | 
					 DONE  Published coder-xiaomo.variable-conversion v0.0.1.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					具体步骤参考:
 | 
				
			||||||
 | 
					https://zhuanlan.zhihu.com/p/339695661
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 安装官方打包工具
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					首先我们要安装上这个官方的插件发行工具,可以把我们的插件工程打包成.vsix文件,也可以直接发布到插件市场当中
 | 
				
			||||||
 | 
					npm i vsce -g
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					后面使用命令发行插件时,如果你没有设置package.json里的repository会收到提示。但不是非要填(插件可以不开源),选N即可。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 打包成 .vsix 文件
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vsce package
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					打包完成后,会在工程目录生成.vsix文件,这个文件的安装只能通过插件搜索右上方的菜单来进行
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 把插件发行到插件市场
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 注册Azure开发者账号
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					先得有一个 微软通行证 https://login.live.com/ ,然后打开 azure开发者中心 https://aka.ms/SignupAzureDevOps ,新建一个 azure开发组织。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### 新建个人令牌
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					注意选择 Full access 和 过期时间,如果令牌过期,需要回到这个页面再新建令牌。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					这步之后,一定要复制并保存好你的令牌字符串哦。之后只能新建,是找不到的。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 注册插件市场发行账户
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					接着我们 注册插件市场发行账号,也在这可以管理所有市场中自己发布的插件。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					当然我们也可以使用vsce命令来创建发行账户
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vsce create-publisher 发行账户名称
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 发行
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vsce publish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					这个过程里还会检查一些package.json的必填项,一切无误的话,就会看到下面这个图
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					发行成功啦!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					但此时我们的插件在市场中还搜不到,等个5-10分钟一般就有了。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## 注意事项
 | 
				
			||||||
 | 
					README.md是插件主页的详情介绍;
 | 
				
			||||||
 | 
					记得更新package.json里的版本号;
 | 
				
			||||||
 | 
					如果package.json中填写了repository字段,在发布时会要求你先提交仓库;
 | 
				
			||||||
 | 
					README.md中的图片资源必须全部是HTTPS的;
 | 
				
			||||||
 | 
					CHANGELOG.md是插件主页的变更选项卡;
 | 
				
			||||||
 | 
					一但用户安装了你的插件,只要不卸载,插件有新版时后会自动更新的。
 | 
				
			||||||
							
								
								
									
										374
									
								
								package-comment.jsonc
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										374
									
								
								package-comment.jsonc
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,374 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					  // 插件 id 及名称
 | 
				
			||||||
 | 
					  "name": "variable-conversion",
 | 
				
			||||||
 | 
					  "displayName": "Variable Conversion",
 | 
				
			||||||
 | 
					  "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.",
 | 
				
			||||||
 | 
					  // 版本号
 | 
				
			||||||
 | 
					  "version": "1.0.11",
 | 
				
			||||||
 | 
					  // logo
 | 
				
			||||||
 | 
					  "icon": "image/logo.png",
 | 
				
			||||||
 | 
					  "publisher": "coder-xiaomo",
 | 
				
			||||||
 | 
					  "engines": {
 | 
				
			||||||
 | 
					    "vscode": "^1.87.0"
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "categories": [
 | 
				
			||||||
 | 
					    "Other"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  // 仓库地址
 | 
				
			||||||
 | 
					  "repository": {
 | 
				
			||||||
 | 
					    "type": "git",
 | 
				
			||||||
 | 
					    "url": "https://github.com/coder-xiaomo/variable-conversion-vscode-extension.git"
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "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"
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "main": "./out/extension.js",
 | 
				
			||||||
 | 
					  "activationEvents": [
 | 
				
			||||||
 | 
					    // 当编辑器完成启动时激活
 | 
				
			||||||
 | 
					    "onStartupFinished",
 | 
				
			||||||
 | 
					    // 当用户选中文本时激活
 | 
				
			||||||
 | 
					    "onTextSelected"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "contributes": {
 | 
				
			||||||
 | 
					    // docs: https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keys
 | 
				
			||||||
 | 
					    "keybindings": [
 | 
				
			||||||
 | 
					      // 绑定快捷键
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.convertCase",
 | 
				
			||||||
 | 
					        "key": "shift+alt+t",
 | 
				
			||||||
 | 
					        "when": "editorTextFocus"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // 循环转换 上一个
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.cyclicConvertCase.previous",
 | 
				
			||||||
 | 
					        "key": "ctrl+alt+[",
 | 
				
			||||||
 | 
					        "args": {
 | 
				
			||||||
 | 
					          "arrowKey": "["
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        "when": "editorTextFocus"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // 循环转换 下一个
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.cyclicConvertCase.next",
 | 
				
			||||||
 | 
					        "key": "ctrl+alt+]",
 | 
				
			||||||
 | 
					        "args": {
 | 
				
			||||||
 | 
					          "arrowKey": "]"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        "when": "editorTextFocus"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    "commands": [
 | 
				
			||||||
 | 
					      /**
 | 
				
			||||||
 | 
					       * 循环转换 可以不添加
 | 
				
			||||||
 | 
					       */
 | 
				
			||||||
 | 
					      // {
 | 
				
			||||||
 | 
					      //   "command": "variable-conversion.cyclicConvertCase.previous",
 | 
				
			||||||
 | 
					      //   "title": "变量转换(上一个)"
 | 
				
			||||||
 | 
					      // },
 | 
				
			||||||
 | 
					      // {
 | 
				
			||||||
 | 
					      //   "command": "variable-conversion.cyclicConvertCase.next",
 | 
				
			||||||
 | 
					      //   "title": "变量转换(下一个)"
 | 
				
			||||||
 | 
					      // },
 | 
				
			||||||
 | 
					      /**
 | 
				
			||||||
 | 
					       * 右键菜单
 | 
				
			||||||
 | 
					       */
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.convertCase",
 | 
				
			||||||
 | 
					        "title": "变量转换"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      /**
 | 
				
			||||||
 | 
					       * 右键菜单 - 子菜单
 | 
				
			||||||
 | 
					       */
 | 
				
			||||||
 | 
					      // group-1-camel
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toCamelCase",
 | 
				
			||||||
 | 
					        "title": "小驼峰(驼峰)命名 (Camel Case) [ fooBar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toPascalCase",
 | 
				
			||||||
 | 
					        "title": "大驼峰(帕斯卡)命名 (Pascal Case) [ FooBar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // group-2-snake
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSnakeCase",
 | 
				
			||||||
 | 
					        "title": "下划线(蛇形)命名 (Snake Case) [ foo_bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSnakeUpperCase",
 | 
				
			||||||
 | 
					        "title": "下划线(蛇形) + 全大写命名 (Snake Upper Case) [ FOO_BAR ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSnakePascalCase",
 | 
				
			||||||
 | 
					        "title": "下划线(蛇形) + 大驼峰(帕斯卡)命名 (Snake Pascal Case) [ Foo_Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSnakeCamelCase",
 | 
				
			||||||
 | 
					        "title": "下划线(蛇形) + 小驼峰(驼峰)命名 (Snake Camel Case) [ foo_Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // group-3-kebab
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toKebabCase",
 | 
				
			||||||
 | 
					        "title": "中划线(连字符/脊柱式)命名 (Kebab/Spinal Case) [ foo-bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toKebabUpperCase",
 | 
				
			||||||
 | 
					        "title": "中划线(连字符/脊柱式) + 全大写命名 (Kebab Upper Case) [ FOO-BAR ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toKebabPascalCase",
 | 
				
			||||||
 | 
					        "title": "中划线(连字符/脊柱式) + 大驼峰(帕斯卡)命名 (Kebab Pascal Case) [ Foo-Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toKebabCamelCase",
 | 
				
			||||||
 | 
					        "title": "中划线(连字符/脊柱式) + 小驼峰(驼峰)命名 (Kebab Camel Case) [ foo-Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // group-4-space
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSpaceCase",
 | 
				
			||||||
 | 
					        "title": "空格分隔命名 (Space Case) [ foo bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSpaceUpperCase",
 | 
				
			||||||
 | 
					        "title": "空格分隔 + 全大写命名 (Space Upper Case) [ FOO BAR ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSpacePascalCase",
 | 
				
			||||||
 | 
					        "title": "空格分隔 + 大驼峰(帕斯卡)命名 (Space Pascal Case) [ Foo Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toSpaceCamelCase",
 | 
				
			||||||
 | 
					        "title": "空格分隔 + 小驼峰(驼峰)命名 (Space Camel Case) [ foo Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // group-5-dot
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toDotCase",
 | 
				
			||||||
 | 
					        "title": "点分隔命名 (Dot Case) [ foo bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toDotUpperCase",
 | 
				
			||||||
 | 
					        "title": "点分隔 + 全大写命名 (Dot Upper Case) [ FOO BAR ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toDotPascalCase",
 | 
				
			||||||
 | 
					        "title": "点分隔 + 大驼峰(帕斯卡)命名 (Dot Pascal Case) [ Foo Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toDotCamelCase",
 | 
				
			||||||
 | 
					        "title": "点分隔 + 小驼峰(驼峰)命名 (Dot Camel Case) [ foo Bar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      // group-6-upper-lower
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toLowerCase",
 | 
				
			||||||
 | 
					        "title": "全小写 (Lower Case) [ foobar ]"
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "command": "variable-conversion.toUpperCase",
 | 
				
			||||||
 | 
					        "title": "全大写 (Upper Case) [ FOOBAR ]"
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      // 隐藏命令
 | 
				
			||||||
 | 
					      // {
 | 
				
			||||||
 | 
					      //   "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"
 | 
				
			||||||
 | 
					      // }
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    // docs: https://code.visualstudio.com/api/references/contribution-points#contributes.menus
 | 
				
			||||||
 | 
					    "menus": {
 | 
				
			||||||
 | 
					      // 编辑器右键菜单
 | 
				
			||||||
 | 
					      "editor/context": [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "when": "editorTextFocus",
 | 
				
			||||||
 | 
					          "command": "variable-conversion.convertCase",
 | 
				
			||||||
 | 
					          // "group": "1_modification@9"
 | 
				
			||||||
 | 
					          "group": "navigation@9"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "when": "editorTextFocus && _textSelectionLength >= 1",
 | 
				
			||||||
 | 
					          "submenu": "variable-conversion.stringConversionMenu",
 | 
				
			||||||
 | 
					          // docs: https://code.visualstudio.com/api/references/contribution-points#Sorting-of-groups
 | 
				
			||||||
 | 
					          // "group": "1_modification@9"
 | 
				
			||||||
 | 
					          "group": "navigation@9"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      ],
 | 
				
			||||||
 | 
					      "variable-conversion.stringConversionMenu": [
 | 
				
			||||||
 | 
					        // group-1-camel
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toCamelCase",
 | 
				
			||||||
 | 
					          "group": "group-1-camel@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toPascalCase",
 | 
				
			||||||
 | 
					          "group": "group-1-camel@2"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        // group-2-snake
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSnakeCase",
 | 
				
			||||||
 | 
					          "group": "group-2-snake@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSnakeUpperCase",
 | 
				
			||||||
 | 
					          "group": "group-2-snake@2"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSnakePascalCase",
 | 
				
			||||||
 | 
					          "group": "group-2-snake@3"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSnakeCamelCase",
 | 
				
			||||||
 | 
					          "group": "group-2-snake@4"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        // group-3-kebab
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toKebabCase",
 | 
				
			||||||
 | 
					          "group": "group-3-kebab@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toKebabUpperCase",
 | 
				
			||||||
 | 
					          "group": "group-3-kebab@2"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toKebabPascalCase",
 | 
				
			||||||
 | 
					          "group": "group-3-kebab@3"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toKebabCamelCase",
 | 
				
			||||||
 | 
					          "group": "group-3-kebab@4"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        // group-4-space
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSpaceCase",
 | 
				
			||||||
 | 
					          "group": "group-4-space@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSpaceUpperCase",
 | 
				
			||||||
 | 
					          "group": "group-4-space@2"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSpacePascalCase",
 | 
				
			||||||
 | 
					          "group": "group-4-space@3"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toSpaceCamelCase",
 | 
				
			||||||
 | 
					          "group": "group-4-space@4"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        // group-5-dot
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toDotCase",
 | 
				
			||||||
 | 
					          "group": "group-5-dot@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toDotUpperCase",
 | 
				
			||||||
 | 
					          "group": "group-5-dot@2"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toDotPascalCase",
 | 
				
			||||||
 | 
					          "group": "group-5-dot@3"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toDotCamelCase",
 | 
				
			||||||
 | 
					          "group": "group-5-dot@4"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        // group-6-upper-lower
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toLowerCase",
 | 
				
			||||||
 | 
					          "group": "group-6-upper-lower@1"
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "command": "variable-conversion.toUpperCase",
 | 
				
			||||||
 | 
					          "group": "group-6-upper-lower@2"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        // 隐藏菜单项
 | 
				
			||||||
 | 
					        // {
 | 
				
			||||||
 | 
					        //   "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": [
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        "id": "variable-conversion.stringConversionMenu",
 | 
				
			||||||
 | 
					        "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",
 | 
				
			||||||
 | 
					    "package": "echo \"start `vsce package`\" & vsce package",
 | 
				
			||||||
 | 
					    "publish": "vsce publish"
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "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"
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,12 +1,12 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "variable-conversion",
 | 
					  "name": "variable-conversion",
 | 
				
			||||||
  "version": "0.0.1",
 | 
					  "version": "1.0.11",
 | 
				
			||||||
  "lockfileVersion": 3,
 | 
					  "lockfileVersion": 3,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "packages": {
 | 
					  "packages": {
 | 
				
			||||||
    "": {
 | 
					    "": {
 | 
				
			||||||
      "name": "variable-conversion",
 | 
					      "name": "variable-conversion",
 | 
				
			||||||
      "version": "0.0.1",
 | 
					      "version": "1.0.11",
 | 
				
			||||||
      "devDependencies": {
 | 
					      "devDependencies": {
 | 
				
			||||||
        "@types/mocha": "^10.0.6",
 | 
					        "@types/mocha": "^10.0.6",
 | 
				
			||||||
        "@types/node": "18.x",
 | 
					        "@types/node": "18.x",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
  "name": "variable-conversion",
 | 
					  "name": "variable-conversion",
 | 
				
			||||||
  "displayName": "Variable Conversion",
 | 
					  "displayName": "Variable Conversion",
 | 
				
			||||||
  "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.",
 | 
					  "description": "一个强大的变量名转换插件,支持右键菜单、快捷键、状态栏等多种方式使用,支持小驼峰、大驼峰(帕斯卡)、下划线(蛇形)、中划线(连字符/脊柱式)、空格分隔、点分隔、全小写、全大写等常用命名方式(及组合)转换。 \nA powerful variable naming conversion extension. You can use it through the editer menu, shortcut keys and bottom bar. Support camel, pascal, snake, kebab(spinal), space, dot, lower, upper case, and more.",
 | 
				
			||||||
  "version": "1.0.10",
 | 
					  "version": "1.0.11",
 | 
				
			||||||
  "icon": "image/logo.png",
 | 
					  "icon": "image/logo.png",
 | 
				
			||||||
  "publisher": "coder-xiaomo",
 | 
					  "publisher": "coder-xiaomo",
 | 
				
			||||||
  "engines": {
 | 
					  "engines": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,8 +57,17 @@ export function activate(context: vscode.ExtensionContext) {
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	vscode.window.onDidChangeActiveTextEditor(event => {
 | 
						vscode.window.onDidChangeActiveTextEditor(event => {
 | 
				
			||||||
		console.log('onDidChangeActiveTextEditor', event);
 | 
							console.log('onDidChangeActiveTextEditor', event);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// 小窗中编辑器选中后,不做其他点击鼠标点击操作,直接点击主窗口任务栏[变量转换]按钮
 | 
				
			||||||
 | 
							// 能够在主窗口 QuickPick 中对小窗中所选文字进行转换操作 (不太完美的兼容)
 | 
				
			||||||
 | 
							let textEditor = vscode.window.activeTextEditor;
 | 
				
			||||||
 | 
							if (textEditor) {
 | 
				
			||||||
 | 
								const selections = textEditor.selections;
 | 
				
			||||||
 | 
								onTextEditorSelectionChangeCallback(textEditor, selections);
 | 
				
			||||||
 | 
							} else { // 进入 else 的场景举例: 从[代码编辑器]切换到[设置页]
 | 
				
			||||||
			// 判断是否展示状态栏按钮
 | 
								// 判断是否展示状态栏按钮
 | 
				
			||||||
			updateStatusBarItemVisable(selectTextLength);
 | 
								updateStatusBarItemVisable(selectTextLength);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	});
 | 
						});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								test-code.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								test-code.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
				
			|||||||
 | 
					```javascript
 | 
				
			||||||
 | 
					// 小驼峰
 | 
				
			||||||
 | 
					const helloWorld = ''
 | 
				
			||||||
 | 
					// 大驼峰
 | 
				
			||||||
 | 
					const HelloWorld = ''
 | 
				
			||||||
 | 
					// 下划线 + 首字母大写
 | 
				
			||||||
 | 
					const Hello_World = ''
 | 
				
			||||||
 | 
					// 下划线 + 全小写
 | 
				
			||||||
 | 
					const hello_world = ''
 | 
				
			||||||
 | 
					// 下划线 + 全大写
 | 
				
			||||||
 | 
					const HELLO_WORLD = ''
 | 
				
			||||||
 | 
					// 小写
 | 
				
			||||||
 | 
					const helloworld = ''
 | 
				
			||||||
 | 
					// 大写
 | 
				
			||||||
 | 
					const HELLOWORLD = ''
 | 
				
			||||||
 | 
					// 加空格
 | 
				
			||||||
 | 
					const a = 'hello world'
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
		Reference in New Issue
	
	Block a user