From 73b18f3554465549bd788719584a038dcfa4d8e8 Mon Sep 17 00:00:00 2001 From: Tim van der Kooi Date: Fri, 13 Dec 2024 11:43:56 -0800 Subject: [PATCH 1/2] Add Show Output Channel command for VSCode extension --- vscode/package.json | 5 +++++ vscode/src/common.ts | 1 + vscode/src/rubyLsp.ts | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/vscode/package.json b/vscode/package.json index 6f3491047..301c5632d 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -153,6 +153,11 @@ "command": "rubyLsp.collectRubyLspInfo", "title": "Collect Ruby LSP Information for Issue Reporting", "category": "Ruby LSP" + }, + { + "command": "rubyLsp.showOutput", + "title": "Show Output Channel", + "category": "Ruby LSP" } ], "configuration": { diff --git a/vscode/src/common.ts b/vscode/src/common.ts index 061acae19..eb0c5797b 100644 --- a/vscode/src/common.ts +++ b/vscode/src/common.ts @@ -29,6 +29,7 @@ export enum Command { NewMinitestFile = "rubyLsp.newMinitestFile", CollectRubyLspInfo = "rubyLsp.collectRubyLspInfo", StartServerInDebugMode = "rubyLsp.startServerInDebugMode", + ShowOutput = "rubyLsp.showOutput", } export interface RubyInterface { diff --git a/vscode/src/rubyLsp.ts b/vscode/src/rubyLsp.ts index 6bc84d00e..24ab60721 100644 --- a/vscode/src/rubyLsp.ts +++ b/vscode/src/rubyLsp.ts @@ -597,6 +597,10 @@ export class RubyLsp { }, ), ); + vscode.commands.registerCommand(Command.ShowOutput, async () => { + const workspace = await this.showWorkspacePick(); + workspace?.lspClient?.outputChannel.show(); + }); } // Get the current active workspace based on which file is opened in the editor From 5ff324f3f8067f6257b33b6e32a0461fadfb677c Mon Sep 17 00:00:00 2001 From: Tim van der Kooi Date: Tue, 17 Dec 2024 08:59:58 -0800 Subject: [PATCH 2/2] Fix capitalization and use LOG_CHANNEL for output --- vscode/package.json | 2 +- vscode/src/rubyLsp.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/vscode/package.json b/vscode/package.json index 301c5632d..3dc80479d 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -156,7 +156,7 @@ }, { "command": "rubyLsp.showOutput", - "title": "Show Output Channel", + "title": "Show output channel", "category": "Ruby LSP" } ], diff --git a/vscode/src/rubyLsp.ts b/vscode/src/rubyLsp.ts index 24ab60721..0b7aa7f5a 100644 --- a/vscode/src/rubyLsp.ts +++ b/vscode/src/rubyLsp.ts @@ -598,8 +598,7 @@ export class RubyLsp { ), ); vscode.commands.registerCommand(Command.ShowOutput, async () => { - const workspace = await this.showWorkspacePick(); - workspace?.lspClient?.outputChannel.show(); + LOG_CHANNEL.show(); }); }