docs: prefer typed objects for closed configuration interfaces

This commit is contained in:
Valdemar Lorenzen
2026-10-09 13:58:57 +02:00
parent 30aa70672e
commit e72f89a7ae
+11
View File
@@ -22,3 +22,14 @@ 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.
## 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.
- 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.
```ruby
config.bind "leader n", config.core.word_next, mode: config.modes.normal
config.lsp["my-language"] = { command: ["my-language-server"], extensions: ["myl"] }
```