]> Repositorios git - classgraph.git/commitdiff
Don't draw the predicate-class node alongside fam-resolves matches
authorJavier Sagredo <[email protected]>
Wed, 6 May 2026 22:27:28 +0000 (00:27 +0200)
committerJavier Sagredo <[email protected]>
Wed, 6 May 2026 23:51:06 +0000 (01:51 +0200)
The "fam-resolves" chain pulled the predicate class into the instance
view as a separate node and connected it to the matched instance with
a green "defines" edge — duplicating information already on the
matched-instance label. Drop the class anchor + defines edge here, the
same way commit 3a8e0ac handled the matched-superclass case.

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

index d35899c6d42e17bd9ac34c266cbf1615e828530b..5611f57d887b6bde5f89cd5e3ac83e89a26f7c6b 100644 (file)
           }
 
           // Resolution chain: with the substituted RHS in hand, look for
-          // a matching class instance of @predClassQn@.
+          // a matching class instance of @predClassQn@. The matched
+          // instance's own label already names its class, so we don't
+          // also pull a class node into the graph alongside it — it
+          // would just be a redundant box with a green arrow that says
+          // the same thing.
           if (predClassQn && resolvedArgs) {
             const reduced = resolvedArgs.map(reduceTypeArg);
             const matched = findMatchingInstances(predClassQn, reduced);
                 m, predClassQn,
                 'inst:' + m._idx
               );
-              // Make sure the matched instance hangs under its class node
-              // so the user has a stable place to find it.
-              const predClsId = ensureClassNode(predClassQn);
-              const defId = predClsId + '=>' + mId;
-              if (!seenNodes.has(defId)) {
-                seenNodes.add(defId);
-                els.push({ group: 'edges', data: {
-                  id: defId, source: predClsId, target: mId, kind: 'defines',
-                }});
-              }
               const resId = fiNodeId + '=>resolves=>' + mId;
               if (!seenNodes.has(resId)) {
                 seenNodes.add(resId);