diff --git a/lib/ruby_lsp/server.rb b/lib/ruby_lsp/server.rb index 458dbd565..87712bbc8 100644 --- a/lib/ruby_lsp/server.rb +++ b/lib/ruby_lsp/server.rb @@ -13,7 +13,7 @@ class Server < BaseServer def process_message(message) case message[:method] when "initialize" - send_log_message("Initializing Ruby LSP v#{VERSION}...") + send_log_message("Initializing Ruby LSP v#{VERSION} https://github.com/Shopify/ruby-lsp/releases/tag/v#{VERSION}....") run_initialize(message) when "initialized" send_log_message("Finished initializing Ruby LSP!") unless @test_mode diff --git a/vscode/package.json b/vscode/package.json index b3266a626..3e386461d 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -85,6 +85,11 @@ "title": "Stop", "category": "Ruby LSP" }, + { + "command": "rubyLsp.showServerChangelog", + "title": "Open server changelog in browser", + "category": "Ruby LSP" + }, { "command": "rubyLsp.startServerInDebugMode", "title": "Debug the Ruby LSP server", diff --git a/vscode/src/common.ts b/vscode/src/common.ts index 327ca2bae..b4ee28a71 100644 --- a/vscode/src/common.ts +++ b/vscode/src/common.ts @@ -8,6 +8,7 @@ import { State } from "vscode-languageclient"; export enum Command { Start = "rubyLsp.start", Stop = "rubyLsp.stop", + ShowServerChangelog = "rubyLsp.showServerChangelog", Restart = "rubyLsp.restart", Update = "rubyLsp.update", ToggleExperimentalFeatures = "rubyLsp.toggleExperimentalFeatures", diff --git a/vscode/src/rubyLsp.ts b/vscode/src/rubyLsp.ts index 54f1b2f6c..c6f6e03bc 100644 --- a/vscode/src/rubyLsp.ts +++ b/vscode/src/rubyLsp.ts @@ -248,6 +248,18 @@ export class RubyLsp { Command.ShowSyntaxTree, this.showSyntaxTree.bind(this), ), + vscode.commands.registerCommand(Command.ShowServerChangelog, () => { + const version = this.currentActiveWorkspace()?.lspClient?.serverVersion; + + if (!version) { + return; + } + return vscode.env.openExternal( + vscode.Uri.parse( + `https://github.com/Shopify/ruby-lsp/releases/tag/v${version}`, + ), + ); + }), vscode.commands.registerCommand(Command.FormatterHelp, () => { return vscode.env.openExternal( vscode.Uri.parse( diff --git a/vscode/src/status.ts b/vscode/src/status.ts index 0cf989cc0..5b0ba2a30 100644 --- a/vscode/src/status.ts +++ b/vscode/src/status.ts @@ -16,6 +16,10 @@ const STOPPED_SERVER_OPTIONS = [ const STARTED_SERVER_OPTIONS = [ { label: "Ruby LSP: Stop", description: Command.Stop }, { label: "Ruby LSP: Restart", description: Command.Restart }, + { + label: "Ruby LSP: Open server changelog in browser", + description: Command.ShowServerChangelog, + }, ]; export abstract class StatusItem {