Skip to content

feat(graph): add Julia language support (breadth tier) - #379

Open
itchyshin wants to merge 1 commit into
trailhq:mainfrom
itchyshin:feat/julia-breadth-tier
Open

itchyshin wants to merge 1 commit into
trailhq:mainfrom
itchyshin:feat/julia-breadth-tier

Conversation

@itchyshin

Copy link
Copy Markdown

feat(graph): add Julia language support (breadth tier)

Adds Julia to the breadth (generic tree-sitter) tier, following the Lua addition in #187: one registry row in src/graph/generic.ts plus src/graph/queries/julia.scm.

The bundled tree-sitter-wasm already ships tree-sitter-julia.wasm, but that grammar has no upstream tags.scm (only folds/highlights/indents/injections/locals), so the query is hand-written against its node vocabulary. call_expression / signature carry no named fields in this grammar, so patterns anchor on child position.

Captured

  • @definition.function: long form function f(x) … end, short form f(x) = …, qualified methods Base.show(io, x) = … / function Base.size(b) … end (last path segment is the name), where clauses in both forms, macro-annotated one-liners (@inline g(x) = x), bodiless function f end, and macro m(ex) … end.
  • @definition.struct / .type: struct, mutable struct, parametrised S{T}, <: Super, abstract type, primitive type.
  • @definition.module, @definition.constant (const K = 3).
  • @reference.call: plain, qualified (Mod.f(x)) and broadcast (f.(x)) calls. A call on the left of = is a definition, on the right a reference; the extractor's existing definition-name guard prevents self-loops.
  • @reference.class: the supertype in <: Super, so an abstract type that is only ever subtyped is not an orphan.

Tests

  • test/generic-extract.test.ts: .jl routes to julia; a snippet covering the constructs above yields the expected definitions and a resolved fit → helper call edge.
  • npx tsx --test test/generic-extract.test.ts test/supported-extensions.test.ts test/graph-languages.test.ts: 29/29 pass. Full npm test: 1216/1222 pass; the 5 failures (claude-shim-resolve ×4, graph-refresh lock-release ×1) fail identically on main in this environment.
  • Real repo: a 890-file Julia/R/Python package builds to 6,496 nodes / 9,487 edges in ~14 s; ask, callers and skeleton return correct file:line spans.

README language list and count updated (24).

🤖 Generated with Claude Code

One registry row plus a hand-written queries/julia.scm — the bundled
tree-sitter-julia grammar ships no tags.scm upstream. Covers long- and
short-form functions (incl. qualified Base.show and where clauses), macros,
struct / abstract / primitive types with supertype references, modules,
const, and plain / qualified / broadcast calls.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@trailhq-graft

trailhq-graft Bot commented Sep 13, 2026

Copy link
Copy Markdown

🌱 graft blast radius

1 area changed → 6 areas can be affected. 15 dependent symbols, depth 2.
Tag: @anirudhkumar-nanonets — 5 of 7 areas · @shhdwi — 5 of 7 areas · @Frankie-Xu — Context Building

flowchart TB
  A0(("Dependency Graph<br/>8 symbols"))
  A1(("Build Analysis<br/>2 symbols"))
  A2(("CLI Engine<br/>2 symbols"))
  A3(("Context Building<br/>1 symbol"))
  A4(("LSP Enrichment<br/>1 symbol"))
  AX(("1 smaller area<br/>1 symbol"))
  classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
  class A0,A1,A2,A3,A4 reached;
  classDef tail fill:#EEF2F3,stroke:#9AA4A9,stroke-width:1px,color:#3A4247;
  class AX tail;
