]> Repositorios git - classgraph.git/commit
Let drill-in work on external classes that have local instances
authorJavier Sagredo <[email protected]>
Wed, 6 May 2026 23:59:19 +0000 (01:59 +0200)
committerJavier Sagredo <[email protected]>
Wed, 6 May 2026 23:59:19 +0000 (01:59 +0200)
commitff8ce7613cee88dcd2f647b27fb539ed98186b76
treecfe59d47da1d48feba7e619f3cb63175a327ebed
parent42bdd3fcca89d8f06dd5547078a52c027fa9c54b
Let drill-in work on external classes that have local instances

drillInto used to gate on classById.has(n.id()) and silently fall
through to highlightOnly when the double-clicked class wasn't
locally defined. That's the wrong call when the class is external
but instances of it *are* in our dumps (orphan-style, or because
the package defining the instances was extracted while the package
defining the class wasn't) — there's still a useful instance view
to render.

Two changes:

* drillInto now drills in whenever the class is locally defined OR
  has at least one entry in instancesByClass. When neither is true
  (truly nothing to show), it console.warns with the qid so you can
  diagnose why your double-click did nothing.

* buildInstanceView synthesises a minimal ClassInfo from the first
  matching instance's iiClass when classById misses, so the rest of
  the build pipeline (which needs ciSuperclasses, ciAssocTypes,
  ciTyVars …) keeps working with empty defaults. The focused-class
  node ends up as an external-styled stub but the per-instance
  rendering — contexts, superclass requirements, fam-instances — is
  all there.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
data/viewer.js