1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

Compare commits

...

2 Commits

Author SHA1 Message Date
6c78c9e430 版本号更新为 2.0.0;更新 CHANGELOG.md 2024-12-07 18:11:34 +08:00
8354ebb1ca 项目代码结构调整 2024-12-07 18:10:44 +08:00
16 changed files with 54 additions and 33 deletions

View File

@ -23,6 +23,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-->
## 2.0.0
### Improvement
- Adjust the project code directory structure. (项目代码目录结构调整)
### Changed
- Do not display the editor context menu `Variable Conversion` option when text is not selected. (当未选中文本时,不显示右键菜单 `变量转换` 选项)
## 1.1.0
### Added

View File

@ -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": "1.1.0",
"version": "2.0.0",
// logo
"icon": "image/logo.png",
"publisher": "coder-xiaomo",

View File

@ -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": "1.1.0",
"version": "2.0.0",
"icon": "image/logo.png",
"publisher": "coder-xiaomo",
"engines": {

View File

@ -1,7 +1,7 @@
import { EOL } from '../../type-definition/EOLType';
import { SupportCase } from '../../type-definition/SupportCaseType';
import { SupportCase } from './types/SupportCaseType';
import { TransformTextResult } from '../../type-definition/TransformTextResultType';
import { transformMutliLineText, transformText } from './transform';
import { transformMutliLineText, transformText } from '../../utils/transform';
/**
*
@ -9,6 +9,7 @@ import { transformMutliLineText, transformText } from './transform';
* @param {SupportCase} targetCase
* @param {string} str user selection
* @param {EOL} eol
* @param {Array<TransformTextResult>?} cutText
* @returns
* @since 2024-04-04
*/

View File

@ -1,9 +1,9 @@
import * as vscode from 'vscode';
import { EOL } from "../../type-definition/EOLType";
import { cyclicConvertCaseOrder } from "../../type-definition/SupportCaseType";
import { cyclicConvertCaseOrder } from "./types/SupportCaseType";
import { caseConversion } from "./conversion";
import { isStringArrayEqual, stringListArrayDuplicateRemoval } from '../utils';
import { getUserConfigurations } from '../user-configuration';
import { isStringArrayEqual, stringListArrayDuplicateRemoval } from '../../utils/utils';
import { getUserConfigurations } from '../../utils/user-configuration';
interface UserSelection {
currentEol: EOL

View File

@ -4,10 +4,10 @@
* Code:
* - Add type definition in below `SupportCase` enum and following array
* - Add `commands`, `menus`, `configuration` parts in [package.json] and [package-comment.jsonc]
* - Add main conversion logic in [src/main-code/conversion.ts]
* - Add main conversion logic in [src/core/variable-convert/conversion.ts]
*
* Test:
* - Add test case type definition in [src/type-definition/TestCaseType.ts]
* - Add test case type definition in [src/test/types/TestCaseType.ts]
* - Add test case in [src/test/test-case.ts]
* - Add test code in [src/test/extension.test.ts]
*

View File

@ -1,13 +1,23 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
/**
* @file extension.ts
* @description VS Code
* @author coder-xiaomo
* @version 1.0.0
* @license MIT
*
*
*
*
* @see https://code.visualstudio.com/api
*/
import * as vscode from 'vscode';
import handleEditorReplace from './extension-handler/editor-submenu-handler';
import { handleQuickPick } from './extension-handler/quick-pick-handler';
import { commands } from './type-definition/SupportCaseType';
import { createStatusBarItem, updateStatusBarItemVisable } from './extension-handler/status-bar-handler';
import * as CyclicConversion from './main-code/variable-convert/cyclic-conversion';
import handleEditorReplace from './handler/editor-submenu-handler';
import { handleQuickPick } from './handler/quick-pick-handler';
import { commands } from './core/variable-convert/types/SupportCaseType';
import { createStatusBarItem, updateStatusBarItemVisable } from './handler/status-bar-handler';
import * as CyclicConversion from './core/variable-convert/cyclic-conversion';
import { EOL } from './type-definition/EOLType';
import { getUserConfigurations } from './main-code/user-configuration';
import { getUserConfigurations } from './utils/user-configuration';
// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed

View File

@ -1,8 +1,8 @@
import * as vscode from 'vscode';
import { EOL } from '../type-definition/EOLType';
import { caseConversion } from '../main-code/variable-convert/conversion';
import { SupportCase } from '../type-definition/SupportCaseType';
import { isStringArrayEqual } from '../main-code/utils';
import { caseConversion } from '../core/variable-convert/conversion';
import { SupportCase } from '../core/variable-convert/types/SupportCaseType';
import { isStringArrayEqual } from '../utils/utils';
/**
*

View File

@ -1,12 +1,12 @@
import * as vscode from 'vscode';
import QuickPickItemEx from "../type-definition/QuickPickItemExType";
import { QuickPickSupportCaseItem, quickPickSupportCases } from '../type-definition/SupportCaseType';
import { QuickPickSupportCaseItem, quickPickSupportCases } from '../core/variable-convert/types/SupportCaseType';
import { TransformTextResult } from '../type-definition/TransformTextResultType';
import { transformMutliSelectionText } from '../main-code/variable-convert/transform';
import { transformMutliSelectionText } from '../utils/transform';
import { EOL } from '../type-definition/EOLType';
import { caseConversion } from '../main-code/variable-convert/conversion';
import { isStringArrayEqual } from '../main-code/utils';
import { getUserConfigurations } from '../main-code/user-configuration';
import { caseConversion } from '../core/variable-convert/conversion';
import { isStringArrayEqual } from '../utils/utils';
import { getUserConfigurations } from '../utils/user-configuration';
const QuickPickLabelMaxLength = 60;

View File

@ -4,10 +4,10 @@ import * as assert from 'assert';
// as well as import your extension to test it
import * as vscode from 'vscode';
import testGroups from './test-case';
import { TestCase, TestCaseGroup } from '../type-definition/TestCaseType';
import { transformMutliLineText, transformText } from '../main-code/variable-convert/transform';
import { caseConversion } from '../main-code/variable-convert/conversion';
import { SupportCase } from '../type-definition/SupportCaseType';
import { TestCase, TestCaseGroup } from './types/TestCaseType';
import { transformMutliLineText, transformText } from '../utils/transform';
import { caseConversion } from '../core/variable-convert/conversion';
import { SupportCase } from '../core/variable-convert/types/SupportCaseType';
import { TransformTextResult } from '../type-definition/TransformTextResultType';
// import * as myExtension from '../../extension';

View File

@ -1,4 +1,4 @@
import { TestCaseGroup } from "../type-definition/TestCaseType";
import { TestCaseGroup } from "./types/TestCaseType";
const LF = '\n';
const CRLF = '\r\n';

View File

@ -1,4 +1,4 @@
import { EOL } from "./EOLType";
import { EOL } from "../../type-definition/EOLType";
export type TestCaseGroup = {
group: string

View File

@ -1,4 +1,4 @@
import { TransformTextResult } from "../../type-definition/TransformTextResultType";
import { TransformTextResult } from "../type-definition/TransformTextResultType";
const logDebugInfo = false;

View File

@ -11,7 +11,7 @@ function getUserConfigurations<T>(configKey: string): T | undefined {
const config = vscode.workspace.getConfiguration('variable-conversion');
const configValue = config.get<T>(configKey);
console.log('configValue:', configValue);
// console.log('configValue:', configValue);
return configValue;
}