feat: add Elixir, Lua, Dart, Zig, Haskell, OCaml language support#718
feat: add Elixir, Lua, Dart, Zig, Haskell, OCaml language support#718carlos-alm merged 12 commits intomainfrom
Conversation
- CHANGELOG: fix total language count from 14 to 17 - README: add 6 new languages to multi-language differentiator row - ROADMAP: update Phase 7 overview to reflect Batch 1 completion
Add Batch 2 languages from the ROADMAP Phase 7 plan. Each language includes dual-engine support (WASM + native Rust extractors), AST configs, and parser tests. Language details: - Elixir (.ex, .exs): modules, functions, protocols, imports/use/require - Lua (.lua): functions, methods, require() imports, table patterns - Dart (.dart): classes, enums, mixins, extensions, imports, inheritance - Zig (.zig): functions, structs, enums, unions, @import, test decls - Haskell (.hs): functions, data/newtype/type, typeclasses, imports - OCaml (.ml, .mli): let bindings, modules, types, open, applications Notable grammar quirks handled: - Elixir: all constructs are generic `call` nodes, distinguished by identifier text (defmodule, def, defp, use, import, etc.) - Dart: no call_expression node — calls detected via selector/argument_part - Zig: structs/enums are anonymous, named by parent variable_declaration - Haskell: grammar misspells type_synomym (missing 'n') - OCaml: sub-grammar under grammars/ocaml, Rust export LANGUAGE_OCAML - Dart Rust crate uses old language() function instead of LANGUAGE constant
|
Claude finished @carlos-alm's task —— View job PR Review: Batch 2 Language Support
|
Greptile SummaryThis PR completes Phase 7 Batch 2 of the language support roadmap by adding Elixir, Lua, Dart, Zig, Haskell, and OCaml — bringing the project from 17 to 23 supported languages. Each language ships with a dual-engine extractor (WASM TypeScript + native Rust), AST configs, and parser tests, following the established pattern from Batch 1. The implementation is thorough and well-structured. Key language-specific design decisions are handled correctly: Elixir's generic One P1 issue found:
One P2 note:
Confidence Score: 4/5Safe to merge after fixing the OCaml One P1 bug: OCaml
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Source File] -->|extension lookup| B{LanguageKind}
B -->|.ex/.exs| C[Elixir]
B -->|.lua| D[Lua]
B -->|.dart| E[Dart]
B -->|.zig| F[Zig]
B -->|.hs| G[Haskell]
B -->|.ml/.mli| H[Ocaml ⚠️]
C --> I{Engine}
D --> I
E --> I
F --> I
G --> I
H --> I
I -->|WASM| J[TS Extractor\nsrc/extractors/*.ts]
I -->|Native| K[Rust Extractor\ncrates/codegraph-core/src/extractors/*.rs]
J --> L[ExtractorOutput\ndefinitions / calls / imports / classes]
K --> L
H -.->|.mli uses LANGUAGE_OCAML\nshould use LANGUAGE_OCAML_INTERFACE| M[❌ Parse errors on .mli]
|
| ### Features | ||
|
|
||
| * add C, C++, Kotlin, Swift, Scala, Bash language support ([#708](https://github.com/optave/ops-codegraph-tool/pull/708)) | ||
|
|
There was a problem hiding this comment.
v3.6.0 CHANGELOG entry describes the wrong language batch
The v3.6.0 entry reads: "This release adds first-class support for C, C++, Kotlin, Swift, Scala, and Bash — bringing the total supported languages to 17." That describes Batch 1 (PR #708), not the six languages being added in this PR. The entry should reference Elixir, Lua, Dart, Zig, Haskell, and OCaml bringing the total to 23.
| ### Features | |
| * add C, C++, Kotlin, Swift, Scala, Bash language support ([#708](https://github.com/optave/ops-codegraph-tool/pull/708)) | |
| **Six new languages: Elixir, Lua, Dart, Zig, Haskell, OCaml.** This release adds first-class support for Elixir, Lua, Dart, Zig, Haskell, and OCaml — bringing the total supported languages to 23. Each language ships with dual-engine extractors (WASM TypeScript + native Rust), AST configs, and parser tests. |
There was a problem hiding this comment.
Fixed in 441fcd1. The CHANGELOG v3.6.0 entry now correctly references Elixir, Lua, Dart, Zig, Haskell, and OCaml (Batch 2), with the total updated to 23.
…unction names (#718) walkElixirNode never updated currentModule when descending into defmodule bodies, so all functions got unqualified names (e.g. `greet` instead of `Greeter.greet`), breaking parity with the native Rust engine. Strengthen the test assertion to check qualified names.
…is_pub (#718) WASM extractor: handleZigFunction now skips nodes inside struct/union containers since extractZigContainerMethods already emits them as qualified methods. Rust extractor: remove dead is_pub call from handle_zig_function (Definition struct lacks a visibility field).
CHANGELOG v3.6.0 entry incorrectly described Batch 1 languages instead of Batch 2. README comparison table, feature descriptions, and ROADMAP phase summary all updated to reflect 23 supported languages.
Addressing all Greptile review commentsP1 — Elixir WASM P1 — Zig WASM duplicate struct method emission (0f7c637) P2 — P2 — README/ROADMAP/CHANGELOG language counts (441fcd1)
CI failure (incremental-parity test): Resolved by merging main into the branch — the test relied on a CFG fix that landed on main after this branch diverged. |
|
@greptileai review |
…dren in Rust extractor (#718) - Remove unused `visibility` variable in `handle_def_function` (Definition struct has no visibility field yet; left a comment for future wiring) - Add `collect_module_children` to `handle_defmodule` so the native engine populates module children, matching the TS/WASM extractor behaviour - Include Cargo.lock update with new batch-2 tree-sitter dependencies (elixir, lua, dart, zig, haskell, ocaml) that was missing from prior commits
Addressing remaining Greptile findings from summary review1. 2. 3. 4. Cargo.lock — missing batch-2 tree-sitter deps CI note: The |
|
@greptileai review |

Summary
Language Details
.ex,.exscallnodes.luarequire()detected as imports.dartcall_expression— usesselector/argument_part.zig.hstype_synomym.ml,.mligrammars/ocamlFiles Changed
Test plan
tsc --noEmit)