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

修复右键菜单未能正确展示的问题

This commit is contained in:
程序员小墨 2024-04-06 14:27:10 +08:00
parent ad15636256
commit 138bf53f41
4 changed files with 15 additions and 5 deletions

View File

@ -26,7 +26,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Add extension logo - Add extension logo (添加插件 logo)
### Fixed
- Fixed an issue where the editor context menu was not displayed correctly. (修复右键菜单未能正确展示的问题)
## 1.0.0 ## 1.0.0

View File

@ -30,7 +30,10 @@
} }
], ],
"main": "./out/extension.js", "main": "./out/extension.js",
"activationEvents": [], "activationEvents": [
"onStartupFinished", // 当编辑器完成启动时激活
"onTextSelected" // 当用户选中文本时激活
],
"contributes": { "contributes": {
"commands": [ "commands": [
/** /**

View File

@ -26,7 +26,10 @@
} }
], ],
"main": "./out/extension.js", "main": "./out/extension.js",
"activationEvents": [], "activationEvents": [
"onStartupFinished",
"onTextSelected"
],
"contributes": { "contributes": {
"commands": [ "commands": [
{ {

View File

@ -16,7 +16,7 @@ const handleEditorReplace = (targetCase: SupportCase) => {
return; return;
} }
console.log('============ start convert ============'); // 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 +45,7 @@ const handleEditorReplace = (targetCase: SupportCase) => {
editor.edit(editBuilder => { editor.edit(editBuilder => {
editBuilder.replace(selection, converted); editBuilder.replace(selection, converted);
}); });
console.log('============ finish convert ============'); // console.log('============ finish convert ============');
}; };
export default handleEditorReplace; export default handleEditorReplace;