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

实现 快捷键 Ctrl + Shift + T 显示 vscode QickPick 弹窗

This commit is contained in:
2024-04-07 02:00:24 +08:00
parent 9120e47147
commit 461ab98385
7 changed files with 221 additions and 38 deletions

View File

@@ -12,7 +12,7 @@ import { transformMutliLineText, transformText } from './transform';
* @returns 转换后的文本
* @since 2024-04-04
*/
export function caseConversion(targetCase: SupportCase, str: string, eol: EOL): string {
export function caseConversion(targetCase: SupportCase, str: string, eol: EOL, cutText: Array<TransformTextResult> | undefined = undefined): string {
let spaceCharacter: '-' | '_' | ' ' | undefined = undefined;
switch (targetCase) {
default:
@@ -39,7 +39,7 @@ export function caseConversion(targetCase: SupportCase, str: string, eol: EOL):
}
// Cut text 切割文本
const results: Array<TransformTextResult> = transformMutliLineText(str);
const results: Array<TransformTextResult> = cutText === undefined ? transformMutliLineText(str) : cutText;
// console.log('results', results);
const transformedLines: Array<string> = [];