hello! I added this into my gradle: ```withType&lt...
# gradle
m
hello! I added this into my gradle:
Copy code
withType<KotlinCompile>().configureEach {
        kotlinOptions {
            jvmTarget = "1.8"
            freeCompilerArgs = listOf("-Xcontext-receivers")
        }
    }
But when I try to use
context
into a function it looks not detecting it. (I just created a simple JVM project) does anyone have idea what could happen?
t
IDEA not detecting it or build is failing?
m
build is failing
e: /Users/marc/IdeaProjects/untitled2/src/main/kotlin/com/m2f/cronAnalyzer/module/usecase/ParseCommandUseCase.kt: (18, 1):
Expecting a top level declaration
message has been deleted
also IDEa doesn’t know whats going on xD
t
IDEA support is quite limited for context receivers 🙂
m
but it looks not even able to run it…
I mean if I could run it and working I could deal with the lint problems but it doesn’t let me even compile
perhaps is the kotlin plugin that it’s using? i just realized:
message has been deleted
perhaps it should be `1.6.20`… but can see where I cna update uit, it says that everything is up to date
t
ah yeah, context receivers prototype was added in 1.6.20
so then build failure is expected
m
could you tell me hoy can I update the plugin in the CE? I can find the properr way as It says up fully updated 😕
message has been deleted
t
mm, you don't need to update plugin in IDEA, just set proper Kotlin version in Gradle
m
hmm so i did then 😕 but not working either
t
so you have something like this in your
build.gradle
?
m
exactly the same
🤔 1
t
and if you run the build from command line - it fails?
m
message has been deleted
could you telkl me the command to un it form terminal pls? 😅
t
assuming you are on windows it should be something like this:
Copy code
gradlew.bat assemble
m
sorry I’m on mac, should tell you earlyer
but assemble should worrk
t
then
./gradlew assemble
v
Also IDE should even provide you version 1.7 of the plugin if you select stable channel, it was released today.
m
@tapchicoma havibng the same error runnig by terminal
🤔 1
@Vampire it’s weird I always get this:
you can see that it saysd im up to date 😕
t
Probably you need to swap your annotation and
context
- move
context
above
m
i got fixed the annotation but not the context
hmm some weird stuff happening: I manually tryed to update the plugin here: https://plugins.jetbrains.com/plugin/6954-kotlin
v
you can see that it saysd im up to date
Maybe there is not 2021.2 version of the plugin. At least for 2021.3 on, there is:
t
afaik we are not publishing new version of plugins to old IDEA versions
m
hmm, I’m unis the CE though the toolbox App
should I have the last version ? 😕
t
212
is quite old, latest one is
221
m
will double check
t
and I see latest version in toolbox. Probably you need to update toolbox first 🙂
v
But actually according to JetBrains Marketplace there is even for 212 a 1.7 version
t
regarding your original problem - probably better to ask about compilation error in #compiler or open a new YouTrack issue
👍🏻 1
m
will, do. Thank you guys! really appreciate it!
v
Maybe you still have 2021.2.2 or older
m
ye sindeed! the problem was that io hade the IDEA manually downloaded and i tyryed to update it from toolbox but i believe that it could do it
now works like a charm!
context working 😄
👌 2