From c3c71345db9086392cd9b7529c7f5287009c226e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 24 Sep 2025 23:21:43 +0300 Subject: Add runtime config store and reload command --- internal/lsp/codeaction_prompts_test.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'internal/lsp/codeaction_prompts_test.go') diff --git a/internal/lsp/codeaction_prompts_test.go b/internal/lsp/codeaction_prompts_test.go index bbfad10..c5fd5e2 100644 --- a/internal/lsp/codeaction_prompts_test.go +++ b/internal/lsp/codeaction_prompts_test.go @@ -9,8 +9,10 @@ func TestResolveCodeAction_UsesRewritePrompts(t *testing.T) { s := newTestServer() cap := &captureLLM{} s.llmClient = cap - s.promptRewriteSystem = "RSYS" - s.promptRewriteUser = "RUSER {{instruction}} {{selection}}" + cfg := s.cfg + cfg.PromptCodeActionRewriteSystem = "RSYS" + cfg.PromptCodeActionRewriteUser = "RUSER {{instruction}} {{selection}}" + s.cfg = cfg uri := "file:///x.go" s.setDocument(uri, "package p\nvar a=1\n") payload := struct { @@ -35,8 +37,10 @@ func TestResolveCodeAction_UsesDiagnosticsPrompts(t *testing.T) { s := newTestServer() cap := &captureLLM{} s.llmClient = cap - s.promptDiagnosticsSystem = "DSYS" - s.promptDiagnosticsUser = "DUSER {{diagnostics}} {{selection}}" + cfg := s.cfg + cfg.PromptCodeActionDiagnosticsSystem = "DSYS" + cfg.PromptCodeActionDiagnosticsUser = "DUSER {{diagnostics}} {{selection}}" + s.cfg = cfg uri := "file:///x.go" s.setDocument(uri, "package p\nvar a=1\n") payload := struct { @@ -64,8 +68,10 @@ func TestResolveCodeAction_UsesDocumentPrompts(t *testing.T) { s := newTestServer() cap := &captureLLM{} s.llmClient = cap - s.promptDocumentSystem = "DOCSYS" - s.promptDocumentUser = "DOCUSER {{selection}}" + cfg := s.cfg + cfg.PromptCodeActionDocumentSystem = "DOCSYS" + cfg.PromptCodeActionDocumentUser = "DOCUSER {{selection}}" + s.cfg = cfg uri := "file:///x.go" s.setDocument(uri, "package p\nvar a=1\n") payload := struct { @@ -89,8 +95,10 @@ func TestGenerateGoTest_UsesPrompts(t *testing.T) { s := newTestServer() cap := &captureLLM{} s.llmClient = cap - s.promptGoTestSystem = "GTSYS" - s.promptGoTestUser = "GTUSER {{function}}" + cfg := s.cfg + cfg.PromptCodeActionGoTestSystem = "GTSYS" + cfg.PromptCodeActionGoTestUser = "GTUSER {{function}}" + s.cfg = cfg _ = s.generateGoTestFunction("func Add(a,b int) int {return a+b}") if len(cap.msgs) < 2 { t.Fatalf("expected chat messages") -- cgit v1.2.3