Skip to content

[Question] node.getType().getText() vs node.getType().getText(node) #923

@stacey-gammon

Description

@stacey-gammon

This is somewhat related to my question here: #907

I'm relying on the import paths inside the returned string from node.getType().getText() to build reference links in an API doc system. node.getType().getText(node) always strips these import paths, but sometimes it returns better information than when not supplying the node.

Is there any way to get both the more complete information, but keep the import paths? I made a table of these differences here:

Screen Shot 2021-01-27 at 1 09 03 PM

There are some pretty interesting results. Notice how KindOfADup actually returns a reference to Foo because their types overlap, though they are defined separately.

Link to codesandbox

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions