-
Notifications
You must be signed in to change notification settings - Fork 8
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: use detekt to extract kotlin schema #549
Conversation
} | ||
calls.addAll(refs) | ||
|
||
// Step into function calls inside this expression body to look for transitive calls. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @alecthomas extracting transitive calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
||
private fun extractIngress(): MetadataIngress? { | ||
return verb.annotationEntries.firstOrNull { | ||
bindingContext.get(BindingContext.ANNOTATION, it)?.fqName?.asString() == Ingress::class.qualifiedName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unfortunate that we can't get a reference to the concrete annotation class like we can with KSP :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, there were some operations that were a lot more ergonomic with KSP :( one thing that's nice about detekt though it's it's a thin shim around kotlin PSI, which I found a lot more google-able than the KSP frameworks/schemas. so maybe easier to build on until KSP resources have improved a bit
also fwiw this is more verbose but should still be deterministic since we're comparing fully qualified class names
calls.addAll(refs) | ||
|
||
// Step into function calls inside this expression body to look for transitive calls. | ||
body.children.mapNotNull { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this recursive, or just top-level calls? If the latter, fine for now but maybe add a note to remind us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's recursive!
af54e10
to
9ec86ef
Compare
fixes #530