Imran/Malic
10/29/2019, 4:21 PM.class
) to a directory, which is within the Idea Instance we create during each test. Similar what we do know with the existing compiler plugin test’s.
We’re blocked on that.Rachel
10/29/2019, 4:32 PMImran/Malic
10/29/2019, 4:37 PMpackage test
import arrow.higherKind
@higherkind
class Id<out A>(val value: A)
val x: IdOf<Int> = Id(1)
How would I get the package which is generated with all the descriptors we generate?
Or in the case of typeclass plugin.
object Test {
fun <F> Kind<F, Int>.addOne(M: Mappable<F> = given): Kind<F, Int> =
map { it + 1 }
}
which we transform to
object Test {
fun <F> Kind<F, Int>.addOne(M: Mappable<F> = given): Kind<F, Int> =
M.run { map { it + 1 } }
}
Imran/Malic
10/29/2019, 4:40 PMImran/Malic
10/29/2019, 4:41 PMImran/Malic
10/29/2019, 4:43 PMHow to pass Strings to compiler-plugins
and move forward.shikasd
10/29/2019, 4:57 PMStrings to compiler plugins
- gradle config?shikasd
10/29/2019, 4:58 PMJoachim Ansorg
10/29/2019, 5:41 PMJoachim Ansorg
10/29/2019, 5:45 PM.class
files in a folder called build
, which is Gradle's default.
If the references can't be resolved, then red error markers are shown in the editor.
Now we'd like add CI tests to the IntelliJ plugin to make sure the reference resolving, etc. is working as it should.Joachim Ansorg
10/29/2019, 5:45 PMJoachim Ansorg
10/29/2019, 5:51 PM.kt
files on disk and let Gradle generate the data before gradle test
is run. The IDE tests copies that data into the temporary IntelliJ project and then runs the tests which use itJoachim Ansorg
10/29/2019, 5:52 PMJoachim Ansorg
10/29/2019, 5:53 PMImran/Malic
10/29/2019, 5:58 PMRachel
10/29/2019, 6:09 PM.class
are located
3. Load those classes
4. Run a function and check the result
Could it be useful for you?Joachim Ansorg
10/29/2019, 6:18 PM.class
data in a test for a code snippet, then IntelliJ could make use of the .class
dataRachel
10/29/2019, 6:30 PMImran/Malic
10/29/2019, 6:50 PMcompile
https://github.com/arrow-kt/arrow-meta/blob/8882df9702cc57bf0e637fa8eeb8aef0a293fc3a/testing-plugin/src/main/kotlin/arrow/meta/plugin/testing/TestingLibraryWrapper.kt#L20
to get the MetaData the example is similar to what is defined here https://github.com/arrow-kt/arrow-meta/blob/623b75e5db4cccda40f5cfd4ead0616d30372be5/compiler-plugin/src/test/kotlin/arrow/meta/plugins/typeclasses/TypeClassesTest.kt#L68
Only that we will process this code within an ide environment.
Unfortunately, we can not add the compiler-plugin to the Ide Environment, yet.
That’s why we needed help to get the MetaData. What we can do instead is add generated files to the build folder, which exists in the Ide instance.Imran/Malic
10/29/2019, 6:52 PMtschuchort
10/29/2019, 7:09 PMImran/Malic
10/29/2019, 7:10 PMtschuchort
10/29/2019, 7:14 PMtschuchort
10/29/2019, 7:16 PMKotlinCompilation.Result::outputFolder
and let intellij do its thing.tschuchort
10/29/2019, 7:19 PMtschuchort
10/29/2019, 7:22 PMComponentRegistrar
directly. But a PR for that is practically finished and will be merged and released within the next few days.Rachel
10/29/2019, 7:26 PMoutputFolder
though we don't show that directory to the user because we created a specific way to write assertions for a compiler plugin. @Imran/Malic, if compiler-plugin cannot be added to the IDE environment yet, how are code snippets being compiled right now?Rachel
10/29/2019, 7:39 PMImran/Malic
10/29/2019, 8:18 PMImran/Malic
10/29/2019, 8:20 PMtschuchort
10/29/2019, 8:22 PMoutputFolder
is a property of the result you get back. The tricky part is passing the compiler plugin you want to test over the pluginClasspath
. This won't be necessary anymore as soon as PR #27 is merged, then you can just pass a reference to the ComponentRegistrar
directlyImran/Malic
10/29/2019, 9:05 PMtschuchort
10/29/2019, 9:14 PM