Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 3.37 KB

File metadata and controls

57 lines (43 loc) · 3.37 KB

Extension points catalog

Almost everything a plugin contributes is a subclass of colibri.Extension, registered in registerExtensions(reg):

reg.addExtension(new SomeExtension(...));

This is the map. Grep types/colibri.d.ts (or types/phasereditor2d.files.d.ts) for the exact constructor signatures before using one.

Most common

What you want Extension class Notes / recipe
A command (action with optional shortcut, toolbar, menu) colibri.ui.ide.commands.CommandExtension Takes a function (manager) => { manager.add({...}) }. See add-a-command.
A custom editor for a file type colibri.ui.ide.EditorExtension Takes EditorFactory[]. Usually ContentTypeEditorFactory. See add-a-custom-editor.
Recognize a file extension colibri.core.ContentTypeExtension Wraps ContentTypeResolverByExtension. See add-a-content-type-and-new-file.
A "New File" wizard entry phasereditor2d.files.ui.dialogs.NewFileContentExtension In the files plugin, needs phasereditor2d.files.d.ts. Same recipe as above.
Menu entries colibri.ui.controls.menus.MenuExtension Reference your command ids from menu items.

Editor-attached providers (not standalone extensions)

These are returned by your editor, not registered with reg:

What you want Mechanism Notes / recipe
Outline / Blocks content for your editor override getEditorViewerProvider(key) to return a colibri.ui.ide.EditorViewerProvider Compare key === "Outline". See add-a-custom-editor.
Inspector (properties) for your editor's selection override getPropertyProvider() to return a colibri.ui.controls.properties.PropertySectionProvider See add-inspector-properties.

Advanced / less common

What you want Extension class Notes
A whole workbench window colibri.ui.ide.WindowExtension Creates a WorkbenchWindow and its parts (views) via createParts(). This is how the editor adds views; there is no per-view extension — views are parts created by a window or surfaced by an editor's viewer provider.
Custom file storage backend colibri.core.io.FileStorageExtension Abstract; e.g. HTTPServerFileStorageExtension.
An icon for a content type colibri.ui.ide.ContentTypeIconExtension Maps a content type to an icon.
A new theme colibri.ui.ide.themes.ThemeExtension Register a custom editor theme.
Preferences UI / data colibri.ui.ide.PreferencesUIExtension / PreferencesDataProviderExtension Abstract base classes.
Preload project resources at startup colibri.ui.ide.PreloadProjectResourcesExtension Abstract.
MCP server tool colibri.ui.ide.McpServerToolExtension Abstract; expose tooling over MCP.

How to discover more

Every extension class has a static POINT_ID. The types/ folder holds one .d.ts per editor plugin (run npm run update-types to refresh them), so you can search them all at once:

rg "class \w*Extension\b" types/

Then read the class to learn its constructor and what it expects you to provide. Other plugins (scene, pack, code, …) expose their own extension points the same way — search their .d.ts for Extension.