From 89d3a7a0cc7b617a4de415f1046df8a6f2150136 Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Wed, 5 Jun 2024 14:55:14 +0100 Subject: [PATCH] lsp/completions: Drop period from input new text (#799) This is not consistent with other completions Signed-off-by: Charlie Egan --- internal/lsp/completions/providers/input.go | 2 +- internal/lsp/completions/providers/input_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/lsp/completions/providers/input.go b/internal/lsp/completions/providers/input.go index 56ba5611..84b12834 100644 --- a/internal/lsp/completions/providers/input.go +++ b/internal/lsp/completions/providers/input.go @@ -58,7 +58,7 @@ You can also experiment with input in the [Rego Playground](https://play.openpol Line: params.Position.Line, Character: params.Position.Character, }, }, - NewText: "input.", + NewText: "input", }, }) } diff --git a/internal/lsp/completions/providers/input_test.go b/internal/lsp/completions/providers/input_test.go index 7f4df66d..3a579ad8 100644 --- a/internal/lsp/completions/providers/input_test.go +++ b/internal/lsp/completions/providers/input_test.go @@ -44,4 +44,8 @@ allow if i` if labels[0] != "input" { t.Fatalf("Expected 'input' completion, got: %v", labels[0]) } + + if exp, got := "input", completions[0].TextEdit.NewText; exp != got { + t.Fatalf("Expected '%s' as new text, got: %s", exp, got) + } }