From dcb0eaee01ddcb1fa931970df246764f09383c0d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 22 Aug 2025 19:35:45 +0300 Subject: lsp: suppress auto-trigger when line contains bare ';;' (no ';;text;') unless manual invoke; add explicit skip log --- internal/lsp/handlers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/lsp/handlers.go b/internal/lsp/handlers.go index f630eb5..987bcbe 100644 --- a/internal/lsp/handlers.go +++ b/internal/lsp/handlers.go @@ -742,6 +742,12 @@ func (s *Server) tryLLMCompletion(p CompletionParams, above, current, below, fun logging.AnsiGreen, logging.PreviewForLog(cleaned), logging.AnsiBase) return s.makeCompletionItems(cleaned, inParams, current, p, docStr), true, false } + // If there is a bare ';;' (no valid ';;text;'), do not auto-trigger unless it was a manual invoke. + if strings.Contains(current, ";;") && !hasDoubleSemicolonTrigger(current) && !manualInvoke { + logging.Logf("lsp ", "%scompletion skip=empty-double-semicolon line=%d char=%d current=%q%s", logging.AnsiYellow, p.Position.Line, p.Position.Character, trimLen(current), logging.AnsiBase) + return []CompletionItem{}, true, false + } + // Heuristic 1: Require a minimal typed identifier prefix to avoid early triggers, // but allow immediate completion after structural trigger chars like '.', ':', '/'. if !inParams { -- cgit v1.2.3