Skip to content

TS/JS symbol resolver: multi-line template literals can misbalance the block scan; no dotted notation #3

@Wynelson94

Description

@Wynelson94

Known v0.10 limitations (documented, now tracked)

The TS/JS resolver (fieldnotes/symbols.py) is deliberately parser-free — regex declaration match + line-based brace balancing. Two real limitations:

  1. Multi-line template literals containing braces aren't stripped by _strip_ts_noise (it only handles single-line strings), so a declaration whose body contains e.g. a multi-line template with ${...} or CSS-in-JS braces can misbalance the scan and produce a wrong end line. Failure mode is loud (pin surfaces as stale), but wrong-range pins waste a heal cycle.
  2. No dotted notation for TS (ClassName.method) — Python has it via AST; TS resolves top-level declarations only.

Direction

Keep the no-parser stance (a wrong range fails loud, and zero deps is a feature). For (1), a line-state tracker for backtick spans would cover most cases. For (2), a second-pass scan inside a matched class block for methodName( at one indent level would cover the common case. PRs welcome — see the test conventions in tests/test_symbols_ts.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions