repowise-dev / repowise-dev/repowise

[Bug] static create = (...) => {} is invisible: class fields are captured for their type only

Closed
#2,302 3 comments 0 reactions 1 assignee View on GitHub

@rehan6025 is already working on this.

Since Sep 18, 2026.

bug good first issue
Dominant language
Python
Stars
6.7k
Forks
711
Avg merge
1d 13h
Merged PRs (30d)
439

Description

Summary

queries/typescript.scm has exactly one public_field_definition pattern, and it captures the field's type annotation, never the field itself.

packages/core/src/repowise/core/ingestion/queries/typescript.scm:276-278

; Class field types: class C { f: Field }
(public_field_definition
  type: (type_annotation (_) @param.type))

So a class property holding a function, the common static create = (...) => {} factory shape, produces no symbol. Nothing can call it, and it cannot be reported as unused.

Mechanism

Worth ruling out the obvious suspect: this is not the callable-ancestor filter that deliberately drops functions nested inside other functions (parser.py:1360-1374). Class bodies are exempt from that filter, which is why ordinary methods work. There is simply no pattern for the shape.

Repro

class Thing {
  static create = (name: string) => new Thing(name);
}

Thing.create appears in no symbol table.

Impact

A common TypeScript idiom, particularly for static factories and for class properties holding arrow-bound handlers.

Under-reporting. Previously observed as part of a wider extraction gap where two competing tools held a symbol and we held none.

Done looks like

A public_field_definition pattern binding @symbol.def when the value is an arrow_function or function_expression, leaving the existing type-annotation capture intact.

Gate on the value being a function. A pattern matching every class field would mint symbols for ordinary data properties, which is a different and much larger change.

This changes no resolution tier: it adds a callee identity that calls can already reach by name once it exists.

Tests: the TypeScript extractor tests — a static create = (...) => {} and a non-static handler = () => {} asserting both become symbols, plus a plain count = 0 asserting it does not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.