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/context.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/lsp/context.go') diff --git a/internal/lsp/context.go b/internal/lsp/context.go index 5a4983c..8b584fb 100644 --- a/internal/lsp/context.go +++ b/internal/lsp/context.go @@ -14,7 +14,7 @@ import ( // - file-on-new-func: include full file only when defining a new function // - always-full: always include the full file func (s *Server) buildAdditionalContext(newFunc bool, uri string, pos Position) (string, bool) { - mode := s.contextMode + mode := s.contextMode() switch mode { case "minimal": return "", false @@ -40,7 +40,7 @@ func (s *Server) windowContext(uri string, pos Position) string { return "" } n := len(d.lines) - half := s.windowLines / 2 + half := s.windowLines() / 2 start := pos.Line - half if start < 0 { start = 0 @@ -50,7 +50,7 @@ func (s *Server) windowContext(uri string, pos Position) string { end = n } text := strings.Join(d.lines[start:end], "\n") - return truncateToApproxTokens(text, s.maxContextTokens) + return truncateToApproxTokens(text, s.maxContextTokens()) } func (s *Server) fullFileContext(uri string) string { @@ -59,7 +59,7 @@ func (s *Server) fullFileContext(uri string) string { logging.Logf("lsp ", "context: full-file requested but document not open; skipping uri=%s", uri) return "" } - return truncateToApproxTokens(d.text, s.maxContextTokens) + return truncateToApproxTokens(d.text, s.maxContextTokens()) } // truncateToApproxTokens naively truncates the input to fit approx N tokens. -- cgit v1.2.3