diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-28 23:39:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-28 23:39:23 +0300 |
| commit | 1e5718bc44064481d33a0fc3247c345305d3ba86 (patch) | |
| tree | 7b6b32153331492eb19b522f3e05fc690ded508b /internal/lsp/chat_trigger_suppression_test.go | |
| parent | 86aafe22eaf04687288e5a730acf0a473719c514 (diff) | |
lsp: switch in-editor chat triggers to ?> !> :> ;> and suppress normal completion on EOL chat trigger; keep ;;text; inline trigger unchanged; update docs and tests
Diffstat (limited to 'internal/lsp/chat_trigger_suppression_test.go')
| -rw-r--r-- | internal/lsp/chat_trigger_suppression_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/lsp/chat_trigger_suppression_test.go b/internal/lsp/chat_trigger_suppression_test.go new file mode 100644 index 0000000..197fbfb --- /dev/null +++ b/internal/lsp/chat_trigger_suppression_test.go @@ -0,0 +1,17 @@ +package lsp + +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) } + } +} + |
