Run any function from IDEA

Wouldn’t it be great if we could run any function inside an object from IntelliJ IDEA? Or those marked with @Script. Consider:

object Tool {
  @Script
  fun runA() {
    // ...
  }

  @Script
  fun runB() {
    // ...
  }
}

Currently, one can run any main function, but it has a severe limitation of one per file which is extremely restricting.

This can “kind of” be done even now if I mark a function with @Test but alas, it makes it run every time when tests are run which I don’t want… Please give us ability to run any function from IDE.

3 Likes