Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ki-ichino-nec opened this issue Mar 17, 2022 · 0 comments

Comments

@ki-ichino-nec
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants