Commit Graph
1 Commits
Author SHA1 Message Date
danusha2345andClaude Opus 5.5 08b187aaf6 feat(cli): codegraph implementations <name> lists the types that implement or extend a type
Which types implement this trait is the first question when a flow crosses a
trait or interface boundary, and no command answered it: node shows members and
callers, and impact mixes implementors with dependents and tests under one list.

The command renders the shared hierarchy derivation (type-hierarchy.ts, the one
codegraph_explore and the viewer read), not a third walk. Each row gives the
kind, the edge that ties the type (implements or extends, and from depth 2 the
type it hangs off), file:line, and [test] or [synthesized]. --depth follows
subclasses of subclasses, --file narrows an ambiguous name, --json gives the
same rows. Test code is read in a new test-code.ts: the file path, a test
segment in the qualified name, and for Rust a test cfg module in the source,
since the extractor neither names such a module nor prefixes what it declares.

Changes on top of the contributor's commit:
- The command opens the index with openIndexToRead, as every other read command
  does. A plain open repairs and migrates: run during another process's bulk
  load it made the writer's next write fail with database is locked (issue
  2913), and on an older release's index a read took the schema from 4 to 16. It
  joins the read-commands test, which was red on all three scenarios.
- The Rust module reader counts braces over the existing blankRustCode instead
  of its own masker, which missed character literals, raw strings and block
  comments, so one '{' in a test module left a mock unmarked. It also reads test
  inside cfg(all(...)), the form tokio and others use.
- The README lists the command; the changelog bullet credits the author.

Validated on real repos. Across 2,761 Rust files (8,819 declarations, ripgrep,
gitbutler, lightningcss, Cap, yaak and three more) the new reader keeps all 196
test-module declarations the old one found and adds 20, spot-checked as real
fixtures in test modules. implementations ran on ripgrep (Matcher, Sink), gin
(ResponseWriter, IRouter, Binding, with Go's implicit edges marked synthesized),
flask (View at depth 2), excalidraw and Minestom. CLI start stays within 3 ms
(116 ms to 119 ms, median of 25, interleaved). The site's CLI page is left for
the release, so a push does not deploy a command nobody has yet.

Original PR #2839 by @danusha2345.
Fixes #2833

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:18:39 +00:00