Skip to content

test: add coverage for class expression field annotation (None path) in enclosing_type_map_class #1500

@carlos-alm

Description

@carlos-alm

Context

Identified during review of PR #1495.

In src/extractors/javascript.ts and crates/codegraph-core/src/extractors/javascript.rs, handleFieldDefTypeMap / the field_definition handler has two branches:

  1. Some(class_name) — class declaration: seeds ClassName.field @ 0.9 + bare keys @ 0.6
  2. None — class expression: seeds bare keys only at full confidence (0.9)

Neither engine has a test covering the None (class expression) path: const Foo = class { private repo: Repo; } should produce repo @ 0.9 and this.repo @ 0.9 but NOT Foo.repo. This is new behavior introduced by PR #1495 and is currently untested in both TS and Rust.

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