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

代码注释调整

This commit is contained in:
程序员小墨 2024-04-08 10:10:39 +08:00
parent 74111398da
commit 4ef50ea556
3 changed files with 22 additions and 26 deletions

View File

@ -38,24 +38,24 @@ Or right-click on the selected text -> Convert string to...
## 支持的类型 Support Case ## 支持的类型 Support Case
| 类型 | Case | 举例 e.g. | | 类型 | Case | 举例 e.g. |
| ----------------------------------- | ------------------------ | ---------------- | | ------------------------------------------ | ------------------------ | ---------------- |
| 小驼峰(驼峰)命名 | Camel Case | fooBar | | 小驼峰(驼峰)命名 | Camel Case | fooBar |
| 大驼峰(帕斯卡)命名 | Pascal Case | FooBar | | 大驼峰(帕斯卡)命名 | Pascal Case | FooBar |
| 下划线(蛇形)命名 | Snake Case | foo_bar | | 下划线(蛇形)命名 | Snake Case | foo_bar |
| 下划线(蛇形) + 小驼峰(驼峰)命名 | Snake Camel Case | foo_Bar | | 下划线(蛇形) + 小驼峰(驼峰)命名 | Snake Camel Case | foo_Bar |
| 下划线(蛇形) + 大驼峰(帕斯卡)命名 | Snake Pascal Case | Foo_Bar | | 下划线(蛇形) + 大驼峰(帕斯卡)命名 | Snake Pascal Case | Foo_Bar |
| 下划线(蛇形) + 全大写命名 | Snake Upper Case | FOO_BAR | | 下划线(蛇形) + 全大写命名 | Snake Upper Case | FOO_BAR |
| 中划线(连字符/脊柱式)命名 | Kebab Case / Spinal Case | foo-bar | | 中划线(连字符/脊柱式)命名 | Kebab Case / Spinal Case | foo-bar |
| 中划线(连字符/脊柱式) + 小驼峰(驼峰)命名 | Kebab Camel Case | foo-Bar | | 中划线(连字符/脊柱式) + 小驼峰(驼峰)命名 | Kebab Camel Case | foo-Bar |
| 中划线(连字符/脊柱式) + 大驼峰(帕斯卡)命名 | Kebab Pascal Case | Foo-Bar | | 中划线(连字符/脊柱式) + 大驼峰(帕斯卡)命名 | Kebab Pascal Case | Foo-Bar |
| 中划线(连字符/脊柱式) + 全大写命名 | Kebab Upper Case | FOO-BAR | | 中划线(连字符/脊柱式) + 全大写命名 | Kebab Upper Case | FOO-BAR |
| 空格分隔命名 | Space Case | foo bar | | 空格分隔命名 | Space Case | foo bar |
| 空格分隔 + 小驼峰(驼峰)命名 | Space Camel Case | foo Bar | | 空格分隔 + 小驼峰(驼峰)命名 | Space Camel Case | foo Bar |
| 空格分隔 + 大驼峰(帕斯卡)命名 | Space Pascal Case | Foo Bar | | 空格分隔 + 大驼峰(帕斯卡)命名 | Space Pascal Case | Foo Bar |
| 空格分隔 + 全大写命名 | Space Upper Case | FOO BAR | | 空格分隔 + 全大写命名 | Space Upper Case | FOO BAR |
| 全小写 | Lower Case | foo_bar / foobar | | 全小写 | Lower Case | foo_bar / foobar |
| 全大写 | Upper Case | FOO_BAR / FOOBAR | | 全大写 | Upper Case | FOO_BAR / FOOBAR |

View File

@ -16,7 +16,6 @@ const handleEditorReplace = (targetCase: SupportCase) => {
return; return;
} }
// console.log('============ start convert ============');
let document = editor.document; let document = editor.document;
let selection = editor.selection; let selection = editor.selection;
let eol: EOL = document.eol === vscode.EndOfLine.CRLF ? '\r\n' : '\n'; let eol: EOL = document.eol === vscode.EndOfLine.CRLF ? '\r\n' : '\n';
@ -45,7 +44,6 @@ const handleEditorReplace = (targetCase: SupportCase) => {
editor.edit(editBuilder => { editor.edit(editBuilder => {
editBuilder.replace(selection, converted); editBuilder.replace(selection, converted);
}); });
// console.log('============ finish convert ============');
}; };
export default handleEditorReplace; export default handleEditorReplace;

View File

@ -2,20 +2,18 @@
* When support a new case, there's something we need to do. * When support a new case, there's something we need to do.
* *
* Code: * Code:
* - Add `commands`, `menus` parts in package.json (and package-comment.jsonc) * - Add type definition in below `SupportCase` enum and following array
* - Add main conversion logic in src/main-code/variable-conversion.ts * - Add `commands`, `menus` parts in [package.json] and [package-comment.jsonc]
* - Add disposable in src/extension.ts * - Add main conversion logic in [src/main-code/conversion.ts]
* *
* Test: * Test:
* - Add test case type definition in src/type-definition/test-case-type.ts * - Add test case type definition in [src/type-definition/TestCaseType.ts]
* - Add test case in src/test/test-case.ts * - Add test case in [src/test/test-case.ts]
* - Add test code in src/test/extension.test.ts * - Add test code in [src/test/extension.test.ts]
* *
* Docs: * Docs:
* - Add type definition in below `SupportCase` enum * - Modify `description` in [package.json] and [package-comment.jsonc]
* - Modify `description` in package.json * - Add changes in [CHANGELOG.md] and [README.md]
* - Add changes in CHANGELOG.md
* - Add changes in README.md
*/ */
export enum SupportCase { export enum SupportCase {