I've spent a fair amount of time in the past few weeks talking with Christopher Daly in Beaverton. We're working on a way to integrate the cheatsheet linking mechanism with commands. It looks like we will expand how parameterized commands work. Currently, a parameter is just a string. Our proposal is to provide a typing mechanism on parameters that allows us to convert the strings into objects (and vice versa). This would allow someone, for example, to create handlers that work on domain-specific objects, rather than every handler needing to do some conversion on their own
. It would also allow someone to find all commands that work on a particular object type (e.g., all commands that take a java element as a parameter).
Commands and parameters are becoming remarkably similar to Java methods and parameters, except specified in XML. The command definition becomes like an interface, which the handlers all must implement. Then the binding is done dynamically at run-time based on the
activeWhen expression. It's interesting because we can make our language different (i.e., more powerful) than the Java language. Should we allow the type look-up to be more flexible (e.g., allow things like
or or
adapt)?
It also highlights some of the weaknesses of extensions as API. As it stands right now, most ids defined in extensions become equivalent to API (e.g., view id, command id, editor id, etc.). But there is no real means to provide documentation. So, if the parameters for a command define an API contract, where does one put the documentation?