Skip to content

TS: method chain syntax (Class > method) is undiscoverable — error gives no hint, suggest never emits it #68

Description

@cmcdonald99

Summary

(Original report said TS class methods weren't addressable — wrong, see correction comment. file.ts > ClassName > methodName resolves fine. This issue is now about discoverability.)

Dogfooding v0.6.0 on a NestJS monorepo, anchoring a method took three failed guesses because nothing in the toolchain reveals the chain syntax:

  1. at: …service.ts > EffectiveTierService.getForUsers → ````EffectiveTierService.getForUsersnot found``` — no hint that the resolver wants> ` segments. `Class.method` is the spelling every TS dev will try first.
  2. at: …service.ts > getForUsers → same flat not found.
  3. surf suggest on the file says "no unanchored public symbols found" (suggest (TS): exported classes are never proposed, even though the resolver anchors them #70), so suggestions never model the chain form either.

I only found EffectiveTierService > getForUsers by reading the Go/Python repros in closed issues #54/#28.

What

Some combination of:

  • Error hint: when a single-segment lookup fails and the name contains a dot — or matches method inside an exported class — suggest the chain: did you mean \EffectiveTierService > getForUsers`?`
  • suggest emits methods for TS (the enumeration half is suggest (TS): exported classes are never proposed, even though the resolver anchors them #70), so the chain form shows up in scaffolding.
  • Docs: authoring-hubs guide should show a Class > method example for TS, not just top-level functions.

surf 0.6.0, macOS aarch64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions