Example mono-repo demonstrating the following:
This follows the custom API namespace documentation and is implemented in the ide-ext
package, specifically:
- Backend which registers API support in the plugin host
- Plugin which implements the support for the custom API
- Frontend which exposes API functionality to the frontend via RPC
The API is outlined in the api package
This extension is found in the extension
package with the Theia plugin namespace implemented here.
Four custom methods of calling into Theia are outlined:
- A function handler
- A custom event from Theia
- A custom function in Theia
- Executing a custom command in Theia
Clone this repo and execute:
yarn
Running the VS Code Extension
launch configuration starts an extension host with the vanilla extension running in VS Code:
The extension functionality can be executed using the tree view button exposed in the added view.
Running the Theia IDE
launch configuration starts a browser-based Theia IDE which also loads the extension:
The Extension Menu
allows execution of two communication samples:
Event to extension
fires a custom event in the extension which is then responded to with a call back into TheiaGet message from extension
executes a function handler in the extension