summaryrefslogtreecommitdiff
path: root/internal/lsp/debounce_throttle_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/lsp/debounce_throttle_test.go')
-rw-r--r--internal/lsp/debounce_throttle_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/lsp/debounce_throttle_test.go b/internal/lsp/debounce_throttle_test.go
index 7efd439..d02bdb8 100644
--- a/internal/lsp/debounce_throttle_test.go
+++ b/internal/lsp/debounce_throttle_test.go
@@ -21,7 +21,7 @@ func (t *timeLLM) DefaultModel() string { return "m" }
func TestCompletionDebounce_WaitsUntilQuiet(t *testing.T) {
s := newTestServer()
- s.compCache = make(map[string]string)
+ s.completion.compCache = make(map[string]string)
cfg := s.cfg
cfg.TriggerCharacters = []string{".", ":", "/", "_"}
cfg.MaxTokens = 32
@@ -37,7 +37,7 @@ func TestCompletionDebounce_WaitsUntilQuiet(t *testing.T) {
p.Context = json.RawMessage([]byte(`{"triggerKind":1}`))
start := time.Now()
- _, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, "")
+ _, ok, _ := s.completion.tryLLMCompletion(p, "", line, "", "", "", false, "")
if !ok {
t.Fatalf("expected ok=true")
}
@@ -51,7 +51,7 @@ func TestCompletionDebounce_WaitsUntilQuiet(t *testing.T) {
func TestCompletionThrottle_SerializesCalls(t *testing.T) {
s := newTestServer()
- s.compCache = make(map[string]string)
+ s.completion.compCache = make(map[string]string)
cfg := s.cfg
cfg.TriggerCharacters = []string{".", ":", "/", "_"}
cfg.MaxTokens = 32
@@ -65,7 +65,7 @@ func TestCompletionThrottle_SerializesCalls(t *testing.T) {
p := CompletionParams{Position: Position{Line: 0, Character: len(line)}, TextDocument: TextDocumentIdentifier{URI: "file://throttle.go"}}
p.Context = json.RawMessage([]byte(`{"triggerKind":1}`))
start := time.Now()
- if _, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, ""); !ok {
+ if _, ok, _ := s.completion.tryLLMCompletion(p, "", line, "", "", "", false, ""); !ok {
t.Fatalf("first call expected ok=true")
}
if f1.t.IsZero() {
@@ -74,10 +74,10 @@ func TestCompletionThrottle_SerializesCalls(t *testing.T) {
// second call immediately after; should be delayed by ~interval.
// Clear cache to ensure we actually call the LLM again.
- s.compCache = make(map[string]string)
+ s.completion.compCache = make(map[string]string)
f2 := &timeLLM{}
s.llmClient = f2
- if _, ok, _ := s.tryLLMCompletion(p, "", line, "", "", "", false, ""); !ok {
+ if _, ok, _ := s.completion.tryLLMCompletion(p, "", line, "", "", "", false, ""); !ok {
t.Fatalf("second call expected ok=true")
}
if f2.t.IsZero() {