From 5ac3113c64532e36440a6bf1a91ab1bb731be156 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 24 Apr 2023 13:16:06 +0100 Subject: [PATCH] protocol: Pull in gopls v0.9.5 tsprotocol.go --- internal/protocol/gen/gen.go | 5 +++-- internal/protocol/protocol.go | 12 ++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/internal/protocol/gen/gen.go b/internal/protocol/gen/gen.go index 675544c93..86f3dd344 100644 --- a/internal/protocol/gen/gen.go +++ b/internal/protocol/gen/gen.go @@ -1,6 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 +//go:build generate // +build generate package main @@ -15,7 +16,7 @@ import ( ) const ( - goplsRef = "gopls/v0.8.4" + goplsRef = "gopls/v0.9.5" urlFmt = "https://raw.githubusercontent.com/golang/tools" + "/%s/internal/lsp/protocol/tsprotocol.go" ) @@ -43,7 +44,7 @@ func main() { } if resp.StatusCode != 200 { - log.Fatalf("status code: %d", resp.StatusCode) + log.Fatalf("status code: %d (%s)", resp.StatusCode, url) } b, err := ioutil.ReadAll(resp.Body) diff --git a/internal/protocol/protocol.go b/internal/protocol/protocol.go index 647aabc2e..3a284bf45 100644 --- a/internal/protocol/protocol.go +++ b/internal/protocol/protocol.go @@ -2744,6 +2744,14 @@ type InlayHint = struct { * should fall back to a reasonable default. */ Kind InlayHintKind `json:"kind,omitempty"` + /** + * Optional text edits that are performed when accepting this inlay hint. + * + * *Note* that edits are expected to change the document so that the inlay + * hint (or its nearest variant) is now part of the document and the inlay + * hint itself is now obsolete. + */ + TextEdits []TextEdit `json:"textEdits,omitempty"` /** * The tooltip text when you hover over this item. */ @@ -2866,7 +2874,7 @@ type InlayHintParams struct { /** * The visible document range for which inlay hints should be computed. */ - ViewPort Range `json:"viewPort"` + Range Range `json:"range"` } /** @@ -2988,7 +2996,7 @@ type InlineValueParams struct { /** * The visible document range for which inline values should be computed. */ - ViewPort Range `json:"viewPort"` + Range Range `json:"range"` /** * Additional information about the context in which inline values were * requested.