diff options
| author | Paul Buetow <paul@buetow.org> | 2025-09-26 19:34:19 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-09-26 19:34:19 +0300 |
| commit | 0583b360ceb606b8e58f12a17f588bd27feeb117 (patch) | |
| tree | ae8ac0d7968a409a76d18d84e080d02da52ce775 /internal/lsp/provider_native_success_test.go | |
| parent | 869c018a7a26285263cf7692f25f6aa44e2635c9 (diff) | |
Add per-surface provider overrides and wiring
Diffstat (limited to 'internal/lsp/provider_native_success_test.go')
| -rw-r--r-- | internal/lsp/provider_native_success_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/lsp/provider_native_success_test.go b/internal/lsp/provider_native_success_test.go index 6df5698..aab886c 100644 --- a/internal/lsp/provider_native_success_test.go +++ b/internal/lsp/provider_native_success_test.go @@ -21,10 +21,11 @@ func (fakeCompleterOk) CodeCompletion(context.Context, string, string, int, stri func TestProviderNativeCompletion_Success(t *testing.T) { s := newTestServer() s.llmClient = fakeCompleterOk{} + spec := s.buildRequestSpec(surfaceCompletion) // current line with dot trigger; position after dot current := "fmt." p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x.go"}, Position: Position{Line: 0, Character: len(current)}} - items, ok := s.tryProviderNativeCompletion(current, p, "", "", "func f(){}", "doc", false, "", false) + items, ok := s.tryProviderNativeCompletion(spec, s.llmClient, current, p, "", "", "func f(){}", "doc", false, "", false) if !ok || len(items) == 0 { t.Fatalf("expected provider-native items") } @@ -47,9 +48,10 @@ func (fakeCompleterIndent) CodeCompletion(context.Context, string, string, int, func TestProviderNativeCompletion_IndentWithDoubleOpen(t *testing.T) { s := newTestServer() s.llmClient = fakeCompleterIndent{} + spec := s.buildRequestSpec(surfaceCompletion) current := " >>do>" // leading indent + double-open marker p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: "file:///x.go"}, Position: Position{Line: 0, Character: len(current)}} - items, ok := s.tryProviderNativeCompletion(current, p, "", "", "func f(){}", "doc", false, "", false) + items, ok := s.tryProviderNativeCompletion(spec, s.llmClient, current, p, "", "", "func f(){}", "doc", false, "", false) if !ok || len(items) == 0 { t.Fatalf("expected provider-native items") } @@ -80,12 +82,13 @@ func TestProviderNativeCompletion_UsesPromptTemplate(t *testing.T) { cfg := s.cfg cfg.PromptNativeCompletion = "NATIVE {{path}} {{before}}" s.cfg = cfg + spec := s.buildRequestSpec(surfaceCompletion) uri := "file:///x.go" s.setDocument(uri, "AAA\nBBB\nCCC") current := "fmt." // Cursor at line 1, char 1 -> before should be "AAA\nB" p := CompletionParams{TextDocument: TextDocumentIdentifier{URI: uri}, Position: Position{Line: 1, Character: 1}} - if _, ok := s.tryProviderNativeCompletion(current, p, "", "", "func f(){}", "doc", false, "", false); !ok { + if _, ok := s.tryProviderNativeCompletion(spec, s.llmClient, current, p, "", "", "func f(){}", "doc", false, "", false); !ok { t.Fatalf("expected provider-native path") } if cap.lastPrompt == "" { |
