You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SymbolTableBuilder crashes on relative project_dir: eager relative_to() in _add_class next() default #90
Pre-existing bug on main (verified byte-identical at 2cab542), discovered while verifying the #80 fix branch: constructing SymbolTableBuilder with a relativeproject_dir crashes analysis of any file containing a class.
Symptom
SymbolTableBuilder(Path("test/fixtures/single_functionalities/method_call_resolution"), None) \
.build_pymodule_from_file(Path("test/fixtures/.../main.py"))
# ValueError: '/abs/path/.../main.py' is not in the subpath of 'test/fixtures/...'
Root cause
In _add_class (codeanalyzer/syntactic_analysis/symbol_table_builder.py:202-209 on main), the Jedi-goto fallback signature is passed as next()'s default argument, so it is computed eagerly even when Jedi succeeds:
script.path is always absolute (Jedi resolves it), so relative_to(self.project_dir) raises ValueError whenever project_dir is relative. The except Exception handler below doesn't save it: it recomputes the identical expression and raises uncaught.
Fix direction
Normalize once in __init__: self.project_dir = Path(project_dir).resolve(). (Alternatively make the fallback lazy, but resolving at the boundary fixes every downstream relative_to in one place, including _callables.) Regression test: build a module via a builder constructed with a relative path.
Every current in-repo caller happens to pass resolved paths (e.g. test/conftest.py fixtures), which is why the suite never hits it — library consumers won't be so lucky.
Activity
Merge pull request #92 from codellm-devkit/fix/issue-90-rescue-to-main