Skip to content

fix: Rust push_type_map_entry lacks deduplication parity with TS setTypeMapEntry #1501

@carlos-alm

Description

@carlos-alm

Context

Identified during review of PR #1495 (pre-existing issue, not introduced by that PR).

In crates/codegraph-core/src/extractors/javascript.rs, the None (class expression) branch of the field annotation handler calls push_type_map_entry which always appends without deduplication. The equivalent TS function setTypeMapEntry has first-write-wins semantics (won't overwrite a higher-confidence existing entry).

This means in the Rust engine, when multiple class expressions in a file define fields with the same name, duplicate typeMap entries can accumulate for the same bare key, unlike the TS engine. The edge builder may deduplicate by taking highest confidence, but the extraction behavior differs.

Fix

push_type_map_entry in helpers.rs (or a new variant for the 0.9 path) should implement first-write-wins semantics to match setTypeMapEntry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions