Youssef Shoaib [MOD]
02/15/2021, 11:28 PMAhmed Mourad
02/17/2021, 6:53 PMSimpleFunctionDescriptor
, obtained from:
bindingContext.getSliceContents(BindingContext.FUNCTION)//.first()
I'm trying to get the body or the statements of this function, but I can't find the method to do so?Max Härtwig
02/18/2021, 12:48 PMfun test() {
println("Testing...")
val a = 1
val b = 2
}
val Meta.myPlugin: CliPlugin
get() =
"Plugin" {
meta(namedFunction(this, { name == "test" }) { function ->
error(body)
})
}
prints
println("Testing...")
val a = 1
val b = 2
}
{
println("Testing...")
val a = 1
val b = 2
}
{
println("Testing...")
val a = 1
val b = 2
Apparently, it's printing the function's body as many times as it has lines with }
and {
in between. Is that a known issue?Nikita Klimenko [JB]
02/26/2021, 12:22 AMtyped quotes
PR? It's been around for a while now. Seems fully functional, but merge is blocked by conflicts.Nikita Klimenko [JB]
03/07/2021, 4:23 PMarrow-meta-examples
). But IDE didn't register plugins ><mattmoore
03/08/2021, 4:56 PMAhmed Mourad
03/12/2021, 3:05 AMclassDeclaration
Quote and I'd like to check if the class is annotated with an annotation using the annotation's fqname.
However, when I loop over the its annotationEntries
all their `name`s seem to be null and only `shortName`s are available, also the isAnnotatedWith
function seems to only match for the short name.MaHDi
03/14/2021, 11:38 AMAndrew Handley-Marsh
03/17/2021, 4:40 PMTatum Alenko
04/07/2021, 4:18 AMUnresolved reference
. Is that normal and if so, how does one go about fixing these reference errors? I am using Transform.replace(..)
To be specific in case it is needed, my plugin generates a companion object for abstract classes annotated with @TableName
and creates the same named properties in the companion object with the value being what is passed inside the @ColumnName
annotation. The code runs fine but IntelliJ highlights it as an error:Rachel
04/08/2021, 2:13 PMmaven { url "<https://oss.jfrog.org/artifactory/oss-snapshot-local/>" }
has been replaced by:
maven { url "<https://oss.sonatype.org/content/repositories/snapshots/>" }
1.4.10-SNAPSHOT
artifacts will be removed from the old repository to avoid misunderstandings in the next few minutes.
Thanks!!stojan
04/30/2021, 11:45 AMRachel
05/05/2021, 3:07 PM1.5.0-SNAPSHOT
is being used.
Some changes were introduced today!
compiler-plugin
has been moved to compiler-plugin-core
and there is a new artifact for every compiler plugin.
You can find more details in `arrow-meta-examples` repository and setup
compiler-plugin
for 1.5.0-SNAPSHOT
will be removed tomorrow to avoid misunderstandings.
Thanks for your interest!George Pandian
06/04/2021, 10:09 AMRachel
06/10/2021, 9:06 AMid: io.arrow-kt.arrow
was replaced by a specific Gradle Plugin for every Compiler Plugin:
• io.arrow-kt.refined-types
• io.arrow-kt.proofs
• io.arrow-kt.optics
• ...
• more coming
The artifact of the old Arrow Meta Gradle Plugin for the latest version under development 1.5.0-SNAPSHOT
will be removed tomorrow to avoid misunderstandings.
Sorry for the inconveniences and thanks for your interest! 🙌than_
06/29/2021, 12:14 PMjava.lang.IllegalArgumentException: object is not an instance of declaring class : package.PositiveInt2.Companion.invoke
This happens just by defining new refined type. I tried to copy PositiveInt
and just change the name
class PositiveInt2 private constructor(val value: Int) {
companion object : Refined<Int, PositiveInt2>(::PositiveInt2, {
ensure((it > 0) to "$it should be > 0")
})
}
is it a bug in a io.arrow-kt:arrow-refined-types-gradle-plugin:1.5.0-SNAPSHOT
or am I missing something?Mitchell Skaggs
07/10/2021, 3:02 AMarrow-optics-gradle-plugin
working with Kotlin Multiplatform. It uses a Kotlin compiler plugin, so it should work, right? The properties in the companion object are never generated though, whether I put the data class in commonMain/kotlin
or jvmMain/kotlin
.Nathan Bedell
08/08/2021, 1:22 AM/** Kotlin compiler plugin to automatically derive a Buildable instance for any class
* annotated Buildable. */
val Meta.genBuildable: CliPlugin get() =
"GenBuildable" {
meta(
classDeclaration(
ctx = this,
match = {
// ...
},
map = { (c, d) ->
val dataClass = classAsDataClass(c)!!
Transform.replace(
replacing = c,
newDeclaration = c
.text.`class`.syntheticScope.value!!.also { it ->
it.addDeclaration(
generatePartialClass(dataClass)
.toString()
.declaration<KtDeclaration>()
.value!!
)
it.addDeclaration(
generateCtx(dataClass)
.toString()
.declaration<KtDeclaration>()
.value!!
)
it
}.text
.`class`
)
}
)
)
}
I've tried this, as well as a few similar things. However, every time I try to run my plugin, I get the error:
java.lang.IllegalArgumentException: Missing extension point: org.jetbrains.kotlin.com.intellij.treeCopyHandler in container org.jetbrains.kotlin.com.intellij.core.CoreApplicationEnvironment$1@757c71a1
at org.jetbrains.kotlin.com.intellij.openapi.extensions.impl.ExtensionsAreaImpl.getExtensionPoint(ExtensionsAreaImpl.java:260)
I didn't see any examples like what I'm trying to do in the arrow-meta-examples
, so I was wondering if someone could point me in the right direction with this. I'm planning on making this an open-source project when finished, so I'd be happy to provide the full source code if someone wants to take a closer look -- but any help would be much appreciated!than_
08/16/2021, 12:16 PMpablisco
08/28/2021, 10:04 PMpablisco
08/31/2021, 9:28 AMExtensionPhase
to use to do a check when any function is called. Would it be dotQualifiedExpression
?Benoît
09/09/2021, 9:47 AMDr. Florian Schmidt
09/10/2021, 6:52 PMGamadril
09/19/2021, 12:53 PMNathan Bedell
09/24/2021, 12:00 AMgenerate-sources
for the actual compiler plugin, interfaces
for the interfaces generated by the plugin, and the annotation used, and testmod
to test out the plugin. To check if the plugin is loaded while building testmod
, I currently have a single error message that should get called whenever running the plugin in generate-sources
-- yet testmod
builds successfully without showing this compiler error, so it seems like my plugin isn't getting loaded in testmod
-- but I can't see why (I was able to get this working before, but unfortunately that was before I checked anything into git).
Could someone take a look at my project and see what I'm missing? https://github.com/Sintrastes/buildable-ktNathan Bedell
09/26/2021, 5:27 PMKtClass
? Closest I've been able to get so far is ktClass.parent
, which (assuming the KtClass
sits at top level), I believe gives me a PsiElement
that represents the file that the class sits in. However, even there, I can't see any way to get the package path where the class resides. I'm not seeing anything in the methods of either KtClass
or PsiElement
that would be helpful here. Any ideas?Lukasz Kalnik
10/12/2021, 1:19 PMjimn
10/14/2021, 6:44 AMjimn
10/14/2021, 1:14 PMNathan Bedell
10/15/2021, 2:04 PM.first()
that should have been a .firstOrNull()
that snuck past code review leads to an application crash. Since .first()
is annotated @Throws
I'd at least like to be warned of the possibility of an unhandled exception there that can either be handled, or explicitly suppressed if I can reason to myself it can never happen (Of course, then I'd ideally want to use a NonEmptyList
🙂 -- but the desire to have a plugin like this still stands).