diff --git a/internal/lsp/protocol/tsprotocol.go b/internal/lsp/protocol/tsprotocol.go index eb640ef944..7436a7d338 100644 --- a/internal/lsp/protocol/tsprotocol.go +++ b/internal/lsp/protocol/tsprotocol.go @@ -674,7 +674,7 @@ type CompletionItem struct { * * @since 3.16.0 additional type `InsertReplaceEdit` - Proposed state */ - TextEdit interface{}/*TextEdit | InsertReplaceEdit*/ `json:"textEdit,omitempty"` + TextEdit *TextEdit/*TextEdit | InsertReplaceEdit*/ `json:"textEdit,omitempty"` /** * An optional array of additional [text edits](#TextEdit) that are applied when * selecting this completion. Edits must not overlap (including the same insert position) diff --git a/internal/lsp/tests/util.go b/internal/lsp/tests/util.go index 965eadcebd..924fbd550b 100644 --- a/internal/lsp/tests/util.go +++ b/internal/lsp/tests/util.go @@ -428,14 +428,14 @@ func CheckCompletionOrder(want, got []protocol.CompletionItem, strictScores bool func DiffSnippets(want string, got *protocol.CompletionItem) string { if want == "" { if got != nil { - x := got.TextEdit.(*protocol.TextEdit) + x := got.TextEdit return fmt.Sprintf("expected no snippet but got %s", x.NewText) } } else { if got == nil { return fmt.Sprintf("couldn't find completion matching %q", want) } - x := got.TextEdit.(*protocol.TextEdit) + x := got.TextEdit if want != x.NewText { return fmt.Sprintf("expected snippet %q, got %q", want, x.NewText) }