From 023ed82e612451caa38ec46106ed9d148ab9a595 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 8 Feb 2026 10:39:51 +0200 Subject: add gitignore-aware file filtering for LSP completions and code actions Files matching .gitignore patterns or user-configured extra patterns are now skipped for completions and code actions. Configurable via [ignore] section in config.toml with gitignore, extra_patterns, and lsp_notify_ignored options. Includes hot-reload support and env var overrides (HEXAI_IGNORE_*). Co-Authored-By: Claude Opus 4.6 --- internal/lsp/handlers_codeaction.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/lsp/handlers_codeaction.go') diff --git a/internal/lsp/handlers_codeaction.go b/internal/lsp/handlers_codeaction.go index 24429a1..4562954 100644 --- a/internal/lsp/handlers_codeaction.go +++ b/internal/lsp/handlers_codeaction.go @@ -22,6 +22,14 @@ func (s *Server) handleCodeAction(req Request) { } return } + // Skip code actions for gitignored / extra-pattern-ignored files + if ignored, reason := s.isFileIgnored(p.TextDocument.URI); ignored { + logging.Logf("lsp ", "code action skipped: file ignored (%s) uri=%s", reason, p.TextDocument.URI) + if len(req.ID) != 0 { + s.reply(req.ID, []CodeAction{}, nil) + } + return + } d := s.getDocument(p.TextDocument.URI) if d == nil || len(d.lines) == 0 || s.currentLLMClient() == nil { if len(req.ID) != 0 { -- cgit v1.2.3