refining the default substitution menu
Hello
I am making a DSL that includes overloaded function definitions. The default functioncall substitution menu works fine for regular functions, but if there are multiple function definitions with the same name and different types, then all of these look exactly the same in the completion menu. I would like to override the description, but keep all the other functionality (finding all the functions within scope, excluding based on constraints) that is already provided by the default menu. This seems possible with the wrap substitution menu, but I ran into some issues while trying to implement that.
If I make a new default menu wrapping the old default menu, then autocompletion for functioncalls completely stops working. This might happen because the new menu is overriding the old one, making it unavailable for wrapping, or for some other unknown reason.
Making the new menu a named menu and including it manually works, but then all autocomplete options are shown twice, because the default menu is also still working.
I can't make a new substitution menu from scratch, because I don't know how to reimplement the smart reference autocompletion that is provided in the default menu.
There is probably some way to do this, but I don't really know where to look at this point. Any advice is appreciated.
Please sign in to leave a comment.
If my understanding is correct you only want to customize the "description" that is displayed in the completion menu.
For this you may well just make the substitute menu for your function call explicit and calculate the desired text, perhaps by delegating to the actual "definition" concept's behavior.
This was exactly what I needed to fix my problem. I had missed the existence of reference actions somehow. Thank you for your response.