From 138bf53f41e1f422af3b199476f6e094e6b55d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Sat, 6 Apr 2024 14:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E6=9C=AA=E8=83=BD=E6=AD=A3=E7=A1=AE=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +++++- package-comment.jsonc | 5 ++++- package.json | 5 ++++- src/extension-handler/editor-submenu-handler.ts | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a00e0..57aabf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Add extension logo +- Add extension logo (添加插件 logo) + +### Fixed + +- Fixed an issue where the editor context menu was not displayed correctly. (修复右键菜单未能正确展示的问题) ## 1.0.0 diff --git a/package-comment.jsonc b/package-comment.jsonc index 832a304..4e4886a 100644 --- a/package-comment.jsonc +++ b/package-comment.jsonc @@ -30,7 +30,10 @@ } ], "main": "./out/extension.js", - "activationEvents": [], + "activationEvents": [ + "onStartupFinished", // 当编辑器完成启动时激活 + "onTextSelected" // 当用户选中文本时激活 + ], "contributes": { "commands": [ /** diff --git a/package.json b/package.json index b6a2ddf..2802ca8 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,10 @@ } ], "main": "./out/extension.js", - "activationEvents": [], + "activationEvents": [ + "onStartupFinished", + "onTextSelected" + ], "contributes": { "commands": [ { diff --git a/src/extension-handler/editor-submenu-handler.ts b/src/extension-handler/editor-submenu-handler.ts index 622d2ff..338e6cf 100644 --- a/src/extension-handler/editor-submenu-handler.ts +++ b/src/extension-handler/editor-submenu-handler.ts @@ -16,7 +16,7 @@ const handleEditorReplace = (targetCase: SupportCase) => { return; } - console.log('============ start convert ============'); + // console.log('============ start convert ============'); let document = editor.document; let selection = editor.selection; let eol: EOL = document.eol === vscode.EndOfLine.CRLF ? '\r\n' : '\n'; @@ -45,7 +45,7 @@ const handleEditorReplace = (targetCase: SupportCase) => { editor.edit(editBuilder => { editBuilder.replace(selection, converted); }); - console.log('============ finish convert ============'); + // console.log('============ finish convert ============'); }; export default handleEditorReplace;