summaryrefslogtreecommitdiff
path: root/internal/lsp/context_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-24 23:21:43 +0300
committerPaul Buetow <paul@buetow.org>2025-09-24 23:21:43 +0300
commitc3c71345db9086392cd9b7529c7f5287009c226e (patch)
treed227894ab900d6050cbe1418984526088a692db5 /internal/lsp/context_test.go
parent127844a4ee481590ef53b6777d34bf2114cb3ab1 (diff)
Add runtime config store and reload command
Diffstat (limited to 'internal/lsp/context_test.go')
-rw-r--r--internal/lsp/context_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/lsp/context_test.go b/internal/lsp/context_test.go
index dcda042..875eec9 100644
--- a/internal/lsp/context_test.go
+++ b/internal/lsp/context_test.go
@@ -9,8 +9,8 @@ import (
func TestWindowContext_Bounds(t *testing.T) {
s := newTestServer()
- s.windowLines = 4 // half=2
- s.maxContextTokens = 9999
+ s.cfg.ContextWindowLines = 4 // half=2
+ s.cfg.MaxContextTokens = 9999
lines := make([]string, 10)
for i := 0; i < 10; i++ {
lines[i] = "L" + strconv.Itoa(i)
@@ -28,7 +28,7 @@ func TestWindowContext_Bounds(t *testing.T) {
func TestBuildAdditionalContext_Minimal(t *testing.T) {
s := newTestServer()
- s.contextMode = "minimal"
+ s.cfg.ContextMode = "minimal"
if ctx, ok := s.buildAdditionalContext(false, "file:///x.go", Position{}); ok || ctx != "" {
t.Fatalf("expected no context in minimal mode; got ok=%v ctx=%q", ok, ctx)
}
@@ -36,8 +36,8 @@ func TestBuildAdditionalContext_Minimal(t *testing.T) {
func TestBuildAdditionalContext_FileOnNewFunc(t *testing.T) {
s := newTestServer()
- s.contextMode = "file-on-new-func"
- s.maxContextTokens = 9999
+ s.cfg.ContextMode = "file-on-new-func"
+ s.cfg.MaxContextTokens = 9999
uri := "file:///x.go"
body := "package x\n\nfunc a(){}\n"
s.setDocument(uri, body)
@@ -51,8 +51,8 @@ func TestBuildAdditionalContext_FileOnNewFunc(t *testing.T) {
func TestBuildAdditionalContext_AlwaysFull(t *testing.T) {
s := newTestServer()
- s.contextMode = "always-full"
- s.maxContextTokens = 9999
+ s.cfg.ContextMode = "always-full"
+ s.cfg.MaxContextTokens = 9999
uri := "file:///x.go"
body := "line1\nline2\n"
s.setDocument(uri, body)