swiftlang / sourcekit-lsp

Language Server Protocol implementation for Swift and C-based languages
Apache License 2.0
3.3k stars 273 forks source link

Add a `sourcekit-lsp version` command that outputs the SourceKit-LSP version #1424

Open ahoppen opened 4 months ago

ahoppen commented 4 months ago

Ideally, this would output the corresponding Swift version (eg. 6.0) and the commit hash from which it was built. Maybe we can use a build plugin to get the commit hash and the Swift version from the current branch name.

ahoppen commented 4 months ago

Synced to Apple’s issue tracker as rdar://129223520

ahoppen commented 3 months ago

We should be able to do this by

Context.gitInformation?.currentCommit is only available with swift-tools-version 6.0, so we can only do this after we require Swift 6 (because I don’t want to have two different package manifests to maintain just for this feature).