Compare commits
6 Commits
feature-en
...
main
Author | SHA1 | Date | |
---|---|---|---|
c6a2f418e6 | |||
0d2d89329e | |||
6b9ce052e9 | |||
076553967c | |||
33d743afc7 | |||
8f8ae89be5 |
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
@@ -10,7 +10,8 @@
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--disable-extensions", // 调试时禁用其他扩展
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
|
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -7,5 +7,11 @@
|
||||
"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"
|
||||
"typescript.tsc.autoDetect": "off",
|
||||
|
||||
// Code Spell Checker 插件
|
||||
"cSpell.words": [
|
||||
"Gitee",
|
||||
"coder-xiaomo"
|
||||
],
|
||||
}
|
||||
|
@@ -25,11 +25,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
-->
|
||||
|
||||
## 2.1.[Unreleased]
|
||||
## 2.1.0
|
||||
|
||||
### Changed
|
||||
|
||||
- **[BREAKING!!!]** Deprecate `variable-conversion.disableFormat`, please use `variable-conversion.enabledFormats` instead. (移除 `variable-conversion.disableFormat` 配置项,请使用 `variable-conversion.enabledFormats`)
|
||||
- Support enabling only partial target conversion formats. (支持仅开启部分目标转换格式)
|
||||
|
||||
## 2.0.1
|
||||
|
||||
|
17
README.md
17
README.md
@@ -5,14 +5,20 @@
|
||||
一个强大的变量命名及路径风格转换插件,支持一键转换、循环转换,支持右键菜单、快捷键、状态栏等多种方式使用。<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.1 版本 (2025-07-12)**
|
||||
> **【近期更新】**
|
||||
>
|
||||
> **v2.1.0 (2025-07-14)**
|
||||
>
|
||||
> - 支持仅开启部分目标转换格式 (优化 VSCode 配置项)
|
||||
>
|
||||
> **v2.0.0 (2024-12-15)**
|
||||
>
|
||||
> - 支持 Windows / Unix 路径风格转换(可选中文本中的路径,然后使用 `Ctrl + Alt + /` 快捷键,或点击右键菜单、底部状态栏路径转换按钮轻松实现转换)
|
||||
|
||||
- ✅ 支持多选区 Support multi-selection
|
||||
- ✅ 支持多窗口 Support subwindow
|
||||
- ✅ 支持撤回 & 重做 Support undo & redo (Ctrl + Z / Ctrl + Y)
|
||||
- ✅ 支持禁用部分目标转换格式 Supports disabling some target conversion formats
|
||||
- ✅ 支持仅开启部分目标转换格式 Support enabling only partial target conversion formats
|
||||
|
||||
> 🔭 Tips for Chinese users: 如果您无法看到下文图片,请[点这里](https://gitee.com/coder-xiaomo/variable-conversion-vscode-extension/blob/main/README.md)查看
|
||||
|
||||
@@ -84,9 +90,10 @@ Or right-click on the selected text -> Convert string to...
|
||||
|
||||
## 配置项 Configurations
|
||||
|
||||
| 配置项 Configuration Key | 描述 Description | 配置示例 | 默认值 |
|
||||
| ----------------------------------- | ------------------------------------------------------------ | ------------------------------ | ------ |
|
||||
| `variable-conversion.enabledFormats` | 配置启用的变量命名方式<br />Configuration of Enabled Variable Naming Conventions. | `{ "xxxCase.enabled": boolean, ... }` | 见配置项 |
|
||||
| 配置项 Configuration Key | 描述 Description | 配置示例 | 默认值 |
|
||||
| --------------------------------------- | ------------------------------------------------------------ | ------------------------------------- | -------- |
|
||||
| `variable-conversion.enabledFormats` | 配置启用的变量命名方式<br />Configuration of Enabled Variable Naming Conventions. | `{ "xxxCase.enabled": boolean, ... }` | 见配置项 |
|
||||
| `variable-conversion.disablePathFormat` | 定义哪些路径风格是禁用的<br />Define which path formats are disabled. | `["windows_style", "unix_style"]` | 见配置项 |
|
||||
|
||||
## 支持的类型 Support Case
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
"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.1",
|
||||
"version": "2.1.0",
|
||||
// logo
|
||||
"icon": "image/logo.png",
|
||||
"publisher": "coder-xiaomo",
|
||||
@@ -684,6 +684,7 @@
|
||||
"dotCamelCase.enabled": false
|
||||
}
|
||||
},
|
||||
// "variable-conversion.formatOrder": {},
|
||||
"variable-conversion.disableFormat": {
|
||||
"order": 1,
|
||||
// markdownDescription 最多配置 11 行
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"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.1",
|
||||
"version": "2.1.0",
|
||||
"icon": "image/logo.png",
|
||||
"publisher": "coder-xiaomo",
|
||||
"engines": {
|
||||
|
@@ -25,7 +25,7 @@ import { commands as pathCommands } from './core/path-convert/types/SupportPathF
|
||||
import * as CyclicConversionPath from './core/path-convert/cyclic-conversion';
|
||||
|
||||
// Common
|
||||
import { createStatusBarItem, updateStatusBarItemVisable } from './handler/status-bar-handler';
|
||||
import { createStatusBarItem, updateStatusBarItemVisible } from './handler/status-bar-handler';
|
||||
import { EOL } from './types/EOLType';
|
||||
import { getUserConfigurations } from './utils/user-configuration';
|
||||
|
||||
@@ -77,7 +77,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
}
|
||||
|
||||
// 判断是否展示状态栏按钮
|
||||
updateStatusBarItemVisable(selectTextLength);
|
||||
updateStatusBarItemVisible(selectTextLength);
|
||||
|
||||
// 循环转换:记录当前选中内容,并且进行转换
|
||||
let eol: EOL = textEditor.document.eol === vscode.EndOfLine.CRLF ? '\r\n' : '\n';
|
||||
@@ -104,7 +104,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
onTextEditorSelectionChangeCallback(textEditor, selections);
|
||||
} else { // 进入 else 的场景举例: 从[代码编辑器]切换到[设置页]
|
||||
// 判断是否展示状态栏按钮
|
||||
updateStatusBarItemVisable(selectTextLength);
|
||||
updateStatusBarItemVisible(selectTextLength);
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -40,7 +40,7 @@ export function createStatusBarItem() {
|
||||
*
|
||||
* @since 2024-04-07
|
||||
*/
|
||||
export function updateStatusBarItemVisable(selectTextLength: number) {
|
||||
export function updateStatusBarItemVisible(selectTextLength: number) {
|
||||
let editor = vscode.window.activeTextEditor;
|
||||
if (editor && selectTextLength > 0) {
|
||||
statusBarItemList.forEach(statusBarItem => {
|
||||
|
Reference in New Issue
Block a user