summaryrefslogtreecommitdiff
path: root/internal/lsp/helpers_more_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lsp/helpers_more_test.go')
-rw-r--r--internal/lsp/helpers_more_test.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/internal/lsp/helpers_more_test.go b/internal/lsp/helpers_more_test.go
index a0b0c26..1bd56d0 100644
--- a/internal/lsp/helpers_more_test.go
+++ b/internal/lsp/helpers_more_test.go
@@ -101,16 +101,17 @@ func TestCollectPromptRemovalEdits_MultiLine(t *testing.T) {
}
}
-func TestInParamListAndBuildPrompts(t *testing.T) {
- cur := "func add(a int, b string) int"
- if !inParamList(cur, 12) {
- t.Fatalf("expected in param list")
- }
- p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x.go"}, Position: Position{Line: 0, Character: 5}}
- sys, user := buildPrompts(false, p, "above", "current", "below", "func add")
- if sys == "" || user == "" {
- t.Fatalf("prompts empty")
- }
+func TestInParamListAndBuildCompletionMessages(t *testing.T) {
+ cur := "func add(a int, b string) int"
+ if !inParamList(cur, 12) {
+ t.Fatalf("expected in param list")
+ }
+ s := newTestServer()
+ p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x.go"}, Position: Position{Line: 0, Character: 5}}
+ msgs := s.buildCompletionMessages(false, false, "", false, p, "above", "current", "below", "func add")
+ if len(msgs) < 2 || msgs[0].Content == "" || msgs[1].Content == "" {
+ t.Fatalf("messages empty")
+ }
}
func TestLabelForCompletion(t *testing.T) {