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

统一转换方式名称&显示排序;统一转换函数;项目目录结构微调;补全测试用例并全部测试通过

This commit is contained in:
2024-04-05 00:59:57 +08:00
parent 4b734d219a
commit d926a6d768
17 changed files with 574 additions and 401 deletions

View File

@@ -1,5 +1,7 @@
import * as vscode from 'vscode';
import { ConvertFunction, EOL } from '../type-definition/convert-function-type';
import { EOL } from '../type-definition/EOLType';
import { caseConversion } from '../main-code/conversion';
import { SupportCase } from '../type-definition/SupportCaseType';
/**
* 编辑器右键菜单
@@ -7,7 +9,7 @@ import { ConvertFunction, EOL } from '../type-definition/convert-function-type';
* @param convertFunction
* @returns
*/
const handleEditorReplace = (convertFunction: ConvertFunction) => {
const handleEditorReplace = (targetCase: SupportCase) => {
// 获取当前编辑器
let editor = vscode.window.activeTextEditor;
if (!editor) {
@@ -23,7 +25,7 @@ const handleEditorReplace = (convertFunction: ConvertFunction) => {
let text = document.getText(selection);
// 转换文本
const converted = convertFunction(text, eol);
const converted = caseConversion(targetCase, text, eol);
console.log('converted', converted);
// 无法转换时,跳过转换

View File

@@ -1,5 +1,5 @@
import * as vscode from 'vscode';
import QuickPickItemEx from "../type-definition/extended-quick-pick-item-type";
import QuickPickItemEx from "../type-definition/QuickPickItemExType";
/**
* 弹出的提示