Arjan van Wieringen
09/17/2025, 6:46 PMfun doFoo(depA: DependencyA, depB: DependencyB, param: Param) { ... }
you can type doF in IntelliJ and see the possible options that are available in this scope.
However, when you have context parameters you have the above example as follows:
context(depA: DependencyA, depB: DependencyB)
fun doFoo(param: Param) { ... }
you will never get doFoo as suggestion if you do not have proper contextual scope. This makes perfect sense of course! However, it greatly reduces ways to discover API's via IntelliJ, without going fully into docs / source code. I can imagine that working with foreign API's which require context parameters it is hard to find the proper functions.
Are there any ideas around this? E.g, autocomplete/hinting with suggestions that will work if you add more context?Alejandro Serrano.Mena
09/17/2025, 7:04 PMCLOVIS
09/17/2025, 8:17 PMBen Woodworth
09/18/2025, 12:38 AMShift, Shift and searching for the symbol can usually save me from looking through docs. Wondering if the same could help hereCLOVIS
09/18/2025, 5:42 AMCLOVIS
09/18/2025, 5:47 AMusers.findOne {
User::name eq "Fred"
}
users.updateMany {
User::age += 1
}
The methods eq and += are absolutely meaningless outside of the brackets, and it would hurt the developer experience if they appeared there, because the DSL overloads a lot of operators on very common types. Users can't easily create their own instances of the DSL, and even if they do it's very un-idiomatic. It's fully expected that the user can never use these operators outside the DSL.
Thinking about it: all my functions are annotated by an annotation itself annotated with @DslMarker . Maybe that could be the rule? If it's part of a DSL, don't autocomplete when the DSL isn't in scope?Ben Woodworth
09/18/2025, 2:47 PM