ID:WORK-057Status:readyPriority:mediumComplexity:moderateMilestone:v0.9.0
Editor Registry-Powered Autocomplete
Summary
The entity registry enables intelligent autocomplete throughout the editor. Since the registry contains every named entity across the project, the editor can suggest entity names, page references, and rune attributes as the author types.
Acceptance Criteria
- Bold text autocomplete: typing
**VessuggestsVeshrawhen a character entity with that name exists in the registry - Autocomplete popup shows entity type and source page alongside the name
- Rune attribute autocomplete: typing
{% bond from="suggests character and faction names from the registry - Page reference autocomplete: in
nav,prerequisite, and page-slug attributes, suggest from registered pages - Design token autocomplete: inside
sandboxCSS content, typingvar(--suggests design tokens from the registry - Term awareness: words matching registered
conceptterms show a subtle indicator (dotted underline) in the source view - Cross-package attribute awareness: autocomplete for
characterattributes includes both core and extension attributes, indicating which package provides each
Approach
Build on the background entity registry from WORK-056. Add completion providers to the editor's CodeMirror/Monaco instance that query the registry:
- Bold text provider: Detect cursor inside
**...**, query registry for entity names matching the partial text - Attribute value provider: Detect cursor inside a rune attribute value, determine the attribute name, query registry for appropriate entity types (e.g.,
from/to→ characters + factions) - Page reference provider: Detect page slug attributes, query registry for all
pageentities - Design token provider: Detect
var(--inside sandbox content, query registry fordesign-tokenentities - Term indicator: On document change, scan visible text for matches against
termentities, apply decorations
References
- SPEC-002 (Cross-Page Pipeline — Registry-Powered Autocomplete)
- WORK-056 (Editor Background Entity Registry)