summaryrefslogtreecommitdiff
path: root/internal/lsp/completion_prefix_strip_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-10-03 23:50:49 +0300
committerPaul Buetow <paul@buetow.org>2025-10-03 23:50:49 +0300
commit420b5aebf888c638ac096e1476c06eac979ac257 (patch)
tree59434cbc37837399d7b5bc7920ffd7be62f1fc7d /internal/lsp/completion_prefix_strip_test.go
parente36a5446bc62842ae3b3e165f66fecb7285a8c6a (diff)
Switch inline prompt markers to >! prefixv0.15.1
Diffstat (limited to 'internal/lsp/completion_prefix_strip_test.go')
-rw-r--r--internal/lsp/completion_prefix_strip_test.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/lsp/completion_prefix_strip_test.go b/internal/lsp/completion_prefix_strip_test.go
index e0c655c..c8e2bd7 100644
--- a/internal/lsp/completion_prefix_strip_test.go
+++ b/internal/lsp/completion_prefix_strip_test.go
@@ -69,12 +69,12 @@ func TestTryLLMCompletion_InlinePromptAlwaysTriggers(t *testing.T) {
cfg.TriggerCharacters = []string{".", ":", "/", "_"}
s.cfg = cfg
s.llmClient = fakeLLM{resp: "replacement"}
- line := "prefix >do something> suffix"
+ line := "prefix >!do something> suffix"
// No trigger char immediately before cursor; place cursor at end
p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://inline.go"}}
items, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, "")
if !ok || len(items) == 0 {
- t.Fatalf("expected completion to trigger on inline >text> prompt")
+ t.Fatalf("expected completion to trigger on inline >!text> prompt")
}
}
@@ -87,7 +87,7 @@ func TestTryLLMCompletion_DoubleOpenEmpty_DoesNotAutoTrigger(t *testing.T) {
s.cfg = cfg
fake := &countingLLM{}
s.llmClient = fake
- line := ">> " // empty content after double-open should not force-trigger
+ line := ">>! " // empty content after double-open should not force-trigger
p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://empty-inline.go"}}
items, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, "")
if !ok {
@@ -102,16 +102,16 @@ func TestTryLLMCompletion_DoubleOpenEmpty_DoesNotAutoTrigger(t *testing.T) {
}
func TestHasDoubleSemicolonTrigger_Variants(t *testing.T) {
- if hasDoubleOpenTrigger(">>", '>', '>') {
+ if hasDoubleOpenTrigger(">>!", ">!", '>', '>') {
t.Fatalf("bare double-open should not trigger")
}
- if hasDoubleOpenTrigger(">> ", '>', '>') {
+ if hasDoubleOpenTrigger(">>! ", ">!", '>', '>') {
t.Fatalf("double-open followed by space should not trigger")
}
- if hasDoubleOpenTrigger(">>>", '>', '>') {
+ if hasDoubleOpenTrigger(">>!>", ">!", '>', '>') {
t.Fatalf("';;;' should not trigger (no content)")
}
- if !hasDoubleOpenTrigger(">>x>", '>', '>') {
+ if !hasDoubleOpenTrigger(">>!x>", ">!", '>', '>') {
t.Fatalf("expected trigger for ';;x;' pattern")
}
}
@@ -126,7 +126,7 @@ func TestBareDoubleOpenPreventsAutoTriggerEvenWithOtherTriggers(t *testing.T) {
fake := &countingLLM{}
s.llmClient = fake
// Place a '.' earlier but also include bare double-open at end; should not auto-trigger
- line := "obj. call >>"
+ line := "obj. call >>!"
p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://bare-ds.go"}}
items, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, "")
if !ok {
@@ -150,7 +150,7 @@ func TestBareDoubleOpenOnNextLine_PreventsAutoTrigger(t *testing.T) {
fake := &countingLLM{}
s.llmClient = fake
current := "expression := flag.String(\"expression\", \"\", \"Expression to evaluate\")"
- below := ">>"
+ below := ">>!"
p := CompletionParams{Position: Position{Line: 0, Character: len(current)}, TextDocument: TextDocumentIdentifier{URI: "file://nextline.go"}}
items, ok, _ := s.tryLLMCompletion(p, "", current, below, "", "", false, "")
if !ok {
@@ -173,7 +173,7 @@ func TestBareDoubleOpenPreventsManualInvoke(t *testing.T) {
s.cfg = cfg
fake := &countingLLM{}
s.llmClient = fake
- line := ">>"
+ line := ">>!"
p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://bare-ds-manual.go"}}
// Simulate manual invoke
p.Context = json.RawMessage([]byte(`{"triggerKind":1}`))