raulraja
03/30/2020, 1:58 PMAhmed Mourad
04/02/2020, 7:15 AMBurkhard
04/02/2020, 9:32 AMjavap -c -l use-plugin/build/classes/../HelloWorldKt.class
Looking at the line information you see that it no longer matches the source file.Burkhard
04/02/2020, 9:33 AM> Task use plugincompileKotlin
w: Some JAR files in the classpath have the Kotlin Runtime library bundled into them. This may cause difficult to debug problems if there’s a different version of the Kotlin Runtime library in the classpath. Consider removing these libraries from the classpath
w: /Users/burkhard/Projects/Kotlin/arrow-meta-examples/hello-world/create-plugin/build/libs/create-plugin-all.jar: Library has Kotlin runtime bundled into it
johnaqel
04/09/2020, 2:08 PMSam Garfinkel
04/11/2020, 9:57 PMMassimo Carli
04/19/2020, 12:05 AMarrow.meta.plugin.idea
package so I cannot find the definition for IdeMetaPlugin
. Thanksrusshwolf
04/23/2020, 1:40 PMcurioustechizen
04/28/2020, 6:45 AMcommonTest
dependency. I'm aware there will be limitations with this compared to mocking frameworks.
I'm a complete newbie when it comes to compiler plugins and arrow meta. I've watched a few conference talks on the topic but that's about it.
My question is: Is everything required for such a plugin already available? Or is it better to wait until 1.4?
For example, I think IR might not be needed in this case because it looks like I want my plugin to generate Kotlin code.
Also, how about an IDE plugin? Would that be required for this scenario?melatonina
04/30/2020, 8:31 AM"name" { /* ... */ }
like in https://github.com/arrow-kt/arrow-meta-examples/blob/master/hello-world/create-plugin/src/main/kotlin/io/arrowkt/example/HelloWorldPlugin.kt#L11 a standard Kotlin syntax or something that is added by ΛRROW Meta?melatonina
04/30/2020, 6:41 PMmelatonina
05/03/2020, 7:05 AMBen Woodworth
05/03/2020, 4:42 PMmelatonina
05/04/2020, 9:30 AMTransform.newSources
) in the same module upon which ΛRROW Meta was applied to generate it? As an example, I'm generating a wrapper class with this transformation
classDeclaration(isAnnotatedWith<Cool>()) { c ->
Transform.newSources(
"""|package ${c.packageName}.cool
|
|class Cool${c.name}(val value : ${c.fullyQualifiedName})
|""".trimMargin().file("cool.kt")
)
}
Can I configure gradle and IDEA to use this class definition in the module where I apply my plugin?
The problem that I see is that the content of the kapt folder is made of both new source files and modified source files.melatonina
05/04/2020, 10:20 AMvalueParameters
of the primaryConstructor
ot a KtClass
in a ΛRROW Meta transformation, is it normal to find the typeReference.name
to be null
and to have to use text
, instead, to find the type of the parameter (Int
, in my case)?melatonina
05/04/2020, 3:15 PMval
parameter.
The code can be found here: https://github.com/mel4tonin4/inline-serialization-plugin/tree/master
The plugin operates on classes marked with a custom @InlineSerializable
annotation.
Currently, the serializer classes are generated and the original classes seems to be annotated with a Serializable(with=)
decoration pointing to the serializer class... but not quite. If I enable metadebug
I get a source file with the annotated class, but in the same kapt directory there is a file with a non-annotated class and if I try to use the class in another library, there is no serializer()
method.
Here is the content of the kapt directory: https://gist.github.com/mel4tonin4/1605d28e9bd2471c5bfb013b2d31f0ef I enabled metadebug
only on one of the classes. Why are ChannelCount.kt.meta and ChannelCount.kt not the same?melatonina
05/04/2020, 10:28 PMmelatonina
05/05/2020, 5:31 AMA
and B
has a type Either<A, B>
and compile it accordingly, by inserting the calls to left()
and right(),
with an ΛRROW Meta plug-in? Would that cause any problems?melatonina
05/05/2020, 8:14 AMarrow-meta-compiler-plugin
version 1.3.70-SNAPSHOT
does not exist, so don't waste time looking for it based on the discussions on Slack.
• For updated information on the status of ΛRROW Meta, better check the issue tracker.melatonina
05/06/2020, 7:09 PMrusshwolf
05/06/2020, 8:03 PMval Meta.demoPlugin: CliPlugin get() = "Demo" {
meta(
property({ true }) { ktProperty ->
val type = ktProperty.typeReference?.name // name is null
Transform.empty
}
)
}
Ahmed Mourad
05/09/2020, 7:42 PMnamedFunction
block, however, kotlinType
requires a BindingContext
, where can I get its instance from?
namedFunction({ ... }) { c ->
c!!containingClass().getProperties()[0].kotlinType()
}
redrield
05/09/2020, 8:22 PMmarc0der
05/15/2020, 7:11 AMKind
interface, surrogate types, boilerplate etc. Is there an easier way to express HKTs with Arrow Meta yet? I remember there being some talk about making them easier to use with Arrow Meta in the past, but just not sure if this has progressed at all.raulraja
05/15/2020, 8:04 PMmattmoore
05/22/2020, 8:48 PM./gradlew buildMeta -Dorg.gradle.debug=true
Starting a Gradle Daemon (subsequent builds will be faster)
> Starting Daemon
After 20 minutes it doesn't appear to proceed any further. Perhaps I'm missing something?Nico
05/23/2020, 6:45 PMmattmoore
05/24/2020, 9:04 PMdata class
is not supported for source code? If I have a test like this:
@Test
fun `destructuring example`() {
assertThis(CompilerTest(
config = {
metaDependencies
},
code = {
"""|data class Person(val firstName: String, val lastName: String, val age: Int)
|
|val person = Person("Matt", "Moore", 100)
|val (firstName, lastName, age) = person
|""".source
},
assert = {
allOf(
"firstName".source.evalsTo("Matt"),
"lastName".source.evalsTo("Moore"),
"age".source.evalsTo(100)
)
}
))
}
The code snippet fails to compile. Removing the data
keyword succeeds, but then there are no componentN
functions generated for destructuring.mattmoore
05/27/2020, 12:29 AMKtCallExpression
node. Is KtCallExpression
is related in any way to KtCallableReferenceExpression
? I quickly put together a branch to add a meta matcher for String.callExpression
but noticed when I got to the KtPsiFactory
that there is no method there for creating a KtCallExpression
. Which leads me to believe this is not possible at the moment since PSI might not support it?
Example of what I'm talking about: https://github.com/arrow-kt/arrow-meta/compare/master...mattmoore:call-expressions?diff=unified#diff-2ab9610fb1adf0fd2d58e144d4097e56R122
Perhaps there's another way to hook into KtCallExpression
that I'm overlooking...Joachim Ansorg
05/27/2020, 6:53 AMExtensionPhase
in valueArgumentCoercion.kt
and many other files in the idea-plugin
module.
I'd be glad to any help here.