feat: add Elixir, Lua, Dart, Zig, Haskell, OCaml language support#718
feat: add Elixir, Lua, Dart, Zig, Haskell, OCaml language support#718carlos-alm wants to merge 9 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 adds Batch 2 language support (Elixir, Lua, Dart, Zig, Haskell, OCaml) from Phase 7 of the roadmap, bringing the total to 23 languages. Each language ships with a WASM/TypeScript extractor, a native Rust extractor, AST node configs, and parser tests — following the same dual-engine pattern established in Batch 1 (PR #708). The approach is well-structured and the TS extractors are generally thorough and well-commented. Key findings:
Confidence Score: 4/5Safe to merge for the TS/WASM engine path; the Rust native engine has three issues worth fixing before the native CI gate is re-enabled All 34 parser tests pass and the TS/WASM path is clean. However, the native Rust engine has a confirmed dead variable (visibility in elixir.rs), an engine parity gap (module children in elixir.rs), and a grammar mismatch that will produce wrong results for .mli files (parser_registry.rs). The Rust native build is also still marked unchecked in the PR test plan. crates/codegraph-core/src/extractors/elixir.rs (visibility variable + module children), crates/codegraph-core/src/parser_registry.rs (OCaml .mli grammar) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
File["Source File (.ex/.lua/.dart/.zig/.hs/.ml/.mli)"]
Ext["Extension → LanguageKind\n(parser_registry.rs / LANGUAGE_REGISTRY)"]
File --> Ext
Ext --> WASM["WASM Engine (TypeScript)"]
Ext --> NATIVE["Native Engine (Rust)"]
WASM --> TSE["TS Extractor\nelixir.ts / lua.ts / dart.ts\nzig.ts / haskell.ts / ocaml.ts"]
NATIVE --> RSE["Rust Extractor\nelixir.rs / lua.rs / dart.rs\nzig.rs / haskell.rs / ocaml.rs"]
TSE --> OUT["ExtractorOutput\ndefinitions · calls · imports\nclasses · exports · typeMap"]
RSE --> OUT2["FileSymbols\ndefinitions · calls · imports\nclasses · ast_nodes"]
subgraph Issues
I1["⚠️ elixir.rs: visibility dropped\n(dead var, parity gap)"]
I2["⚠️ elixir.rs: module children = None\n(parity gap vs TS)"]
I3["⚠️ parser_registry.rs:\n.mli → LANGUAGE_OCAML\n(should be LANGUAGE_OCAML_INTERFACE)"]
end
RSE -.->|affects| I1
RSE -.->|affects| I2
Ext -.->|affects| I3
Reviews (2): Last reviewed commit: "docs: update language counts from 17 to ..." | Re-trigger Greptile |
| ### 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 |

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)