https://kotlinlang.org logo
#intellij
Title
# intellij
e

Eugen Martynov

02/17/2023, 4:47 PM
How to work with kotlin script in IDE. I have python project and I want to write a quick kotlin script. I created kts file. But no autocompletion or import works.
m

mbonnin

02/17/2023, 4:52 PM
Name it foo.main.kts
It needs to end with
.main.kts
e

Eugen Martynov

02/17/2023, 4:55 PM
oh, main!
let me try
That works!
🎉 1
Super
m

mbonnin

02/17/2023, 4:58 PM
Other thing to know is that the resolver doesn't understand Gradle metadata so you need to import JVM artifacts:
Copy code
@file:DependsOn("com.github.ajalt.clikt:clikt-jvm:3.1.0") // not :clikt:3.1.0
Besides that it's pretty cool
😮 1
👀 2
e

Eugen Martynov

02/17/2023, 5:09 PM
That I already found! Thank you so much!
💙 1
m

mbonnin

02/17/2023, 5:09 PM
Sure thing! Happy scripting!
👍 1
K 2
3 Views