https://kotlinlang.org logo
#fleet
Title
# fleet
s

Sebastian Schuberth

11/15/2023, 3:35 PM
Can I somehow setup / configure Fleet to work as an editor (with syntax highlighting and auto-completion) for my own custom Kotlin scripts? So I have created my own
BasicJvmScriptingHost
which is available as an artifact on Maven Central, and I want my users to have an easy / lightweight way to write scripts for it. Any suggestions?
s

Stylianos Gakis

11/15/2023, 8:53 PM
According to this https://youtrack.jetbrains.com/issue/FL-22261/Cant-get-fleet-smart-mode-to-autoformat-my-code-nor-provide-any-autocompletion-options it seems like Fleet needs the project to be more than just a file to be able to go into “smart mode” and properly work as an IDE. This comment seems to specifically mention this. I hope I understood your comment correctly here.
s

Sebastian Schuberth

11/16/2023, 7:07 AM
So, I've found out that Fleet, pretty much in the same way as IntelliJ, supports auto-completion for custom Kotlin scripts as long as the folder you open contains a (Gradle) project that has the script definitions as a dependency. In sich a scenario you can open your *.custom.kts file and get auto-completion. See e.g. https://github.com/oss-review-toolkit/ort-config/pull/142 which adds the minimum files to get auto-completion in otherwise independent *.custom.kts files working.
FYI, I've filed https://youtrack.jetbrains.com/issue/FL-23328/Make-is-easier-to-work-with-custom-Kotlin-scripts with a proposed solution (editor settings to specify artifacts with the script definitions).
s

Stylianos Gakis

11/17/2023, 11:35 AM
Thanks for the link! Since I feel like the initial response is just gonna be the same as I got in the issue I filled, I answered with a question regarding if Amper could perhaps fill this gap here. Let’s hear what JetBrains folks think about this one.
s

Sebastian Schuberth

11/17/2023, 11:36 AM
Or at least the Fleet plugin API should have the necessary interface to implement a functionality like this. Then we could write our own convenience plugin to do this.