I'm trying to expose some APIs for developers via an interface. However, due to modularity in functions, I've broken a list of functions into several interfaces. Instead of doing:
interface IAllFeatures {
fun A() {}
fun AA() {}
fun B() {}
fun BB() {}
fun C() {}
fun CC() {}
}
interface SampleInterface : IAllFeatures {
}
I have it separated as:
interface IA {
fun A() {}
fun AA() {}
}
interface IB {
fun B() {}
fun BB() {}
}
interface IC {
fun C() {}
fun CC() {}
}
interface SampleInterface : IA, IB, IC {
}
In the first implementation, IAllFeatures displays all the functions in bold text in the code completion popup. However, in the second implementation, SampleInterface displays all functions in non-bold text and is no longer given priority in the list of code completion suggestions. Is there a way to have the best of both worlds, separating interface categories while giving developers clear code completion suggestions?
The whole point of the bold text is to show which methods are overriden/declared newly. If they are not overriden but inherited, they will not be bold. Unfortunately, the fix is, essentially, to use the first solution. You could override each method to call the super if you want, but that's pretty hacky.