summaryrefslogtreecommitdiff
path: root/internal/lsp/context.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-16 16:26:12 +0300
committerPaul Buetow <paul@buetow.org>2025-08-16 16:26:12 +0300
commit833bb66706dd991ecd3973da360c472d818e970a (patch)
tree62d8465b305883af1002063eb54ef38a08de299d /internal/lsp/context.go
parent148cda5f7ed4513528e3a46164b990708eeb1bc6 (diff)
logging: migrate LSP logs to global singleton (internal/logging); use consistent colors/prefix; refactor LLM provider to use global logger and remove per-client loggers
Diffstat (limited to 'internal/lsp/context.go')
-rw-r--r--internal/lsp/context.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/lsp/context.go b/internal/lsp/context.go
index 8b7ed67..8f345df 100644
--- a/internal/lsp/context.go
+++ b/internal/lsp/context.go
@@ -2,6 +2,7 @@ package lsp
import (
"strings"
+ "hexai/internal/logging"
)
// buildAdditionalContext builds extra context messages based on the configured mode.
@@ -33,9 +34,7 @@ func (s *Server) buildAdditionalContext(newFunc bool, uri string, pos Position)
func (s *Server) windowContext(uri string, pos Position) string {
d := s.getDocument(uri)
if d == nil || len(d.lines) == 0 {
- if s.logger != nil {
- s.logger.Printf("context: window requested but document not open; skipping uri=%s", uri)
- }
+ logging.Logf("lsp ", "context: window requested but document not open; skipping uri=%s", uri)
return ""
}
n := len(d.lines)
@@ -55,9 +54,7 @@ func (s *Server) windowContext(uri string, pos Position) string {
func (s *Server) fullFileContext(uri string) string {
d := s.getDocument(uri)
if d == nil {
- if s.logger != nil {
- s.logger.Printf("context: full-file requested but document not open; skipping uri=%s", uri)
- }
+ logging.Logf("lsp ", "context: full-file requested but document not open; skipping uri=%s", uri)
return ""
}
return truncateToApproxTokens(d.text, s.maxContextTokens)