Deferred from PR #1105 review.
Original reviewer comment: #1105 (comment)
Context
handle_external_function (Rust) and handleExternalFunction (JS) both hardcode children: None / omit children, while their counterparts for regular function extract parameters as children. This creates a silent asymmetry between regular and external Gleam functions even though both have a full parameter list in their signatures.
Why deferred
The current PR's stated goal is to port the existing WASM/JS Gleam extractor to native Rust at parity. The native Rust implementation faithfully mirrors the existing WASM/JS behavior. Fixing this requires changes in BOTH engines plus corresponding unit tests, which goes beyond "port to Rust" scope.
Suggested fix
- Add
extract_params call to handle_external_function in crates/codegraph-core/src/extractors/gleam.rs.
- Mirror the change in
handleExternalFunction in src/extractors/gleam.ts so the JS engine keeps parity.
- Add unit tests covering external function parameter extraction in both Rust and TypeScript test suites.
- Verify the Gleam tree-sitter grammar exposes a
parameters field on external_function nodes (or fall back to function_parameters child).
Deferred from PR #1105 review.
Original reviewer comment: #1105 (comment)
Context
handle_external_function(Rust) andhandleExternalFunction(JS) both hardcodechildren: None/ omitchildren, while their counterparts for regularfunctionextract parameters as children. This creates a silent asymmetry between regular and external Gleam functions even though both have a full parameter list in their signatures.Why deferred
The current PR's stated goal is to port the existing WASM/JS Gleam extractor to native Rust at parity. The native Rust implementation faithfully mirrors the existing WASM/JS behavior. Fixing this requires changes in BOTH engines plus corresponding unit tests, which goes beyond "port to Rust" scope.
Suggested fix
extract_paramscall tohandle_external_functionincrates/codegraph-core/src/extractors/gleam.rs.handleExternalFunctioninsrc/extractors/gleam.tsso the JS engine keeps parity.parametersfield onexternal_functionnodes (or fall back tofunction_parameterschild).