package editor
Constants
ActionEditorBuild
editor_action
ActionEditorBuildDebug
editor_action
ActionEditorBuildRelease
editor_action
ActionEditorBuildAndRun
editor_action
ActionEditorBuildAndRunDebug
editor_action
ActionEditorBuildAndRunRelease
editor_action
ActionEditorRunCurrentStage
editor_action
ActionEditorSaveStage
editor_action
ActionEditorUndo
editor_action
ActionEditorRedo
editor_action
ActionEditorOpenPalette
editor_action
ActionStageSelectAll
editor_action
ActionStageClearSelection
editor_action
ActionStageSelectByID
editor_action
ActionStageDeleteSelection
editor_action
ActionStageDuplicate
editor_action
ActionStageRemoveFromParent
editor_action
ActionStageSpawnEntity
editor_action
ActionStageSpawnCamera
editor_action
ActionStageSpawnLight
editor_action
ActionStageSpawnPrimitive
editor_action
ActionStageSpawnCube
editor_action
ActionStageSpawnSphere
editor_action
ActionStageSpawnPlane
editor_action
ActionStageSpawnCapsule
editor_action
ActionStageSpawnCylinder
editor_action
ActionStageSpawnCone
editor_action
ActionStageSpawnArrow
editor_action
ActionStageSetGridVisible
editor_action
ActionStageToggleViewportLayout
editor_action
ActionStageToggleContentPanel
editor_action
ActionStageToggleHierarchyPanel
editor_action
ActionStageToggleDetailsPanel
editor_action
ActionStageRenameActor
editor_action
ActionStageFocusSelection
editor_action
ActionStageAlignWithView
editor_action
ActionStageTransformMove
editor_action
ActionStageTransformRotate
editor_action
ActionStageTransformScale
editor_action
ActionStageWireframeMove
editor_action
ActionStageWireframeRotate
editor_action
ActionStageWireframeScale
editor_action
ActionStageCreateTemplate
editor_action
ActionTerrainDecreaseBrushRadius
editor_action
ActionTerrainIncreaseBrushRadius
editor_action
ActionTerrainDecreaseBrushStrength
editor_action
ActionTerrainIncreaseBrushStrength
editor_action
ActionEditorOpenWorkspace
editor_action
ActionLuaRunScript
editor_action
Functions
CreateNewProjectFromCLI
RegisterPlugin
RegisterPlugin records a plugin implementation in the compiled-in plugin registry. It is called from each plugin's package init() function.
Convention: pluginKey MUST equal the plugin's Go module path (as
declared in the plugin's go.mod module line). The startup validator
(validateCompiledPlugins → MissingCompiledPlugins) depends on this
convention to match enabled entries in plugin.json against the compiled-in
registry. A best-effort heuristic emits a slog.Warn if the supplied key
does not contain a slash, since real Go module paths almost always do (e.g.
"go.digitalxero.dev/kaiju-code", "github.com/foo/bar"). Registration still
proceeds — the warning is purely advisory so authors can fix their plugin
without bricking the editor.
Example call shape (placed inside the plugin's package init()):
func init() { editor.RegisterPlugin("go.digitalxero.dev/kaiju-code", &Plugin{}) }
Why the convention matters: when a fresh editor binary is built from source, plugins that are Enabled=true in plugin.json but absent from the compiled-in registry are surfaced via a startup modal that offers to recompile the editor with them included. The validator joins the two sets by module path, so a mismatched key would produce a false positive on every launch.
Types
Editor
struct
Editor is the entry point structure for the entire editor. It acts as the delegate to the various systems and holds the primary members that make up the bulk of the editor identity.
The design goal of the editor is different than that of the engine.Host, as it is not intended to be passed around for access to the system. Instead it will supply interface functions that are needed to the systems that it holds internally.
Editor.Actions
Editor.ApplyWorkspaceConfigChanges
ApplyWorkspaceConfigChanges is called by the settings workspace after the user toggles enable/visible or reorders a workspace. Re-runs reconciliation (which may shut down workspaces that are now disabled, initialize newly- enabled ones), rebuilds the menu bar tab strip, and switches the active workspace if the current one has been disabled.
Editor.BlurInterface
FocusInterface is responsible for disabling the input on the various interfaces that are currently presented to the developer. This primarily includes the menu bar, status bar, and whichever workspace is active.
Editor.Build
Editor.BuildAndRun
Editor.BuildAndRunCurrentStage
Editor.Cache
Editor.ConnectSelectedAsDistanceChain
Editor.ConnectSelectedAsHingeChain
Editor.ConnectSelectedAsRope
Editor.ContentPreviewer
Editor.CreateCssStylesheetFile
Editor.CreateHtmlUiFile
Editor.CreateNewCamera
Editor.CreateNewEntity
Editor.CreateNewLight
Editor.CreateNewStage
Editor.CreatePluginProject
Editor.CreatePrimitive
Editor.Events
Editor.FileDropRouter
Editor.FocusInterface
FocusInterface is responsible for enabling the input on the various interfaces that are currently presented to the developer. This primarily includes the menu bar, status bar, and whichever workspace is active.
Editor.History
Editor.Host
Editor.IsInputFocused
Editor.MissingCompiledPlugins
MissingCompiledPlugins returns the enabled plugins from editor_plugin.AvailablePlugins() whose Go module path is NOT a key in the compiled-in editorPluginRegistry — i.e., plugins the user marked Enabled=true in plugin.json but that the current editor binary does not contain. The set is used by the startup-validation modal (validateCompiledPlugins) to offer a Recompile-or-Continue choice.
Behaviour notes: - Disabled plugins (Config.Enabled == false) are ignored entirely. - Plugins whose module path is in ed.sessionDisabledPlugins are skipped so the modal does not repeat within one process after the user chose "Continue" (which session-disables the missing entry). - Git-source plugins (Path starts with "git://") cannot be inspected for a local go.mod; they are reported as missing if not in the registry, with a slog.Warn so users see the cause. - Per-plugin failures during go.mod parsing are slog.Warn-logged and the plugin is treated as missing (better to surface a stray modal than to silently mask a misconfiguration).
The current implementation cannot return a non-nil error — the signature reserves room for future failure modes (e.g. registry inspection errors) without an API break.
Editor.OpenCodeEditor
OpenCodeEditor will run a command specified in CodeEditor settings entry directly to the project top level folder. This is an exposed function to meet the interface needs of menu_bar.MenuBarHandler. func (ed *Editor) OpenVSCodeProject() {
Editor.Project
Editor.ProjectFileSystem
Editor.RecompileWithPlugins
func (ed *Editor) RecompileWithPlugins(plugins []editor_plugin.PluginInfo, onComplete func(err error)) error
Editor.SaveCurrentStage
SaveCurrentStage will save the currently open stage file. This is an exposed function to meet the interface needs of menu_bar.MenuBarHandler.
Editor.SaveCurrentStageWithCallback
Editor.SelectWorkspace
SelectWorkspace switches the active workspace to the one identified by id. Errors out if the id is unknown to the active workspace set (e.g. workspace is disabled or never registered).
Editor.SetGridVisible
SetGridVisible records the developer's preference for the editor viewport grid, persists it to the global editor settings, and applies the change to the live stage view if one is initialized.
Editor.Settings
Editor.ShowReferences
ShowReferences opens the references viewer overlay for the given content id. This sits on the editor (not on a workspace) because the overlay is a chrome-level surface, not part of any workspace's UI document.
Editor.StageView
Editor.StageWorkspace
Editor.StalePlugins
StalePlugins returns the enabled plugins from
editor_plugin.AvailablePlugins() whose source folder contains a .go /
go.mod / go.sum file newer than the running editor binary's mtime — i.e.,
plugins the user has edited since the last go build of the editor. The set
is used by the startup-validation modal (validateCompiledPlugins) alongside
MissingCompiledPlugins to offer a Recompile-or-Continue choice.
Behaviour notes:
- Disabled plugins (Config.Enabled == false) are ignored.
- Plugins NOT in editorPluginRegistry are skipped — they are the "missing"
case owned by MissingCompiledPlugins; including them here would
double-list them in the modal.
- Git-source plugins (Path prefixed with "git://") are skipped: there is
no local source tree to walk, and a git plugin can only become stale via
a fresh go get, which is its own workflow.
- On os.Executable() / stat failure: slog.Warn + return (nil, nil).
Fail-quiet — better silence than false-positive modals.
- On per-plugin module-path resolution or walk failure: slog.Warn + skip
the plugin. Defensive: false negatives are preferable to surfacing a
stale flag with no actionable source data.
The current implementation cannot return a non-nil error — the signature reserves room for future failure modes without an API break.
Editor.UpdateSettings
Editor.Workspace
Workspace returns the live instance for a given id. Used by callers that need a typed-service interface from another workspace via type assertion.
Editor.WorkspaceSelected
WorkspaceSelected switches the active workspace to the one with the given id. Called by the menu bar when the user clicks a tab and by plugins via editor_workspace.WorkspaceEditorInterface.SelectWorkspace.
Editor.Workspaces
Workspaces returns the set of currently active (enabled) workspaces in load order. Excludes disabled workspaces; includes hidden ones (Visible=false).
EditorGame
struct
EditorGame satisfies [bootstrap.GameInterface] and will allow the engine to bootstrap the editor (as it would a game).
EditorGame.ContentDatabase
EditorGame.Launch
EditorGame.PluginRegistry
FileDropRouter
struct
WorkspaceState
WorkspaceState is the id of the currently active workspace. Empty string means "none active". The set of valid values is determined at runtime by what's in the workspace registry, not by a hard-coded enum.
const WorkspaceStateNone WorkspaceState = ""