Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ahoppen opened this issue Jun 4, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@ahoppen
Copy link
Member

ahoppen commented Jun 4, 2024

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 ahoppen added the enhancement New feature or request label Jun 4, 2024
@ahoppen
Copy link
Member Author

ahoppen commented Jun 4, 2024

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

@ahoppen
Copy link
Member Author

ahoppen commented Jun 8, 2024

We should be able to do this by

  • Reading Context.gitInformation?.currentCommit in the package manifest
  • Passing that information into a C modules using -D
  • Calling a function in the C modules to return the info

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant