summaryrefslogtreecommitdiff
path: root/internal/lsp/context.go
diff options
context:
space:
mode:
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)