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

[ksp2] Any API to get the source of an node (which jar and class is an ksNode from)? #2222

Open
acejingbo opened this issue Nov 20, 2024 · 0 comments

Comments

@acejingbo
Copy link

acejingbo commented Nov 20, 2024

In KSP1 i used to use source element to interpret which jar and class a ksNode came from (help us tell which jar and class is used, etc.)

In kotlin analysis, FirSymbol also provided ways like FirClassLikeSymbol<*>.sourceElement and FirCallableSymbol<*>.containerSource to retrieve source element of a symbol, which can tell us which jar and class (from classpath) an symbol came from

However, KSP2 chose to hide KaFirSymbol as internal so I cannot access these APIs. Nor did KSP2 provided any API for source element...
We would pretty much have to do reflection if wanna retrieve source elemnt, or know which jar&class an ksnode came from...

Wish list

Is it possible to make KaFirSymbol public to expose the API? Or provide a way to access the FirSymbol? Or provide an public property/function that direct to FirClassLikeSymbol<*>.sourceElement and FirCallableSymbol<*>.containerSource?
Otherwise, is there any other way to tell which jar and class is an ksNode from?

Thanks!

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

1 participant