From 9641486b3ede669b77130a12b0fc17681b8a6cc5 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Tue, 29 Oct 2024 21:29:19 +0800 Subject: [PATCH] Update readme. --- README.md | 4 ++-- README.zh-CN.md | 4 ++-- acm/acm.el | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index de65b7a131..fa741354d3 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ and run `doom sync` to install it. Please note: 1. When using lsp-bridge, please first disable other completion plugins, such as lsp-mode, eglot, company, corfu, etc. lsp-bridge provides a complete solution from the completion backend, completion frontend to multi-backend integration -2. In addition to providing LSP completion, lsp-bridge also provides many non-LSP completion backends, including capf, file words, paths, Yas/Tempel, TabNine, Codeium, Copilot, Citre, Ctags, Org roam and other completion backends. If you expect to provide these completions in a certain mode, please add the corresponding mode to `lsp-bridge-default-mode-hooks` +2. In addition to providing LSP completion, lsp-bridge also provides many non-LSP completion backends, including capf, file words, paths, Yas/Tempel, TabNine, Codeium, Copilot, Tabby, Citre, Ctags, Org roam and other completion backends. If you expect to provide these completions in a certain mode, please add the corresponding mode to `lsp-bridge-default-mode-hooks`. Customize the order of backend, please check `acm-backend-order`. 3. Please do not perform ```byte compilation``` or ```native compilation``` for lsp-bridge as it will result in a difference in API and the latest version after upgrading compiling afterwards, Lsp-bridge is designed with multi-threading that does not require compilation to speed it up ## Local Usage @@ -313,6 +313,7 @@ lsp-bridge provides support for more than two language servers for many language - `lsp-bridge-peek-list-height`: Select the next option for definition and reference - `lsp-bridge-peek-ace-keys`: Keys to press when performing `lsp-bridge-peek-through` - `lsp-bridge-peek-ace-cancel-keys`: Keys to exit `lsp-bridge-peek-through` +- `acm-backend-order`: Customize the order of the completion backends - `acm-frame-background-dark-color`: Menu background color in dark theme - `acm-frame-background-light-color`: Menu background color in light theme - `acm-enable-capf`: Provides capf completion support for non-LSP backends, it is disabled by default @@ -330,7 +331,6 @@ lsp-bridge provides support for more than two language servers for many language - `acm-enable-lsp-workspace-symbol`: Enable LSP workspace symbol completion, disabled by default - `acm-doc-frame-max-lines`: Max line number of help documentation, default is 20 - `acm-candidate-match-function`: lsp-bridge frontend filter algorithm for candidates, options include `'regexp-quote`, `'orderless-flex`, `'orderless-literal`, `'orderless-prefixes`, `'orderless-regexp`, `'orderless-initialism`, default is `regexp-quote`, orderless-* started algorithms require additional installation of [orderless](https://github.com/oantolin/orderless) -- `acm-completion-backend-merge-order`: Customize the order of the completion backends, default order is: first part of mode candidate, first part of template candidates, tabnine/copilot/codeium, second part of template candidates, second part of mode candidates, set `acm-completion-mode-candidates-merge-order` customize mode candidates order - `acm-completion-mode-candidates-merge-order`: Customize the order of the mode candidates, the display order for mode candidates, default order: Elisp、 LSP、 Jupyter、 Tabby Ctags、 Citre、 ROAM、 Word、 Telegra - `acm-backend-lsp-candidate-min-length`: The minimum characters to trigger lsp completion, default is 0 - `acm-backend-lsp-block-kind-list`: Filters certain types of LSP completion candidates. By default, it's a empty list. When the value is set to `'(Snippet Enum)`, this means that Snippet and Enum completions will not be shown. diff --git a/README.zh-CN.md b/README.zh-CN.md index f49140c66a..46bcb4b795 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -90,7 +90,7 @@ lsp-bridge 的优势: 请注意: 1. 使用 lsp-bridge 时, 请先关闭其他补全插件, 比如 lsp-mode, eglot, company, corfu 等等, lsp-bridge 提供从补全后端、 补全前端到多后端融合的全套解决方案。 -2. lsp-bridge 除了提供 LSP 补全以外, 也提供了很多非 LSP 的补全后端, 包括 capf、 文件单词、 路径、 Yas/Tempel、 TabNine、 Codeium、 Copilot、 Citre、 Ctags, Org roam 等补全后端, 如果你期望在某个模式提供这些补全, 请把对应的模式添加到 `lsp-bridge-default-mode-hooks` +2. lsp-bridge 除了提供 LSP 补全以外, 也提供了很多非 LSP 的补全后端, 包括 capf、 文件单词、 路径、 Yas/Tempel、 TabNine、 Codeium、 Copilot、 Tabby, Citre、 Ctags, Org roam 等补全后端, 如果你期望在某个模式提供这些补全, 请把对应的模式添加到 `lsp-bridge-default-mode-hooks`, 定义补全顺序请查看 `acm-backend-order` 3. 请不要对 lsp-bridge 执行 ```byte compile``` 或者 ```native comp```, 会导致升级后, compile 后的版本 API 和最新版不一样, lsp-bridge 多线程设计, 不需要 compile 来加速 ## 本地使用 @@ -308,6 +308,7 @@ lsp-bridge 针对许多语言都提供 2 个以上的语言服务器支持, - `lsp-bridge-peek-list-height`: 选择下一个定义和引用的备选项 - `lsp-bridge-peek-ace-keys`: 进行 `lsp-bridge-peek-through` 时待按的按键 - `lsp-bridge-peek-ace-cancel-keys`: 退出 `lsp-bridge-peek-through` 的按键 +- `acm-backend-order`: 补全后端的显示顺序 - `acm-frame-background-dark-color`: 暗色主题下的菜单背景颜色 - `acm-frame-background-light-color`: 亮色主题下的菜单背景颜色 - `acm-enable-capf`: 针对非 LSP 后端提供 capf 补全支持, 默认是关闭的 @@ -326,7 +327,6 @@ lsp-bridge 针对许多语言都提供 2 个以上的语言服务器支持, - `acm-enable-lsp-workspace-symbol`: LSP 符号补全, 默认关闭 - `acm-doc-frame-max-lines`: 帮助窗口的最大行数, 默认是 20 - `acm-candidate-match-function`: lsp-bridge 前端对补全候选词的过滤算法, 选项有 `'regexp-quote`, `'orderless-flex`, `'orderless-literal`, `'orderless-prefixes`, `'orderless-regexp`, `'orderless-initialism`, 默认为 `regexp-quote`, orderless-\* 开头的算法需要额外安装 [orderless](https://github.com/oantolin/orderless) -- `acm-completion-backend-merge-order`: 补全后端的显示顺序, 默认是按照模式补全前半部分、 模板补全前半部分、 TabNine/Copilot/Codeium、 模板补全后半部分、 模式补全后半部分的顺序显示, 你可以根据你的需求调整补全后端的显示顺序, 如果要自定义模式补全的顺序, 请自定义 `acm-completion-mode-candidates-merge-order` - `acm-completion-mode-candidates-merge-order`: 模式补全的显示顺序, 默认是按照 Elisp、 LSP、 Jupyter、 Ctags、 Citre、 ROAM、 单词、 Telegra 的顺序显示, 你可以根据你的需求调整模式补全的显示顺序 - `acm-backend-lsp-candidate-min-length`: LSP 补全最小的触发字符数, 默认是 0 - `acm-backend-lsp-block-kind-list`: 过滤某些类型的 LSP 候选词, 默认是列表, 当值为 `'("Snippet" "Enum")` 的时候, 意味着 Snippet Enum 这两种类型的补全不会显示 diff --git a/acm/acm.el b/acm/acm.el index 9da15788de..2909fb0996 100644 --- a/acm/acm.el +++ b/acm/acm.el @@ -185,14 +185,16 @@ :type 'string :group 'acm) -(defcustom acm-completion-backend-merge-order '("mode-first-part-candidates" - "template-first-part-candidates" - "tabnine-candidates" - "copilot-candidates" - "codeium-candidates" - "template-second-part-candidates" - "mode-second-part-candidates") - "The merge order for completion backend." +(defalias acm-completion-backend-merge-order acm-backend-order) + +(defcustom acm-backend-order '("mode-first-part-candidates" + "template-first-part-candidates" + "tabnine-candidates" + "copilot-candidates" + "codeium-candidates" + "template-second-part-candidates" + "mode-second-part-candidates") + "The order for completion backend." :type 'list :group 'acm) @@ -623,7 +625,7 @@ Only calculate template candidate when type last character." ("template-second-part-candidates" template-second-part-candidates) ("mode-second-part-candidates" mode-second-part-candidates) )) - acm-completion-backend-merge-order)) + acm-backend-order)) ))) ;; Return candidates.