Marc Knaup
11/18/2020, 3:04 AMfoo in the DSL scope is almost always supposed to be used as a function and has operator fun invoke.
Manually writing foo("abc") works fine.
However autocompletion will complete fo<caret> as foo<caret>, instead of foo(<caret>) like it would for functions.
That means DSL users have to type a lot more (there are hundreds of such instances). If they’re new to the DSL they may not even see that such properties can be invoked as a function.
❔ Is there any way or trick to make the IDE autocomplete foo as a function invocation by default?
class Foo { operator fun invoke(bar: String) }
object FooScope { val foo = Foo() }
fun dslTest() {
with(FooScope) {
fo<caret>
}
}Marc Knaup
11/18/2020, 3:18 AMMatteo Mirk
11/18/2020, 9:51 AMMatteo Mirk
11/18/2020, 9:51 AM