Loading
Can be affected Symbols Nearest hop Reached from
Dependency Graph 8 src/graph/build.ts:L1-L411 build.ts — imports, depth 1 Generic Graph
Build Analysis 2 src/app/brain-build.ts:L1-L428 brain-build.ts — imports, depth 2 Generic Graph
CLI Engine 2 src/cli.ts:L1-L1407 cli.ts — imports, depth 2 Generic Graph
Context Building 1 src/context/build.ts:L1-L468 build.ts — imports, depth 2 Generic Graph
LSP Enrichment 1 src/graph/lsp/enrich.ts:L1-L141 enrich.ts — imports, depth 1 Generic Graph
MCP Tools 1 src/mcp/tools.ts:L1-L330 tools.ts — imports, depth 2 Generic Graph
Who knows this code — 3 people across 7 areas
Area Who knows it
Generic Graph · changed @shhdwi — 7 commits, last 1mo ago
Dependency Graph · affected @anirudhkumar-nanonets — 24 commits, last 17d ago · @shhdwi — 21 commits, last 1mo ago
Build Analysis · affected @anirudhkumar-nanonets — 9 commits, last 3d ago
CLI Engine · affected @anirudhkumar-nanonets — 41 commits, last 3d ago · @shhdwi — 24 commits, last 1mo ago
Context Building · affected @anirudhkumar-nanonets — 4 commits, last 24d ago · @Frankie-Xu — 2 commits, last 13d ago
LSP Enrichment · affected @shhdwi — 2 commits, last 1mo ago
MCP Tools · affected @shhdwi — 14 commits, last 1mo ago · @anirudhkumar-nanonets — 7 commits, last 11d ago

Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no @ has no GitHub handle in its commit email — tag them by hand, or add a .mailmap entry. A suggestion from history, not a CODEOWNERS rule.

All 15 dependent symbols, grouped by area

Dependency Graph — 8 symbols in 8 files

  • src/graph/build.ts:L1-L411 — build.ts (imports, depth 1)
    21: import { extractGeneric, genericLangOf, warmGenericGrammars } from "./generic.js";
  • src/graph/check.ts:L1-L221 — check.ts (imports, depth 1)
    24: import { extractGeneric, genericLangOf, warmGenericGrammars } from "./generic.js";
  • src/graph/container.ts:L1-L209 — container.ts (imports, depth 1)
    25: import { loadWasmLanguage, parseWasm, type TsNode } from "./generic.js";
  • src/graph/resolve.ts:L1-L658 — resolve.ts (imports, depth 1)
    19: import { genericLangOf } from "./generic.js";
  • src/graph/source-files.ts:L1-L121 — source-files.ts (imports, depth 1)
    15: import { genericLangOf, genericExtensions } from "./generic.js";
  • src/graph/fingerprint.ts:L1-L197 — fingerprint.ts (imports, depth 2)
  • src/graph/refresh.ts:L1-L274 — refresh.ts (imports, depth 2)
  • src/graph/workspace.ts:L1-L725 — workspace.ts (imports, depth 2)

Build Analysis — 2 symbols in 2 files

  • src/app/brain-build.ts:L1-L428 — brain-build.ts (imports, depth 2)
  • src/app/review.ts:L1-L174 — review.ts (imports, depth 2)

CLI Engine — 2 symbols in 2 files

  • src/cli.ts:L1-L1407 — cli.ts (imports, depth 2)
  • src/engine.ts:L1-L161 — engine.ts (imports, depth 2)

Context Building — 1 symbol in 1 file

  • src/context/build.ts:L1-L468 — build.ts (imports, depth 2)

LSP Enrichment — 1 symbol in 1 file

  • src/graph/lsp/enrich.ts:L1-L141 — enrich.ts (imports, depth 1)
    17: import { genericLangOf } from "../generic.js";

MCP Tools — 1 symbol in 1 file

  • src/mcp/tools.ts:L1-L330 — tools.ts (imports, depth 2)
Test signal per changed area — 1 –

Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.

  • Generic Graph — 1 test file changed here: test/generic-extract.test.ts
38 test suites also reference this code

38 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.

  • test/ask-index.test.ts
  • test/ask.test.ts
  • test/container-extract.test.ts
  • test/context-only-dir.test.ts
  • test/context.test.ts
  • test/covers.test.ts
  • test/generic-node24-probe.ts
  • test/graph-cross-language.test.ts
  • test/graph-enrich-pending.test.ts
  • test/graph-go.test.ts
  • test/graph-incremental.test.ts
  • test/graph-invariants.test.ts
  • test/graph-java.test.ts
  • test/graph-languages.test.ts
  • test/graph-php.test.ts
  • test/graph-posix-paths.test.ts
  • test/graph-python.test.ts
  • test/graph-r-classes.test.ts
  • test/graph-r-phase3.test.ts
  • test/graph-r-phase4.test.ts
  • …18 more

⚠️ 2 changed files not in the graph (README.md, src/graph/queries/julia.scm) — no parser claims the extension, or the index predates the file.

graft blast · origin/main...HEAD · depth 2 · 4 changed files

Open the interactive graph → — click an area to see its dependent symbols at file:line.

github-actions Bot added a commit that referenced this pull request Sep 13, 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.

1 participant