Configure Formatting in Eclipse

It seems the Kotlin Eclipse plugin does support formatting. However, I couldn’t find any way to configure the formatting parameters. All I could find was kotlin-eclipse/kotlin-formatting.xml at master · JetBrains/kotlin-eclipse · GitHub. Is there any way to configure the formatting?

Right now there is no way to configure formatting parameters through the UI. Nevertheless custom parameters are supported and to specify them you need to extend KotlinPredefinedCodeStyle from kotlin repo. You can also find there some other implementations. After that you only need to register your class to org.jetbrains.kotlin.core.predefinedKotlinCodeStyle extension point in your eclipse instance.

I’m aware that this way of doing things is quite tiresome and I assure you that we will be more than happy to provide some graphical interface to specify custom parameters, but eclipse plugin development team has limited resources and there are some much more pressing issues to solve. We also assumed that the two predefined code styles will be enough for 90% of users, as official style guide is widely accepted.

About the file you have linked: it was only used for internal code style in kotlin-eclipse project. It is now obsolete and never was included in any of plugins that were installed by end users.

My issue is the indentation by 4 spaces, I just use 2. There would probably be others once I get into it. I wouldn’t mind editing a configuration file, it’s not something you need to change a lot. So just the UI to specify the configuration file would be needed.

Hello @pawel.marks
Is there a way to make the same as with Java Editor- save actions in eclipse? Meaning that on save it formats the code? Also in the documentation i read that the plugin uses the java editors formatting, is that not so?

Thanks,
Daniel