Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
c930475fac | |||
5d5bccbf6f | |||
5290684660 | |||
2ed3b1c8a0 | |||
29d892f666 |
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
|
// for the documentation about the extensions.json format
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"dbaeumer.vscode-eslint",
|
"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.
|
// Place your settings in this file to overwrite default and user settings.
|
||||||
{
|
{
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
"out": false // set this to true to hide the "out" folder with the compiled JS files
|
||||||
},
|
},
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"out": true // set this to false to include "out" folder in search results
|
"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
|
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||||
"typescript.tsc.autoDetect": "off"
|
"typescript.tsc.autoDetect": "off"
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ src/**
|
|||||||
.yarnrc
|
.yarnrc
|
||||||
vsc-extension-quickstart.md
|
vsc-extension-quickstart.md
|
||||||
**/tsconfig.json
|
**/tsconfig.json
|
||||||
**/.eslintrc.json
|
**/eslint.config.mjs
|
||||||
**/*.map
|
**/*.map
|
||||||
**/*.ts
|
**/*.ts
|
||||||
**/.vscode-test.*
|
**/.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
|
### Removed
|
||||||
|
|
||||||
|
### Internal
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
## 2.0.1
|
||||||
|
|
||||||
|
### Internal
|
||||||
|
|
||||||
|
- Add `.editorconfig` file. (添加 `.editorconfig` 文件)
|
||||||
|
- Upgrade plugin dependency versions. (升级插件依赖版本)
|
||||||
|
- Modify eslint configuration. (调整 eslint 配置)
|
||||||
|
|
||||||
## 2.0.0
|
## 2.0.0
|
||||||
|
|
||||||
### Added
|
### 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
|
- 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
|
- 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
|
- Add test cases
|
||||||
- Initial release
|
- Initial release
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
一个强大的变量命名及路径风格转换插件,支持一键转换、循环转换,支持右键菜单、快捷键、状态栏等多种方式使用。<br>
|
一个强大的变量命名及路径风格转换插件,支持一键转换、循环转换,支持右键菜单、快捷键、状态栏等多种方式使用。<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.
|
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 + /` 快捷键,或点击右键菜单、底部状态栏路径转换按钮轻松实现转换)
|
> - 支持 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
|
## 快捷键 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",
|
"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": "2.0.0",
|
"version": "2.0.1",
|
||||||
"icon": "image/logo.png",
|
"icon": "image/logo.png",
|
||||||
"publisher": "coder-xiaomo",
|
"publisher": "coder-xiaomo",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.87.0"
|
"vscode": "^1.102.0"
|
||||||
},
|
},
|
||||||
"categories": [
|
"categories": [
|
||||||
"Other"
|
"Other"
|
||||||
@@ -402,20 +402,20 @@
|
|||||||
"compile": "tsc -p ./",
|
"compile": "tsc -p ./",
|
||||||
"watch": "tsc -watch -p ./",
|
"watch": "tsc -watch -p ./",
|
||||||
"pretest": "npm run compile && npm run lint",
|
"pretest": "npm run compile && npm run lint",
|
||||||
"lint": "eslint src --ext ts",
|
"lint": "eslint src",
|
||||||
"test": "vscode-test",
|
"test": "vscode-test",
|
||||||
"package": "echo \"start `vsce package`\" & vsce package",
|
"package": "vsce package",
|
||||||
"publish": "vsce publish"
|
"publish": "vsce publish"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mocha": "^10.0.6",
|
"@types/mocha": "^10.0.10",
|
||||||
"@types/node": "18.x",
|
"@types/node": "20.x",
|
||||||
"@types/vscode": "^1.87.0",
|
"@types/vscode": "^1.102.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
"@typescript-eslint/eslint-plugin": "^8.31.1",
|
||||||
"@typescript-eslint/parser": "^7.4.0",
|
"@typescript-eslint/parser": "^8.31.1",
|
||||||
"@vscode/test-cli": "^0.0.8",
|
"@vscode/test-cli": "^0.0.11",
|
||||||
"@vscode/test-electron": "^2.3.9",
|
"@vscode/test-electron": "^2.5.2",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.25.1",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.8.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -113,4 +113,4 @@ function replaceTextEditorSelectedText() {
|
|||||||
});
|
});
|
||||||
userSelection.lastConvertedSelectionsText = textList;
|
userSelection.lastConvertedSelectionsText = textList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -112,4 +112,4 @@ function replaceTextEditorSelectedText() {
|
|||||||
});
|
});
|
||||||
userSelection.lastConvertedSelectionsText = textList;
|
userSelection.lastConvertedSelectionsText = textList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,7 +10,7 @@ let statusBarItemList: Array<vscode.StatusBarItem> = [];
|
|||||||
* @since 2024-04-07
|
* @since 2024-04-07
|
||||||
*/
|
*/
|
||||||
export function createStatusBarItem() {
|
export function createStatusBarItem() {
|
||||||
// 变量转换状态栏 2024.04.07
|
// 变量转换状态栏 2024.04.07
|
||||||
const createVariableConvertStatusBarItem = () => {
|
const createVariableConvertStatusBarItem = () => {
|
||||||
const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||||
// Icon Listing docs: https://code.visualstudio.com/api/references/icons-in-labels#icon-listing
|
// Icon Listing docs: https://code.visualstudio.com/api/references/icons-in-labels#icon-listing
|
||||||
@@ -20,7 +20,7 @@ export function createStatusBarItem() {
|
|||||||
// statusBarItem.show();
|
// statusBarItem.show();
|
||||||
return statusBarItem;
|
return statusBarItem;
|
||||||
};
|
};
|
||||||
// 路径转换状态栏 2024.12.14
|
// 路径转换状态栏 2024.12.14
|
||||||
const createPathConvertStatusBarItem = () => {
|
const createPathConvertStatusBarItem = () => {
|
||||||
const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
const statusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||||
statusBarItem.text = '$(sync-ignored)路径转换'; // italic symbol-null
|
statusBarItem.text = '$(sync-ignored)路径转换'; // italic symbol-null
|
||||||
@@ -51,4 +51,4 @@ export function updateStatusBarItemVisable(selectTextLength: number) {
|
|||||||
statusBarItemList.forEach(statusBarItem => {
|
statusBarItemList.forEach(statusBarItem => {
|
||||||
statusBarItem.hide();
|
statusBarItem.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -41,4 +41,4 @@ export function stringListArrayDuplicateRemoval(stringArr: Array<string[]>): Arr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newArr;
|
return newArr;
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
],
|
],
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"strict": true /* enable all strict type-checking options */
|
"strict": true, /* enable all strict type-checking options */
|
||||||
/* Additional Checks */
|
/* Additional Checks */
|
||||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||||
|
Reference in New Issue
Block a user