From 3a0883816f8736f28a1f3f18e62c9ba02f7a25d3 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 19 Jun 2024 14:58:26 +0100 Subject: [PATCH] Implement `sourcekit-lsp --version` option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently `sourcekit-lsp --version` is an invalid option, which makes it harder to debug issues with SourceKit-LSP, as one can't even easily know which version is installed: ``` ❯ sourcekit-lsp --version Error: Unknown option '--version' ``` --- Sources/sourcekit-lsp/SourceKitLSP.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/sourcekit-lsp/SourceKitLSP.swift b/Sources/sourcekit-lsp/SourceKitLSP.swift index e3e4dbf5e..9ea0873ad 100644 --- a/Sources/sourcekit-lsp/SourceKitLSP.swift +++ b/Sources/sourcekit-lsp/SourceKitLSP.swift @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// import ArgumentParser +import struct Basics.SwiftVersion import Csourcekitd // Not needed here, but fixes debugging... import Diagnose import Dispatch @@ -103,6 +104,7 @@ extension SKSupport.WorkspaceType: @retroactive ExpressibleByArgument {} struct SourceKitLSP: AsyncParsableCommand { static let configuration = CommandConfiguration( abstract: "Language Server Protocol implementation for Swift and C-based languages", + version: "sourcekit-lsp \(Basics.SwiftVersion.current.displayString)", subcommands: [ DiagnoseCommand.self, DebugCommand.self,