Commit 5780d2b
fix(analyzers): guard against KeyError for ignored files in second_pass
Files skipped by first_pass() via the ignore list are not added to
self.files, but second_pass() iterated the same files list and
dereferenced self.files[file_path] unconditionally. This would raise
KeyError for any ignored file.
Add a membership check before accessing self.files and reorder the
guards so both the membership check and NullLanguageServer skip happen
before dereferencing.
Addresses review comment: coderabbitai suggested adding a guard to
skip files not in self.files before indexing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent bbad52d commit 5780d2b
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
0 commit comments