Skip to content

Wrong id in inheritedFrom section #1230

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
1 task done
SavchenkoAlexander opened this issue Mar 16, 2020 · 6 comments
Closed
1 task done

Wrong id in inheritedFrom section #1230

SavchenkoAlexander opened this issue Mar 16, 2020 · 6 comments

Comments

@SavchenkoAlexander
Copy link

When generating from d.ts file the resulting part of json file is

"id": 160728,
"name": "ASPxClientGaugeControl",
"kind": 128,
"kindString": "Class",
"flags": {
	"isExported": true
},
"children": [						
	{
		"id": 160760,
		"name": "Init",
		"kind": 1024,
		"kindString": "Property",
		...
		"inheritedFrom": {
			"type": "reference",
			"id": 160760,
			"name": "ASPxClientControlBase.Init"
		}
	},
	...
]

Expected Behavior

The "id" value in inheritedFrom section should be as the id of "Init" property of the ASPxClientControlBase class.

Actual Behavior

The "id" value in inheritedFrom section is the id of "Init" property of the ASPxClientGaugeControl class (the inherited member itself).

Steps to reproduce the bug

typedoc --json tsDoc.json --ignoreCompilerErrors --includeDeclarations --excludePrivate --target ES5 d:\Temp

Environment

  • Typedoc version: 0.16.11
  • Node.js version: 12.13.1
  • OS: Windows 10
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 18, 2020

The whole system surrounding TypeDoc's reference types really needs to be redone...

We currently frequently try to guess what a reference is referring to given nothing but its name. While this might have worked decently well in pre-module TypeScript.... it is a horrible idea now.

I spent a few hours looking into this yesterday and partially fixed it, but ran into several other blockers that will need some more hours to figure out. I should be able to look more deeply into it this weekend.

@donmccurdy
Copy link

I'm not familiar with the generated JSON here, but I think I'm seeing the same issue. I have a class hierarchy that looks like this:

Screen Shot 2020-05-03 at 12 42 46 PM

Most of those classes inherit a number of methods from Property, but the generated documentation shows it all as inherited from Node, which is a final class not extended by anything. For example, here's the documentation for getName() on the Node class, which claims to be inherited from itself:

Screen Shot 2020-05-03 at 12 44 21 PM

Is this the same bug, or have I misunderstood the description?

@johnDance
Copy link

We are also running into the same issue. Sometimes the inherited from references its own class, sometimes a sibling class, and sometimes the actual base class.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented May 17, 2020

That sounds like the same bug, it sounds like we have a check inverted somewhere for which node to add the inherited from property to.

I spent a few hours looking into this yesterday and partially fixed it, but ran into several other blockers that will need some more hours to figure out. I should be able to look more deeply into it this weekend.

This never happened... GitHub's old notification system didn't save the notification and it dropped off my radar. PR welcome if someone wants to take a look at fixing this. I need to try to get library mode finished first.

@CoreyDotCom
Copy link

@Gerrit0 is this a duplicate of #1209?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 9, 2020

It might be, all of TypeDoc's logic regarding reference resolving is sketchy at best. I'll keep both open for now.

@Gerrit0 Gerrit0 closed this as completed Dec 28, 2020
@Gerrit0 Gerrit0 removed the bug label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants