docs: prefer typed objects for closed configuration interfaces
This commit is contained in:
+11
@@ -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"] }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user