Skip to content

link references go to incorrect class/interface #2466

Closed
@myphysicslab

Description

@myphysicslab

Search terms

link reference goes to incorrect class / interface

Expected Behavior

Within markdown for a class, I expect that {@link methodName} will generate a link to that method within that class, not a link to a sub-class.

Actual Behavior

Within markdown for a class, {@link methodName} generates a link to a sub-class, not to the current class.

Steps to reproduce the bug

I've created a pull request a0aa658 with a minimal set of files that show the bug.

I didn't understand how to modify run.sh, so that won't work. I don't have yarn on my macOS system.

I installed typedoc with npm install typedoc and then I invoke typedoc with

    ./node_modules/typedoc/bin/typedoc 

(I was also able to compile with typescript, the .js files wind up in a separate build directory)

I have 4 very simple classes (actually 3 would probably be sufficient). The hierarchy is

BugAbstractSubject < BugRigidBodySim < BugImpulseSim < BugContactSim

So BugAbstractSubject is the base class.

The problem is visible in the docs for Class BugRigidBodySim. In the description at the top of the class docs, you will see "Adds method getRigidBodySim". If you hover your pointer over the link you should see that it links to the descendent class BugContactSim. It should link to the method on the same page of BugRigidBodySim.

You will see similar problems in the third subclass BugImpulseSim.

This doesn't happen in the base class. On the docs page for BugAbstractSubject, this problem isn't happening. In the text "Has method getAbstractSubject" the link is to the same page, as expected.

Caveat:

I discovered that changing the entryPoints in typedoc.json makes this bug disappear.

The bug occurs when typedoc.json contains

    "entryPoints": ["./src"],

The bug does NOT occur with

    "entryPoints": ["./src/BugAbstractSubject.ts",
         "./src/BugRigidBodySim.ts",
         "./src/BugImpulseSim.ts",
         "./src/BugContactSim.ts"
     ],

I tried to read the docs about entryPoints and entryPointStrategy but I wasn't able to understand why this would affect the linking behavior.

Environment

TypeDoc 0.25.4
Using TypeScript 5.3.3 from ./node_modules/typescript/lib
macOS Ventura 13.6.1
node --version
v18.16.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions