diff options
| author | Paul Buetow <paul@buetow.org> | 2025-08-22 19:35:45 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-08-22 19:35:45 +0300 |
| commit | dcb0eaee01ddcb1fa931970df246764f09383c0d (patch) | |
| tree | 6b489d4954365ac9360828964163d473742d3fec | |
| parent | a04e510ee205c8f137636f0bd47263a64b047730 (diff) | |
lsp: suppress auto-trigger when line contains bare ';;' (no ';;text;') unless manual invoke; add explicit skip log
| -rw-r--r-- | internal/lsp/handlers.go | 6 |
1 files changed, 6 insertions, 0 deletions
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 { |
