Skip to content

Report the comline-core commit in --version and serverInfo - #125

Merged
Kinflou merged 3 commits into
masterfrom
feat/report-core-rev
Nov 15, 2026
Merged

Kinflou merged 3 commits into
masterfrom
feat/report-core-rev

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 15, 2026

Copy link
Copy Markdown
Member

For ComlineProject/comline-vscode#32: the extension bundles comline-lsp at a pinned rev and has no way to tell which comline-core that 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) prints comline-lsp 0.1.0 (core <40-hex sha>). It printed nothing special before: any argument started the stdio server.
  • serverInfo.version in the initialize result is the same text without the name: 0.1.0 (core <40-hex sha>). The extension reads the core commit from the running server's initialize result, 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 in serverInfo.version rather than capabilities.experimental because serverInfo is 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 in backend.rs.
  • Where the commit comes from. build.rs reads the #<sha> of the comline-core git source from Cargo.lock (the commit the build resolved), and exports it as COMLINE_CORE_REV. No dependency added. Cargo.lock isn't committed in this repo, and a build that doesn't see one (cargo install --git, a git dependency) would get unknown, so it falls back to the full rev in Cargo.toml's comline-core line, then to unknown. 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.rs runs on the host.

Tests

  • version::tests: CORE_REV is 40 hex and is the commit the manifest pins; the version string ends in (core <rev>). This fails if a future bump to Cargo.toml and the lock-derived value disagree.
  • tests/version.rs: runs the built comline-lsp for --version, and speaks initialize/shutdown/exit over stdio and checks serverInfo.

CI

Tests run in CI.

@Kinflou
Kinflou marked this pull request as ready for review November 15, 2026 20:31
@Kinflou
Kinflou merged commit c56715a into master Nov 15, 2026
21 checks passed
@Kinflou
Kinflou deleted the feat/report-core-rev branch November 15, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant