Skip to content

follow-up: extract parameters for Gleam external_function in both engines #1110

@carlos-alm

Description

@carlos-alm

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upDeferred work from PR reviews that needs tracking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions