diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-08 10:39:51 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-08 10:39:51 +0200 |
| commit | 023ed82e612451caa38ec46106ed9d148ab9a595 (patch) | |
| tree | d482cc965a65be22604800fe6772279c52961b99 /internal/lsp/handlers_codeaction.go | |
| parent | 80808d42c257823feb873f80d06b325430c9350e (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'internal/lsp/handlers_codeaction.go')
| -rw-r--r-- | internal/lsp/handlers_codeaction.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |
