colintheshots
06/10/2020, 7:26 PMZac Sweers
06/10/2020, 9:09 PMZac Sweers
06/10/2020, 9:22 PMMessager
? I’ve noticed that simple printlns don’t work for this case, so currently doing error("here")
-driven-development 😁Zac Sweers
06/10/2020, 10:37 PMvalue
field from it (Class<?>[]
), it just says it’s empty - @AutoService(Processor::class)
. Will file with a linkevant
06/11/2020, 12:50 AMclass Foo --> primaryConstructor is null
class Bar() -> primaryConstructor is not null
Zac Sweers
06/11/2020, 1:05 AMimplementation
? I noticed that leaks it transitively to any downstream consumers of the original consuming project. Changing to compileOnly
works fine for me in that caseZac Sweers
06/11/2020, 6:42 PMshikasd
06/11/2020, 9:28 PMSam Garfinkel
06/12/2020, 9:03 PMevant
07/03/2020, 5:13 PMelihart
07/09/2020, 7:45 PMcomplete
call that javac invokes on type symbols to fill in information about the type does not synchronize on mutable state.
In one of my complex annotation processors I have manually synchronized the Type completion so that I can parallelize processing with coroutines and it greatly sped up processing. It would be really nice if this was supported out of the box by KSP as it would allow processors to be fasterjordan29.04.1197
07/13/2020, 9:10 AMZac Sweers
07/19/2020, 6:08 AMZac Sweers
07/19/2020, 6:11 AMtrevjones
07/23/2020, 1:20 AMJacob Applin
07/28/2020, 3:38 PMDima Avdeev
07/30/2020, 9:21 PMTing-Yuan Huang
07/31/2020, 10:39 PMKSPLogger
(only logging()
with gradle --debug
work for now)
* KSP works on Windows now!
* Rebased to 1.4.0-rc. Please remember to change 1.4-M1
to 1.4.0-rc
in gradle build scripts.
Please give it a try!TwoClocks
08/07/2020, 6:52 PMZac Sweers
08/10/2020, 3:53 PMZac Sweers
08/24/2020, 1:11 AMKSName
API as well, then it would be easy for us to write something like fun KSName.toClassName(): ClassName
in KotlinPoet or similarKamil Rogoda
08/24/2020, 10:07 AMnatario1
09/09/2020, 6:02 PMclass Foo : Bar {
val foo by bar()
}
It would be nice, from foo
property, to retrieve the initializer "by bar()"
as a code block / string that can be analyzed.Zac Sweers
09/19/2020, 5:01 AMTing-Yuan Huang
09/25/2020, 7:37 PMZac Sweers
09/27/2020, 9:20 AMZac Sweers
09/28/2020, 3:31 PMevant
09/29/2020, 4:30 PMtype.replace()
but you need a KSTypeArgument
.
and you can get a type argument from
resolver.getTypeArgument()
but you need a type reference.
But I don't know how to get a type reference. You can do
resolver.getClassDeclarationByName("name").asType()
but that returns a KSType
not a KSTypeRefence
.Zac Sweers
10/02/2020, 2:20 AMMarc Knaup
10/05/2020, 5:30 PMMarc Knaup
10/05/2020, 5:30 PMTing-Yuan Huang
10/05/2020, 5:54 PMMarc Knaup
10/05/2020, 6:02 PM@Json
annotations directly in the data class
. The question is if there’s a type-safe way to annotate types, properties and methods in another module and leave the data class
without annotations.
But I guess that would need some language additions. Or a fancy mix of DSL + use-site annotations.Ting-Yuan Huang
10/05/2020, 6:23 PM@AnnotatingForeignType
@Json(...)
typealias ExtStructure = Structure
Whenever the processor sees the definition in the above, it can process Structure
as if it were annotated with Json.Marc Knaup
10/05/2020, 6:24 PMZac Sweers
10/05/2020, 6:29 PMMarc Knaup
10/05/2020, 6:32 PMZac Sweers
10/06/2020, 8:38 PMMichal Harakal
10/07/2020, 2:19 PMMarc Knaup
10/07/2020, 3:10 PMMichal Harakal
10/07/2020, 3:13 PMMarc Knaup
10/07/2020, 6:09 PMdata class Duck(…)
.
Now in a different module I want to provide info about how that class is supposed to be serialized/deserialized to/from JSON.
In another module I want to provide info about how that class is supposed to represented in GraphQL.
And so on.
That info is needed at compile time so that code generation can create the code needed for serialization, GraphQL definitions instances, etc.
Annotations are great for something like that. But they’re limited to within a single module.
That means I suddenly have mix my data model (my definition of Duck) with completely unrelated information (JSON, GraphQL). The latter are an implementation detail how I use the model in various cases. So these implementation details should stay away from the data model.
Which likely means that annotations are just not the right fit for that.Michal Harakal
10/07/2020, 7:10 PMMarc Knaup
10/08/2020, 2:06 PMUser::
is annoying.
I could do the same with annotations, but not in a different module.
And there are more complex cases, like when I define a field inline,Michal Harakal
10/08/2020, 6:45 PMMarc Knaup
10/12/2020, 4:33 PMMichal Harakal
10/12/2020, 4:34 PMMarc Knaup
10/12/2020, 4:38 PMMichal Harakal
10/12/2020, 4:41 PM