2.3 KiB
2.3 KiB
Description
The @theia/api-provider-sample extension is a programming example showing how to define and provide a custom API object for plugins to use.
The purpose of the extension is to:
- provide developers with realistic coding examples of providing custom API objects
- provide easy-to-use and test examples for features when reviewing pull requests
The extension is for reference and test purposes only and is not published on npm (private: true).
Greeting of the Day
The sample defines a gotd API that plugins can import and use to obtain tailored messages with which to greet the world, for example in their activation function.
The source code is laid out in the src/ tree as follows:
gotd.d.ts— the TypeScript definition of thegotdAPI object that plugins import to interact with the "Greeting of the Day" serviceplugin/— the API initialization script and the implementation of the API objects (GreetingExtand similar interfaces). All code in this directory runs exclusively in the separate plugin-host Node process, isolated from the main Theia process, together with either headless plugins or the backend of VS Code plugins. TheGreetingExtImpland similar classes communicate with the actual API implementation (GreetingMainImpletc.) classes in the main Theia process via RPCnode/— the API classes implementingGreetingMainand similar interfaces and the Inversify bindings that register the API provider. All code in this directory runs in the main Theia Node processcommon/— the RPC API Ext/Main interface definitions corresponding to the backend of thegotdplugin API
Additional Information
License
- Eclipse Public License 2.0
- 一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception
Trademark
"Theia" is a trademark of the Eclipse Foundation https://www.eclipse.org/theia