From 3dcbf4fcbb95ff9a6cb50b6f07b9521a5771e848 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 9 Feb 2026 00:22:19 +0100 Subject: [PATCH] Change CancelParams.Id's type to json.Number Need to handle both integer and string according to spec. --- lifecycle.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lifecycle.go b/lifecycle.go index 7bac520..cdcd170 100644 --- a/lifecycle.go +++ b/lifecycle.go @@ -1,5 +1,7 @@ package protocol +import "encoding/json" + const ( MethodInitialize = "initialize" @@ -69,7 +71,7 @@ type InitializeResult struct { // // See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#cancelRequest type CancelParams struct { - Id string `json:"id"` + Id json.Number `json:"id"` } // TraceValue - The LSP allows the client to control the tracing of the server.