Skip to content

[Semantic API] Should we include a back reference to the associated type def from a type reference? #27980

Answered by pubudu91
pubudu91 asked this question in Q&A
Discussion options

You must be logged in to vote

Had a discussion regarding this during the sprint meetings as well since this requirement again came up in #29287 as well and decided to go ahead and add an API to the type ref symbol to get the associated type definition symbol of the type ref. Will add the following method to TypeReferenceTypeSymbol:

public TypeDefinitionSymbol definition();

Additionally, with this change, should we consider returning Optional.empty() from getLocation() implementation in type ref? Since the location in type ref may be misunderstood to mean the location of the usage of the type def (especially since now there will be a way to get the associated definition symbol)?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@pubudu91
Comment options

@rdhananjaya
Comment options

@pubudu91
Comment options

Comment options

You must be logged in to vote
1 reply
@pubudu91
Comment options

Answer selected by pubudu91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants