From 904988e3a417b2d3adb88c749429e8685bb346d0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 19 Aug 2025 22:53:11 +0300 Subject: 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 --- internal/lsp/handlers.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/lsp') 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) -- cgit v1.2.3