summaryrefslogtreecommitdiff
path: root/internal/lsp/helpers_more_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-06 11:57:45 +0300
committerPaul Buetow <paul@buetow.org>2025-09-06 11:57:45 +0300
commita48079fae6bb19d7c931f275901670cd5839ab5c (patch)
tree5788a3e8cac34ffca9d39b0c4b5df720e869b578 /internal/lsp/helpers_more_test.go
parentfb267966f7840df222338f57023273a993a73c9a (diff)
chore(version): bump to 0.6.0; configurable prompts via config + testsv0.6.0
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) {