From 4649658bd71c4754dc5dde2fb5e1f4de2fe269d4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 2 Mar 2026 14:01:16 +0200 Subject: lsp: use context-mode registry for additional context dispatch (task 408) --- internal/lsp/context_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/lsp/context_test.go') 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 -- cgit v1.2.3