Skip to content

add support for Julia#244

Open
kongdd wants to merge 2 commits into
colbymchenry:mainfrom
kongdd:julia
Open

add support for Julia#244
kongdd wants to merge 2 commits into
colbymchenry:mainfrom
kongdd:julia

Conversation

@kongdd
Copy link
Copy Markdown

@kongdd kongdd commented May 21, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 21, 2026 08:39
@kongdd kongdd changed the title add julia support add support for Julia May 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Julia language support to the extraction pipeline by registering a Julia tree-sitter grammar, adding a Julia-specific extractor, and extending the extractor API with name/body resolution hooks.

Changes:

  • Add julia to supported language lists, extension map (.jl), display names, and extractor registry.
  • Introduce getName hook and use resolveBody in the generic tree-sitter extractor to support languages whose AST doesn’t expose standard fields.
  • Add Julia extractor implementation plus Jest tests covering detection and core extraction behavior.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types.ts Adds julia to the language union/list.
src/extraction/tree-sitter.ts Adds a getName hook path and uses resolveBody before default body lookup.
src/extraction/tree-sitter-types.ts Extends LanguageExtractor with getName hook.
src/extraction/languages/julia.ts Implements Julia-specific name/signature/body/import extraction.
src/extraction/languages/index.ts Registers juliaExtractor.
src/extraction/grammars.ts Registers Julia wasm + .jl extension + display name; loads wasm from local wasm dir.
tests/extraction.test.ts Adds Julia detection and extraction tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Language-specific name extraction hook
if (extractor.getName) {
const customName = extractor.getName(node, source);
if (customName !== null) return customName || '<anonymous>';
@@ -126,7 +128,7 @@ export async function loadGrammarsForLanguages(languages: Language[]): Promise<v
const wasmFile = WASM_GRAMMAR_FILES[lang];
try {
// Pascal and Scala ship their own WASMs (not in tree-sitter-wasms)
Comment on lines +125 to +126
* When provided, replaces the default `nameField`-based lookup in `extractName`.
* Return null to fall back to the default logic.
@20261688fafa-commits
Copy link
Copy Markdown

I've got a really tough problem right now! I'm looking for someone who can help me solve it, and I'm ready to pay a generous reward! If you can handle it, please follow me and reach out!

hexu2 pushed a commit to hexu2/codegraph that referenced this pull request May 22, 2026
Extends the approach in colbymchenry#244 (@kongdd) with fixes for common Julia 1.11
AST shapes in real-world packages:

- Add getName hook and use resolveBody for structs without block wrappers
- Extract one-line assignment functions (e.g. f(x) = expr)
- Emit module nodes; record macrocall_expression calls
- Vendor tree-sitter-julia.wasm (not shipped in tree-sitter-wasms)
- Register .jl in grammars, types, and EXTRACTORS map

Closes gaps in colbymchenry#244 where function bodies are statement lists rather than
block nodes.
hexu2 pushed a commit to hexu2/codegraph that referenced this pull request May 22, 2026
Extends the approach in colbymchenry#244 (@kongdd) with fixes for common Julia 1.11
AST shapes in real-world packages:

- Add getName hook and use resolveBody for structs without block wrappers
- Extract one-line assignment functions (e.g. f(x) = expr)
- Emit module nodes; record macrocall_expression calls
- Vendor tree-sitter-julia.wasm (not shipped in tree-sitter-wasms)
- Register .jl in grammars, types, and EXTRACTORS map

Closes gaps in colbymchenry#244 where function bodies are statement lists rather than
block nodes.
hexu2 added a commit to hexu2/codegraph that referenced this pull request May 22, 2026
Add tree-sitter-julia extraction with vendored WASM and registry wiring.
Builds on colbymchenry#244 (@kongdd) with support for common Julia 1.11 AST shapes:

- getName hook and resolveBody for structs/functions without block wrappers
- One-line assignment functions (e.g. f(x) = expr)
- Module nodes and macrocall_expression call sites
- Vendored tree-sitter-julia.wasm (not published in tree-sitter-wasms)
- Register .jl in grammars, types, and the language extractor map
hexu2 added a commit to hexu2/codegraph that referenced this pull request May 22, 2026
Add tree-sitter-julia extraction with vendored WASM and registry wiring.
Builds on colbymchenry#244 (@kongdd) with support for common Julia 1.11 AST shapes:

- getName hook and resolveBody for structs/functions without block wrappers
- One-line assignment functions (e.g. f(x) = expr)
- Module nodes and macrocall_expression call sites
- Vendored tree-sitter-julia.wasm (not published in tree-sitter-wasms)
- Register .jl in grammars, types, and the language extractor map
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.

3 participants