Commit e52650b
fix(analyzer): resolve LSP CALLS edges on repos without a venv
The Python analyzer hardcoded `environment_path={path}/venv` when starting
jedi-language-server via multilspy. When the repo had no venv (the common
case for cloned codebases like sphinx, sympy, anything from SWE-bench),
jedi raised `InvalidPythonEnvironment` on every `request_definition()`
call. analyzer.resolve() then swallowed the exception silently and the
indexer produced a graph with DEFINES edges only — zero CALLS, zero
EXTENDS. Benchmark validation showed sphinx (5K functions) and sympy
(41K functions) had no resolved cross-references at all.
Fix:
- source_analyzer.py: prefer {repo}/venv, then {repo}/.venv, then fall
back to the host interpreter's environment (sys.executable's prefix)
so jedi always has a valid Python to introspect.
- analyzer.py: log resolve() failures at WARN with file/line context
instead of swallowing them silently, so the next regression is loud.
Verified: re-indexed sphinx-doc/sphinx-9230 with the fix:
DEFINES: 5640, CALLS: 4931, EXTENDS: 484 (was DEFINES-only).
Fixes #685.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent b066064 commit e52650b
2 files changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
143 | 163 | | |
144 | 164 | | |
145 | 165 | | |
| |||
0 commit comments