Suggestion: IntelliJ Kotlin plugin's configuration: "Main class" -> "Main package"


#1

I suggest that the Kotlin plugin for IntelliJ have the field "Main class" be renamed to something like "Main package".

Why: I spend hours going in circles because I couldn’t figure out how to set up a Kotlin configuration in Intellij.  I couldn’t figure out what I was supposed to put for the “Main class:” in my run configuration.  It’s a misnomer because it misdirects people to thinking that they need to create a new class with a main function in it, when what they need to do is put in the name of the package that contains their main function.

It could also help if the wizard for creating a Kotlin project provided you with a small main file with a “hello world” and configuration already set up.

For reference: I know about the right click menu NOW, but for whatever reason it wasn’t showing up when I was first trying to figure things out.


#2

Good point! The same applies for me.


#3

You can in fact have 'main' in a class:

class MyMain {
  companion object {
  platformStatic fun main(args: Array<String>) { … }
  }
}

Or in a top-level object:

object MyMainObj {
  platformStatic fun main(args: Array<String>) { … }
}

Because of that, simply renaming “class” to “package” is not a correct thing to do.

On the other hand, IntelliJ IDEA 15 will show the “run” icons for runnable methods in the editor gutter, which will make automatic run configuration setup even more visible, even if you don’t discover the right-click menu action to run a function.