Skip to content
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

feat: inheritance references for classes and interfaces #88

Open
Angelika12 opened this issue Aug 6, 2018 · 5 comments
Open

feat: inheritance references for classes and interfaces #88

Angelika12 opened this issue Aug 6, 2018 · 5 comments

Comments

@Angelika12
Copy link

Classes are parsed as ClassDeclarations - anyhow, I don't find the classes, where a specific class inherits from.

@buehler
Copy link
Owner

buehler commented Aug 6, 2018

What do you mean by inherits from?

class A {}

class B extends A {}

so the ClassDefinition of B should contain a reference to A ?

@Angelika12
Copy link
Author

Yes, exactly. I would need the reference from B to A. The background is that I'm building a programm, which parses a set of Typescript files and generates a class diagramm out of it (for documentation purposes).

@buehler buehler changed the title Where do I find super classes (inheritance)? feat: inheritance references for classes and interfaces Aug 31, 2018
@buehler
Copy link
Owner

buehler commented Aug 31, 2018

@Angelika12

Ok, so I thought about this and found the following problem: during the parse step, I can only parse the name of the type that a class extends from. I don't have the exact knowledge about the type. This exact reference can only be done when the whole declaration index is used. Then I could parse the name that is used with the given import to actually get the type reference.

@Angelika12
Copy link
Author

Angelika12 commented Aug 31, 2018 via email

@edalex-ian
Copy link

I also would love to see this feature added. And unfortunately, it's even a showstopper for me. I can't think how I can work around it with the current features.

For me I'd just be happy to have all the tokens which are following the extends keyword. That is, this statement would be a perfect fit:

I can only parse the name of the type that a class extends from.

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

3 participants