Merge branch 'main' into release
This commit is contained in:
		
							
								
								
									
										26
									
								
								.editorconfig
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								.editorconfig
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
# EditorConfig is awesome: https://editorconfig.org
 | 
			
		||||
 | 
			
		||||
# top-most EditorConfig file
 | 
			
		||||
root = true
 | 
			
		||||
 | 
			
		||||
[*]
 | 
			
		||||
end_of_line = lf
 | 
			
		||||
 | 
			
		||||
# Unix-style newlines with a newline ending every file
 | 
			
		||||
insert_final_newline = true
 | 
			
		||||
 | 
			
		||||
# Set default charset
 | 
			
		||||
charset = utf-8
 | 
			
		||||
 | 
			
		||||
[*.{js,ts}]
 | 
			
		||||
# 4 space indentation
 | 
			
		||||
indent_style = space
 | 
			
		||||
indent_size = 4
 | 
			
		||||
 | 
			
		||||
# Tab indentation (no size specified)
 | 
			
		||||
[.vscode/**.json]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
 | 
			
		||||
# 历史原因需要保留 tab 缩进的代码文件
 | 
			
		||||
[src/{test/extension.test.ts,extension.ts}]
 | 
			
		||||
indent_style = tab
 | 
			
		||||
@@ -1,30 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
    "root": true,
 | 
			
		||||
    "parser": "@typescript-eslint/parser",
 | 
			
		||||
    "parserOptions": {
 | 
			
		||||
        "ecmaVersion": 6,
 | 
			
		||||
        "sourceType": "module"
 | 
			
		||||
    },
 | 
			
		||||
    "plugins": [
 | 
			
		||||
        "@typescript-eslint"
 | 
			
		||||
    ],
 | 
			
		||||
    "rules": {
 | 
			
		||||
        "@typescript-eslint/naming-convention": [
 | 
			
		||||
            "warn",
 | 
			
		||||
            {
 | 
			
		||||
                "selector": "import",
 | 
			
		||||
                "format": [ "camelCase", "PascalCase" ]
 | 
			
		||||
            }
 | 
			
		||||
        ],
 | 
			
		||||
        "@typescript-eslint/semi": "warn",
 | 
			
		||||
        "curly": "warn",
 | 
			
		||||
        "eqeqeq": "warn",
 | 
			
		||||
        "no-throw-literal": "warn",
 | 
			
		||||
        "semi": "off"
 | 
			
		||||
    },
 | 
			
		||||
    "ignorePatterns": [
 | 
			
		||||
        "out",
 | 
			
		||||
        "dist",
 | 
			
		||||
        "**/*.d.ts"
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/extensions.json
									
									
									
									
										vendored
									
									
								
							@@ -3,6 +3,6 @@
 | 
			
		||||
	// for the documentation about the extensions.json format
 | 
			
		||||
	"recommendations": [
 | 
			
		||||
		"dbaeumer.vscode-eslint",
 | 
			
		||||
        "ms-vscode.extension-test-runner"
 | 
			
		||||
		"ms-vscode.extension-test-runner"
 | 
			
		||||
	]
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@@ -1,11 +1,11 @@
 | 
			
		||||
// Place your settings in this file to overwrite default and user settings.
 | 
			
		||||
{
 | 
			
		||||
    "files.exclude": {
 | 
			
		||||
        "out": false // set this to true to hide the "out" folder with the compiled JS files
 | 
			
		||||
    },
 | 
			
		||||
    "search.exclude": {
 | 
			
		||||
        "out": true // set this to false to include "out" folder in search results
 | 
			
		||||
    },
 | 
			
		||||
    // Turn off tsc task auto detection since we have the necessary tasks as npm scripts
 | 
			
		||||
    "typescript.tsc.autoDetect": "off"
 | 
			
		||||
}
 | 
			
		||||
	"files.exclude": {
 | 
			
		||||
		"out": false // set this to true to hide the "out" folder with the compiled JS files
 | 
			
		||||
	},
 | 
			
		||||
	"search.exclude": {
 | 
			
		||||
		"out": true // set this to false to include "out" folder in search results
 | 
			
		||||
	},
 | 
			
		||||
	// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
 | 
			
		||||
	"typescript.tsc.autoDetect": "off"
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ src/**
 | 
			
		||||
.yarnrc
 | 
			
		||||
vsc-extension-quickstart.md
 | 
			
		||||
**/tsconfig.json
 | 
			
		||||
**/.eslintrc.json
 | 
			
		||||
**/eslint.config.mjs
 | 
			
		||||
**/*.map
 | 
			
		||||
**/*.ts
 | 
			
		||||
**/.vscode-test.*
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -21,8 +21,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 | 
			
		||||
 | 
			
		||||
### Removed
 | 
			
		||||
 | 
			
		||||
### Internal
 | 
			
		||||
 | 
			
		||||
-->
 | 
			
		||||
 | 
			
		||||
## 2.0.1
 | 
			
		||||
 | 
			
		||||
### Internal
 | 
			
		||||
 | 
			
		||||
- Add `.editorconfig` file. (添加 `.editorconfig` 文件)
 | 
			
		||||
- Upgrade plugin dependency versions. (升级插件依赖版本)
 | 
			
		||||
- Modify eslint configuration. (调整 eslint 配置)
 | 
			
		||||
 | 
			
		||||
## 2.0.0
 | 
			
		||||
 | 
			
		||||
### Added
 | 
			
		||||
@@ -110,4 +120,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 | 
			
		||||
- Adds an editor context menu with submenu
 | 
			
		||||
- Implement conversion to Camel Case, Pascal Case, Snake Case(Snake Camel, Snake Pascal, Snake Upper), Kebab Case(Kebab Camel, Kebab Pascal, Kebab Upper), Lower Case, Upper Case
 | 
			
		||||
- Add test cases
 | 
			
		||||
- Initial release
 | 
			
		||||
- Initial release
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@
 | 
			
		||||
一个强大的变量命名及路径风格转换插件,支持一键转换、循环转换,支持右键菜单、快捷键、状态栏等多种方式使用。<br>
 | 
			
		||||
A powerful variable and path conversion extension. Supports one-key conversion & cyclic conversion. You can use it through the editer menu, shortcut keys and status bar.
 | 
			
		||||
 | 
			
		||||
> 【近期更新】v2.0.0 版本 (2024-12-15)
 | 
			
		||||
> **【近期更新】v2.0.1 版本 (2025-07-12)**
 | 
			
		||||
>
 | 
			
		||||
> - 支持 Windows / Unix 路径风格转换(可选中文本中的路径,然后使用  `Ctrl + Alt + /` 快捷键,或点击右键菜单、底部状态栏路径转换按钮轻松实现转换)
 | 
			
		||||
 | 
			
		||||
@@ -67,7 +67,7 @@ Or right-click on the selected text -> Convert string to...
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
**注:**目前 `v2.0.0` 版本暂仅支持 `Windows 风格路径` 与 `Unix 风格路径` 互转,所以这两个快捷键目前效果相同。**后续会陆续增加其他更多路径风格**(例如 `Windows Git Bash` 风格,浏览器 `file://` 协议风格等),敬请期待。
 | 
			
		||||
**注:** 目前 `v2.0.0` 版本暂仅支持 `Windows 风格路径` 与 `Unix 风格路径` 互转,所以这两个快捷键目前效果相同。**后续会陆续增加其他更多路径风格**(例如 `Windows Git Bash` 风格,浏览器 `file://` 协议风格等),敬请期待。
 | 
			
		||||
 | 
			
		||||
## 快捷键 Shortcut key
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										28
									
								
								eslint.config.mjs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								eslint.config.mjs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
import typescriptEslint from "@typescript-eslint/eslint-plugin";
 | 
			
		||||
import tsParser from "@typescript-eslint/parser";
 | 
			
		||||
 | 
			
		||||
export default [{
 | 
			
		||||
    files: ["**/*.ts"],
 | 
			
		||||
}, {
 | 
			
		||||
    plugins: {
 | 
			
		||||
        "@typescript-eslint": typescriptEslint,
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    languageOptions: {
 | 
			
		||||
        parser: tsParser,
 | 
			
		||||
        ecmaVersion: 2022,
 | 
			
		||||
        sourceType: "module",
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    rules: {
 | 
			
		||||
        "@typescript-eslint/naming-convention": ["warn", {
 | 
			
		||||
            selector: "import",
 | 
			
		||||
            format: ["camelCase", "PascalCase"],
 | 
			
		||||
        }],
 | 
			
		||||
 | 
			
		||||
        curly: "warn",
 | 
			
		||||
        eqeqeq: "warn",
 | 
			
		||||
        "no-throw-literal": "warn",
 | 
			
		||||
        semi: "warn",
 | 
			
		||||
    },
 | 
			
		||||
}];
 | 
			
		||||
							
								
								
									
										2214
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2214
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										26
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								package.json
									
									
									
									
									
								
							@@ -2,11 +2,11 @@
 | 
			
		||||
  "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": "2.0.0",
 | 
			
		||||
  "version": "2.0.1",
 | 
			
		||||
  "icon": "image/logo.png",
 | 
			
		||||
  "publisher": "coder-xiaomo",
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "vscode": "^1.87.0"
 | 
			
		||||
    "vscode": "^1.102.0"
 | 
			
		||||
  },
 | 
			
		||||
  "categories": [
 | 
			
		||||
    "Other"
 | 
			
		||||
@@ -402,20 +402,20 @@
 | 
			
		||||
    "compile": "tsc -p ./",
 | 
			
		||||
    "watch": "tsc -watch -p ./",
 | 
			
		||||
    "pretest": "npm run compile && npm run lint",
 | 
			
		||||
    "lint": "eslint src --ext ts",
 | 
			
		||||
    "lint": "eslint src",
 | 
			
		||||
    "test": "vscode-test",
 | 
			
		||||
    "package": "echo \"start `vsce package`\" & vsce package",
 | 
			
		||||
    "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"
 | 
			
		||||
    "@types/mocha": "^10.0.10",
 | 
			
		||||
    "@types/node": "20.x",
 | 
			
		||||
    "@types/vscode": "^1.102.0",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^8.31.1",
 | 
			
		||||
    "@typescript-eslint/parser": "^8.31.1",
 | 
			
		||||
    "@vscode/test-cli": "^0.0.11",
 | 
			
		||||
    "@vscode/test-electron": "^2.5.2",
 | 
			
		||||
    "eslint": "^9.25.1",
 | 
			
		||||
    "typescript": "^5.8.3"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -113,4 +113,4 @@ function replaceTextEditorSelectedText() {
 | 
			
		||||
        });
 | 
			
		||||
        userSelection.lastConvertedSelectionsText = textList;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -112,4 +112,4 @@ function replaceTextEditorSelectedText() {
 | 
			
		||||
        });
 | 
			
		||||
        userSelection.lastConvertedSelectionsText = textList;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ let statusBarItemList: Array<vscode.StatusBarItem> = [];
 | 
			
		||||
 * @since 2024-04-07
 | 
			
		||||
 */
 | 
			
		||||
export function createStatusBarItem() {
 | 
			
		||||
	// 变量转换状态栏 2024.04.07
 | 
			
		||||
    // 变量转换状态栏 2024.04.07
 | 
			
		||||
    const createVariableConvertStatusBarItem = () => {
 | 
			
		||||
        const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
 | 
			
		||||
        // Icon Listing docs: https://code.visualstudio.com/api/references/icons-in-labels#icon-listing
 | 
			
		||||
@@ -20,7 +20,7 @@ export function createStatusBarItem() {
 | 
			
		||||
        // statusBarItem.show();
 | 
			
		||||
        return statusBarItem;
 | 
			
		||||
    };
 | 
			
		||||
	// 路径转换状态栏 2024.12.14
 | 
			
		||||
    // 路径转换状态栏 2024.12.14
 | 
			
		||||
    const createPathConvertStatusBarItem = () => {
 | 
			
		||||
        const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
 | 
			
		||||
        statusBarItem.text = '$(sync-ignored)路径转换'; // italic symbol-null
 | 
			
		||||
@@ -51,4 +51,4 @@ export function updateStatusBarItemVisable(selectTextLength: number) {
 | 
			
		||||
    statusBarItemList.forEach(statusBarItem => {
 | 
			
		||||
        statusBarItem.hide();
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -41,4 +41,4 @@ export function stringListArrayDuplicateRemoval(stringArr: Array<string[]>): Arr
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return newArr;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@
 | 
			
		||||
		],
 | 
			
		||||
		"sourceMap": true,
 | 
			
		||||
		"rootDir": "src",
 | 
			
		||||
		"strict": true   /* enable all strict type-checking options */
 | 
			
		||||
		"strict": true,   /* enable all strict type-checking options */
 | 
			
		||||
		/* Additional Checks */
 | 
			
		||||
		// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
 | 
			
		||||
		// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user