-
Notifications
You must be signed in to change notification settings - Fork 294
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
Add a way to check if a KSFunctionDeclaration is a constructor #113
Comments
Elements in |
Yes i think the extension is a good idea. |
yigit
added a commit
to yigit/ksp
that referenced
this issue
Jan 28, 2021
This PR fixes a bunch of issues / inconsistencies in constuctor delcarations. * changed KSFunctionDeclarationImpl and KSFunctionDeclarationJavaImpl to return <init> from name if it is constructor for consistency * added KSFunctionDeclaration.isConstructor extension function for convenience * changed getConstructors to simply use declaredFunctions.filter { it.kind == CONSTURCTOR } for consistency * updated KSClassDeclarationDescriptorImpl.kt declarations to include * added synthetic constructors for non-interface classes that do not have a constructor (including java annotations which do get a constructor when they are in .class files) * fixed KSConstructorSyntheticImpl to implement returnType Fixes: google#273 Fixes: google#114 Fixes: google#113 Test: constructorDeclarations.kt
ting-yuan
pushed a commit
to ting-yuan/ksp
that referenced
this issue
Feb 18, 2022
This PR adds caching for host classpath to avoid calling ClassGraph for every compilation. In my local tests, it saves between 50 to 80ms per compilation on my laptop, which is not necessarily much but adds up when you run hundreds of them. I've also cached common jars we find from there. It does not necessarily help with performance but rather as a cleanup to keep all of them in 1 place. Test: existing tests Issue: google#113
ting-yuan
pushed a commit
to ting-yuan/ksp
that referenced
this issue
Feb 18, 2022
…eveloper This PR updates KCT to use in process compilation unless the developer explicitly provides a jdkHome that does not match the java home of the current process. In most cases, it won't be provided and because we have a default, current implementation makes KCT spin off another process to compile java sources, causing a significant compilation time penalty. tschuchortdev/kotlin-compile-testing#113 (comment) With this change, KCT won't create another process unless jdkHome is set to a value that does not match the jdk home inherited from the current process. Issue: google#113 Test: As this is a bit difficult to test, I've added test that will check the logs ¯\_(ツ)_/¯
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The only way i found was to check if the simpleName == <init>
There's already a
FunctionKind
enum which could includeCONSTRUCTOR
The text was updated successfully, but these errors were encountered: