Is Fleet supposed to handle Kotlin scripts? Like s...
# fleet
r
Is Fleet supposed to handle Kotlin scripts? Like simple
*.main.kts
files? It looks like it kinda knows it's Kotlin code without any auto completion
s
If it's not a Gradle project you won't get auto-complete as far as I understood from this https://youtrack.jetbrains.com/issue/FL-22261/Cant-get-fleet-smart-mode-to-autoformat-my-code-nor-provide-any-autocompletion-options Honestly Amper should have a 1-line configuration which lets you do exactly this in some way, if it doesn't already. Maybe worth a feature request in YouTrack?
r
Right, I guess Fleet just doesn't know that a single
*.main.kts
file is an entire project by itself. I'll try the
build.gradle.kts
workaround, thanks
v
I've got working sample with
*main.kts
file without dependencies, but imports don't work.
Copy code
@file:Repository("<https://repo.maven.apache.org/maven2/>")
@file:DependsOn("io.ktor:ktor-client-core-jvm:2.1.2")
@file:DependsOn("io.ktor:ktor-client-cio-jvm:2.1.2")

import io.ktor.client.*
import io.ktor.client.engine.*


val client = HttpClient(CIO)
r
It works for me if you follow the workaround of the linked issue.
s
Adding an empty
build.gradle.kts
file and letting Fleet add the gradle stuff by itself?
r
Yes. I added all that to .gitignore just like the comment said.
s
So people who would clone that project would need to specifically open it with Fleet so that it does this work for them too right? Still don't love this whole experience tbh. Would be much happier with not having to do that.
r
It's a workaround, of course it's not a fix. It allows to work on scripts with Fleet if needed.
👍 1
s
Wrote this https://kotlinlang.slack.com/archives/C062WG3A7T8/p1717509623306149 here, curious to see if they have any thoughts about that