This is just a formatter for Kotlin (.kt
) and KotlinScript (.kts
)
Make sure you have ktlint installed before installing this extension
You need the ktlint jar file and either have it in your project root or specify its location in the vscode settings (ktlintPath
)
You can either use the kotlin-formatter.formatKotlin
command or set cstef.kotlin-formatter
as your default formatter in VScode settings
Set cstef.kotlin-formatter
as your formatter for kotlin
and/or kotlinscript
in VScode's settings.json
:
{
...
"[kotlin]": {
"editor.defaultFormatter": "cstef.kotlin-formatter"
},
"[kotlinscript]": {
"editor.defaultFormatter": "cstef.kotlin-formatter"
}
...
}