Repository navigation
Report the comline-core commit in --version and serverInfo - #125
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For ComlineProject/comline-vscode#32: the extension bundles
comline-lspat a pinned rev and has no way to tell whichcomline-corethat server was built with, so it can't notice when the server and the CLI disagree (the stale-pin case in #32). The server now says.What changes
comline-lsp --version(and-V) printscomline-lsp 0.1.0 (core <40-hex sha>). It printed nothing special before: any argument started the stdio server.serverInfo.versionin theinitializeresult is the same text without the name:0.1.0 (core <40-hex sha>). The extension reads the core commit from the running server'sinitializeresult, with no second process. The full sha is in the string (not a short one) so that the extension has one pattern for the server and for the CLI's--version:core ([0-9a-f]{40}). I kept it inserverInfo.versionrather thancapabilities.experimentalbecauseserverInfois what clients already surface (logs, the output channel) and no custom field needs documenting. If you prefer a dedicated field, it is a one-line change inbackend.rs.build.rsreads the#<sha>of thecomline-coregit source fromCargo.lock(the commit the build resolved), and exports it asCOMLINE_CORE_REV. No dependency added.Cargo.lockisn't committed in this repo, and a build that doesn't see one (cargo install --git, a git dependency) would getunknown, so it falls back to the fullrevinCargo.toml'scomline-coreline, then tounknown. In CI and in the extension's release build, the manifest fallback and the lock agree.comline_language_server::version(CORE_REV,server_version()), in the always-built library, so the wasm build links it too;build.rsruns on the host.Tests
version::tests:CORE_REVis 40 hex and is the commit the manifest pins; the version string ends in(core <rev>). This fails if a future bump toCargo.tomland the lock-derived value disagree.tests/version.rs: runs the builtcomline-lspfor--version, and speaksinitialize/shutdown/exitover stdio and checksserverInfo.CI
Tests run in CI.