summaryrefslogtreecommitdiff
path: root/internal/lsp/completion_messages_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/completion_messages_test.go
parentfb267966f7840df222338f57023273a993a73c9a (diff)
chore(version): bump to 0.6.0; configurable prompts via config + testsv0.6.0
Diffstat (limited to 'internal/lsp/completion_messages_test.go')
-rw-r--r--internal/lsp/completion_messages_test.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/internal/lsp/completion_messages_test.go b/internal/lsp/completion_messages_test.go
index 28908d5..37d4a8d 100644
--- a/internal/lsp/completion_messages_test.go
+++ b/internal/lsp/completion_messages_test.go
@@ -58,12 +58,16 @@ func TestBuildDocString_Contents(t *testing.T) {
}
}
-func TestBuildPrompts_InParams(t *testing.T) {
- p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x"}, Position: Position{Line: 0, Character: 5}}
- sys, user := buildPrompts(true, p, "a", "func f(x)", "c", "func f(x)")
- if !contains(sys, "function signatures") || !contains(user, "parameter list") {
- t.Fatalf("unexpected in-params prompts")
- }
+func TestBuildCompletionMessages_InParams_UsesParamPrompts(t *testing.T) {
+ s := newTestServer()
+ p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x"}, Position: Position{Line: 0, Character: 5}}
+ msgs := s.buildCompletionMessages(false, false, "", true, p, "a", "func f(x)", "c", "func f(x)")
+ if len(msgs) < 2 || msgs[0].Role != "system" || msgs[1].Role != "user" {
+ t.Fatalf("unexpected messages")
+ }
+ if !contains(msgs[0].Content, "function signatures") || !contains(msgs[1].Content, "parameter list") {
+ t.Fatalf("unexpected in-params prompts: %#v", msgs)
+ }
}
func TestPostProcessCompletion_CodeFencesAndDuplicates(t *testing.T) {