Skip to content

fix(julia): emit imports for qualified, relative & scoped-selected forms - #1580

Closed
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/julia-qualified-relative-imports
Closed

fix(julia): emit imports for qualified, relative & scoped-selected forms#1580
Synvoya wants to merge 1 commit into
Graphify-Labs:v8from
Synvoya:fix/julia-qualified-relative-imports

Conversation

@Synvoya

@Synvoya Synvoya commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Julia imports beyond the bare form emit no edge:

using Base.Threads              # qualified  -> dropped
using ..Sibling                 # relative   -> dropped
import Base.Threads: nthreads   # scoped pkg -> pointed at `nthreads`, not the module
using Foo                       # simple     -> OK

Root cause

The using_statement/import_statement handler only matched bare identifier children. tree-sitter-julia represents qualified paths as scoped_identifier, relative paths as import_path, and the package inside a selected_import may itself be a scoped_identifier — none of which were handled.

Fix

Resolve the module name from identifier / scoped_identifier / import_path in all three positions (top-level child and selected-import package).

Verification

  • All 3 dropped forms now emit; using Foo / import Bar: baz unchanged.
  • Added fixture lines + a regression test.
  • pytest tests/test_languages.py tests/test_multilang.py passes; ruff clean.

… forms

Only bare-identifier imports (`using Foo`) emitted edges. tree-sitter-julia
wraps qualified paths in `scoped_identifier` (`using Base.Threads`), relative
paths in `import_path` (`using ..Sibling`), and the package of a
`selected_import` may itself be a `scoped_identifier`
(`import Base.Threads: nthreads`). None of those were matched, so qualified and
relative imports were silently dropped, and scoped selected-imports pointed at
the selected symbol instead of the module.

Resolve the module name from identifier / scoped_identifier / import_path in
all three positions. Adds fixture lines + a regression test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
safishamsi added a commit that referenced this pull request Jul 1, 2026
, #1582, #1583)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@safishamsi

Copy link
Copy Markdown
Collaborator

Merged into v8 as 984a6a8 (your authorship). Verified bare/qualified/relative/scoped-selected forms all emit and the single/selected forms are unchanged. Full suite 2777. Thanks!

@safishamsi safishamsi closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants