diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-02 14:01:16 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-02 14:01:16 +0200 |
| commit | 4649658bd71c4754dc5dde2fb5e1f4de2fe269d4 (patch) | |
| tree | fe4fe689d7b6c926f171f59bdbb2a96a3d2b91f8 /internal/lsp/context_test.go | |
| parent | 5cc418a450212fa9d4402825d4cda31c7f109ca3 (diff) | |
lsp: use context-mode registry for additional context dispatch (task 408)
Diffstat (limited to 'internal/lsp/context_test.go')
| -rw-r--r-- | internal/lsp/context_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/lsp/context_test.go b/internal/lsp/context_test.go index 875eec9..fd555cf 100644 --- a/internal/lsp/context_test.go +++ b/internal/lsp/context_test.go @@ -61,6 +61,14 @@ func TestBuildAdditionalContext_AlwaysFull(t *testing.T) { } } +func TestBuildAdditionalContext_UnknownModeFallsBackToMinimal(t *testing.T) { + s := newTestServer() + s.cfg.ContextMode = "unknown-mode" + if ctx, ok := s.buildAdditionalContext(false, "file:///x.go", Position{}); ok || ctx != "" { + t.Fatalf("expected no context for unknown mode; got ok=%v ctx=%q", ok, ctx) + } +} + func TestTruncateToApproxTokens(t *testing.T) { text := strings.Repeat("abcd", 10) // 40 chars got := truncateToApproxTokens(text, 5) // ~20 chars |
