summaryrefslogtreecommitdiff
path: root/internal/lsp
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-19 22:53:11 +0300
committerPaul Buetow <paul@buetow.org>2025-08-19 22:53:11 +0300
commit904988e3a417b2d3adb88c749429e8685bb346d0 (patch)
tree7e4953b0acf3e656c20354a3f3b94565b9bcdee8 /internal/lsp
parent8fa3c76907c3e99e75c5828d9b5642646c81205c (diff)
logging: highlight LLM no-op skips in yellow\n\n- Add AnsiYellow to logging utilities\n- Colorize skip logs (no-trigger, short-prefix, busy) in hexai-lsp logs
Diffstat (limited to 'internal/lsp')
-rw-r--r--internal/lsp/handlers.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/lsp/handlers.go b/internal/lsp/handlers.go
index 5d2201f..45eaec0 100644
--- a/internal/lsp/handlers.go
+++ b/internal/lsp/handlers.go
@@ -453,7 +453,7 @@ func (s *Server) tryLLMCompletion(p CompletionParams, above, current, below, fun
// Only invoke LLM when triggered by one of our trigger characters.
if !s.isTriggerEvent(p, current) {
- logging.Logf("lsp ", "completion skip=no-trigger line=%d char=%d current=%q", p.Position.Line, p.Position.Character, trimLen(current))
+ logging.Logf("lsp ", "%scompletion skip=no-trigger line=%d char=%d current=%q%s", logging.AnsiYellow, p.Position.Line, p.Position.Character, trimLen(current), logging.AnsiBase)
return []CompletionItem{}, true
}
@@ -484,14 +484,14 @@ func (s *Server) tryLLMCompletion(p CompletionParams, above, current, below, fun
}
start := computeWordStart(current, j)
if j-start < 1 { // require at least 1 identifier char
- logging.Logf("lsp ", "completion skip=short-prefix line=%d char=%d current=%q", p.Position.Line, p.Position.Character, trimLen(current))
+ logging.Logf("lsp ", "%scompletion skip=short-prefix line=%d char=%d current=%q%s", logging.AnsiYellow, p.Position.Line, p.Position.Character, trimLen(current), logging.AnsiBase)
return []CompletionItem{}, true
}
}
}
// Concurrency guard: if another LLM request is running, skip this one.
if !s.tryStartLLM() {
- logging.Logf("lsp ", "completion skip=busy another LLM request in flight")
+ logging.Logf("lsp ", "%scompletion skip=busy another LLM request in flight%s", logging.AnsiYellow, logging.AnsiBase)
return []CompletionItem{}, true
}
sysPrompt, userPrompt := buildPrompts(inParams, p, above, current, below, funcCtx)