Skip to content

[BUG] Invalid links to a class when the class name includes an interface name #1239

@ki-ichino-nec

Description

@ki-ichino-nec
Overview of the issue

CompoDoc cannot create proper links to a class when the class name includes an interface name.
CompoDoc generates links to the interface instead of the class.

Operating System, Node.js, npm, compodoc version(s)
  • OS: Windows 10, Rocky Linux 8
  • CompoDoc: 1.1.16, 1.1.19
Angular configuration, a package.json file in the root folder
  • No Angular
  • No dependencies other than compodoc and typescript

We first found the problem in an Angular project.
After some works, we noticed that the problem could occur in bare NPM projects.

Compodoc installed globally or locally ?

Globally or locally.

If possible sourcecode of the file where it breaks
interface Aa {}

// The prefix of class name matches the interface name
class AaBb {}
//    ^^

// The intermediate of class name matches the interface name
class BbAaCc {}
//      ^^

// The suffix of class name matches the interface name
class CcAa {}
//      ^^

class Container {
  // This type links to Aa interface, not AaBb class.
  a: AaBb;

  // This type links to Aa interface, not BbAaCc class.
  b: BbAaCc;

  // This type links to Aa interface, not CcAa class.
  c: CcAa;
}
Reproduce the error
  1. Define an interface
  2. Define a class of which name includes the interface name
  3. Create a property of which type is the class
Related issues

The problem seems similar to #157, which has been resolved.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions