2) For collab editing, it sounds like you want a long-lived channel that would be able to dump text deltas into the editor at any time. This will probably need new API. As you noted, the Editor Context object was designed to become unusable after the lifetime of a single service call, in order to preserve the typical communication pattern we have in Orion (= Orion always begins the conversation with the plugin).
There are 2 ways
I can think of doing this:
i) Relax Orion's communication pattern, for example by allowing plugins to publish events whenever they want.
ii) Provide a dedicated extension point for real-time editing. For example the extension might simply provide a method
startSession(editorContext, filename)
…which Orion invokes when the editing session begins. The extension's implementation of startSession() could simply return a Deferred right away, but leave it unfulfilled. This would keep the Editor Context active for the duration of the editing session, and it could be used at any time to blast text changes into the editor.
Regards,
Mark