Skip to content

Commit 39083e0

Browse files
committed
initialize: return JETLS version in serverInfo
Use JETLS_VERSION in the initialize response's serverInfo field instead of the hardcoded "0.0.0". The client now logs the server version when the connection is established. Written by Claude
1 parent c78b71b commit 39083e0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

jetls-client/jetls-client.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,15 @@ async function startLanguageServer() {
474474
.start()
475475
.then(() => {
476476
statusBarItem.hide();
477-
outputChannel.appendLine("[jetls-client] JETLS is ready!");
477+
478+
const serverInfo = languageClient.initializeResult?.serverInfo;
479+
if (serverInfo) {
480+
outputChannel.appendLine(
481+
`[jetls-client] JETLS is ready! (${serverInfo.name} [version: ${serverInfo.version ?? "unknown"}])`,
482+
);
483+
} else {
484+
outputChannel.appendLine("[jetls-client] JETLS is ready!");
485+
}
478486

479487
// Register handler for workspace/configuration requests after client starts
480488
languageClient.onRequest(

src/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function handle_InitializeRequest(
212212
),
213213
serverInfo = (;
214214
name = "JETLS",
215-
version = "0.0.0"))
215+
version = JETLS_VERSION))
216216

217217
process_id = init_params.processId
218218
if !isnothing(process_id)

0 commit comments

Comments
 (0)