refactor: derive canonical commands from core actions and centralize aliases

This commit is contained in:
2026-10-11 02:48:13 +02:00
parent 9a34669c08
commit 54bb196192
12 changed files with 352 additions and 88 deletions
+6 -1
View File
@@ -23,10 +23,15 @@ The presentation and input experience through which a user interacts with an edi
**Capability**:
A named frontend ability required by a feature for compatibility, not a permission granted to that feature.
**Canonical Ex command**:
The full command name of a command-capable core action, without its `core.` prefix. For example, `core.quit` names the canonical `quit` command.
**Command alias**:
A shorthand spelling of a canonical Ex command, such as `q` for `quit`. An alias refers to the same action, not a separate command implementation.
## Configuration interfaces
- Prefer typed objects for editor-owned actions, modes, and other closed sets. Expose new core binding targets through `config.core` rather than requiring command-name strings.
- `src/editor.rs`'s `CORE_ACTIONS` is authoritative for core action names, eligibility, and Ex aliases. Ruby action methods and nested namespaces, protected core command registration, and palette entries are generated from this catalog; add or rename actions there rather than maintaining separate lists.
- Use strings for open-ended identifiers: language IDs, paths, and external plugin command names. Interactive Ex command names remain textual.
- Ruby action/mode objects provide validation during configuration evaluation and discoverable members, not compile-time enum safety.