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

项目代码结构调整

This commit is contained in:
程序员小墨 2024-12-07 18:10:44 +08:00
parent d7aa9ac403
commit 8354ebb1ca
13 changed files with 42 additions and 31 deletions

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;
}