From b68766967c86a6a789d65772f69f7f44939ebdf2 Mon Sep 17 00:00:00 2001 From: David Moc Date: Tue, 2 Jun 2026 14:15:25 +0200 Subject: Add API completion signatures --- docs/plugin-api.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'docs/plugin-api.md') 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 +`worddetail` 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"); -- cgit v1.2.3