diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-16 16:02:47 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-16 16:02:47 +0300 |
| commit | 2a7acf566f93a7d660e6909dc6a829e17fe76066 (patch) | |
| tree | 7c27a856d26cd9cf7325af6acec410be97a9162e /internal/lsp/context.go | |
| parent | 02cc0e3ac6c08f422f11b668c729102fcf0c7f38 (diff) | |
context: log when full-file/window context is skipped because document is not open; add -no-disk-io flag with HEXAI_NO_DISK_IO env; plumb through server
Diffstat (limited to 'internal/lsp/context.go')
| -rw-r--r-- | internal/lsp/context.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/lsp/context.go b/internal/lsp/context.go index c08a865..8b7ed67 100644 --- a/internal/lsp/context.go +++ b/internal/lsp/context.go @@ -33,6 +33,9 @@ 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) + } return "" } n := len(d.lines) @@ -52,6 +55,9 @@ 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) + } return "" } return truncateToApproxTokens(d.text, s.maxContextTokens) @@ -77,4 +83,3 @@ func truncateToApproxTokens(text string, maxTokens int) string { } return text[:cut] } - |
