diff options
| author | David Moc <personal@cdatgoose.org> | 2026-06-02 14:15:25 +0200 |
|---|---|---|
| committer | David Moc <personal@cdatgoose.org> | 2026-06-02 14:15:25 +0200 |
| commit | b68766967c86a6a789d65772f69f7f44939ebdf2 (patch) | |
| tree | c65d5a929931d9d52b5717f6577a876d73e66491 /docs/plugin-api.md | |
| parent | a15cb041654ae307add0b998b526c87c3f42bf5f (diff) | |
Add API completion signatures
Diffstat (limited to 'docs/plugin-api.md')
| -rw-r--r-- | docs/plugin-api.md | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/plugin-api.md b/docs/plugin-api.md index 04851ed..76051f9 100644 --- a/docs/plugin-api.md +++ b/docs/plugin-api.md @@ -221,14 +221,24 @@ ecex_completion_provider_set_detail(ed, "demo-words", "C runtime symbol"); `ecex_completion_provider_add_words` accepts a whitespace-separated string literal, copies the words on the host, and avoids depending on JIT string-array indexing. Provider details are optional minibuffer labels shown while cycling. +Use `ecex_completion_provider_add_word_detail` for one word with its own label, +or `ecex_completion_provider_add_entries` for newline-separated entries in +`word<TAB>detail` form: + +```c +ecex_completion_provider_add_entries(ed, + "demo-words", + "malloc\tvoid *malloc(size_t size)\n" + "free\tvoid free(void *ptr)\n"); +``` The built-in `indent-for-tab-command` is bound to `TAB`; `config/c_mode_plugin.c` defines `c-mode`, overrides `TAB` with `c-indent-line`, registers C-family file handlers, and adds clangd completion when `clangd` is installed. Clangd completions use label details when available, so functions display signatures and return types. `config/ecex_api_completion_plugin.c` is the `ecex-mode` -plugin; it registers global ecex API completions and special-cases `ed->` field -names using word completion providers. +plugin; it registers global ecex API completions with signature details and +special-cases `ed->` field names using typed word completion entries. ```c ecex_add_clangd_completion_provider(ed, "c-mode-clangd", "c-mode"); |
