Plugin capabilities
Optional interfaces any plugin may add — provider or tool. The host detects each with a type check at load, so a plugin opts in simply by implementing the interface. Nothing changes in the manifest.
Persistent settings — declared
Plugin-wide values the user sets once (a path to an external binary, a default folder) that apply to every use of the plugin. Declare the fields; the host renders the form in Settings › Plugins and persists the values keyed by plugin id.
PluginSettingFieldType is Text | Bool | Choice | File | Folder; Group
sections the pane under headers. At run time a tool reads a value with
context.Host.GetPluginSetting("binaryPath").
Persistent settings — your own view
Values still flow through GetValue/SetValue, so the host persists them the same way either way.
A plugin may implement both routes; the host prefers the custom view when present.
Keyboard shortcuts
Register global shortcuts that appear in Settings › Keyboard under your plugin's own section, where the user can rebind or clear them. They share the host's live conflict detection, persistence and rebinding with the built-in shortcuts.
- The
Modtoken maps to the platform's primary modifier — Cmd on macOS, Ctrl elsewhere — so"Mod+Shift+B"ships as ⌘⇧B on a Mac and Ctrl+Shift+B otherwise. Use plainCtrlwhen you deliberately want the same key everywhere. - Ids are namespaced by the host, so two plugins can use the same local id. Keep yours stable — it is persisted.
- The callback runs on the UI thread: capture what you need when you build the contribution, and offload heavy work yourself.
Referencing Avalonia for a custom view
Custom views return an Avalonia Control. Add Avalonia so the plugin compiles, but keep the
host's copy authoritative across the ALC boundary:
A plugin that only uses declared fields needs no Avalonia reference at all.
Writing the view as an .axaml UserControl works exactly like building it in C#: the
XAML compiler turns it into a call that constructs the same control tree at compile time, resolved against
that same ExcludeAssets="runtime" reference — no extra ALC risk.
Theming a custom view
The host applies its theme through Avalonia's ThemeVariant system, and your control is hosted
inside the app's visual tree, so it inherits fonts and colours without doing anything. Standard controls
already look right.
To match host chrome deliberately, reference the published theme brushes with DynamicResource
— not StaticResource, or your control won't follow a live light/dark switch.
| Key | Use |
|---|---|
SEWindowBgBrush / SEPanelBgBrush / SESecondaryBgBrush / SEToolbarBgBrush | Surface backgrounds |
SEHairlineBrush / SEHoverBgBrush / SESelectionBgBrush | Borders and interactive states |
SETextPrimaryBrush / SETextSecondaryBrush / SETextFaintBrush | Text |
SEAccentBrush / SEAccentHoverBrush / SEAccentPressedBrush / SEAccentFgBrush | Accent colour and its states |
SEStatusConnectedBrush / SEStatusErrorBrush / SEStatusBusyBrush / SEStatusWaitingBrush | Status indicators |
SEControlRadius / SEPanelRadius / SEHairlineThickness / SEMonoFont | Corner radius, border thickness, monospace font |
SQL Explorer