diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-29 00:22:39 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-29 00:22:39 +0300 |
| commit | 0c2994f0065090a4884b28dc27eb760db2dfaab3 (patch) | |
| tree | 687ecd00584feb634a5853f5964028621f0fa1d5 /internal/lsp/chat_trigger_suppression_test.go | |
| parent | d35aaa0227334ab0269b0907491c0682841b9cd5 (diff) | |
lsp: refactor dispatch to handler map; split handlers into feature files (completion, codeaction, init, document); decompose completion logic into small helpers; update review checklist
Diffstat (limited to 'internal/lsp/chat_trigger_suppression_test.go')
| -rw-r--r-- | internal/lsp/chat_trigger_suppression_test.go | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/internal/lsp/chat_trigger_suppression_test.go b/internal/lsp/chat_trigger_suppression_test.go index 197fbfb..55a5245 100644 --- a/internal/lsp/chat_trigger_suppression_test.go +++ b/internal/lsp/chat_trigger_suppression_test.go @@ -4,14 +4,17 @@ import "testing" // Ensure completion is suppressed when a chat trigger is at EOL (?>,!>,:>,;>) func TestCompletionSuppressedOnChatTriggerEOL(t *testing.T) { - s := &Server{ maxTokens: 32, triggerChars: []string{".", ":", "/", "_"}, compCache: make(map[string]string) } - s.llmClient = &countingLLM{} - tests := []string{"What now?>", "Explain!>", "Refactor:>", "note ;>"} - for i, line := range tests { - p := CompletionParams{ Position: Position{ Line: 0, Character: len(line) }, TextDocument: TextDocumentIdentifier{URI: "file://chat-suppr.go"} } - items, ok := s.tryLLMCompletion(p, "", line, "", "", "", false, "") - if !ok { t.Fatalf("case %d: expected ok=true", i) } - if len(items) != 0 { t.Fatalf("case %d: expected no completion items for EOL chat trigger", i) } - } + s := &Server{maxTokens: 32, triggerChars: []string{".", ":", "/", "_"}, compCache: make(map[string]string)} + s.llmClient = &countingLLM{} + tests := []string{"What now?>", "Explain!>", "Refactor:>", "note ;>"} + for i, line := range tests { + p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://chat-suppr.go"}} + items, ok := s.tryLLMCompletion(p, "", line, "", "", "", false, "") + if !ok { + t.Fatalf("case %d: expected ok=true", i) + } + if len(items) != 0 { + t.Fatalf("case %d: expected no completion items for EOL chat trigger", i) + } + } } - |
