Skip to content

Commit

Permalink
Add option acm-enable-lsp-workspace-symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Oct 8, 2024
1 parent 7d10c79 commit f57c8ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ lsp-bridge provides support for more than two language servers for many language
- `acm-quick-access-use-number-select`: Whether to use number keys for quick selection of candidate words, default is off, turning on this option may sometimes interfere with number input or accidentally select candidate words
- `acm-enable-yas`: yasnippet completion, enable by default
- `acm-enable-citre`: Integration with [citre(ctags)](https://github.com/universal-ctags/citre). Enable this to add citre (ctags) backend (disabled by default)
- `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
Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ lsp-bridge 针对许多语言都提供 2 个以上的语言服务器支持,
- `acm-quick-access-use-number-select`: 是否用数字键快速选择候选词, 默认关闭, 打开这个选项会导致有时候干扰数字输入或误选候选词
- `acm-enable-yas`: yasnippet 补全, 默认打开
- `acm-enable-citre`: [citre(ctags)](https://github.com/universal-ctags/citre) 补全, 默认关闭
- `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`
Expand Down
5 changes: 5 additions & 0 deletions acm/acm-backend-lsp-workspace-symbol.el
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
"LSP backend for acm."
:group 'acm)

(defcustom acm-enable-lsp-workspace-symbol nil
"Popup LSP workspace symbol completions when this option is turn on."
:type 'boolean
:group 'acm-backend-lsp-workspace-symbol)

(defcustom acm-backend-lsp-workspace-symbol-candidate-min-length 0
"Minimal length of candidate."
:type 'integer
Expand Down
3 changes: 2 additions & 1 deletion acm/acm.el
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ Only calculate template candidate when type last character."
(setq ctags-candidates (unless (acm-in-comment-p) (acm-backend-ctags-candidates keyword))))
;; Fetch syntax completion candidates.
(setq lsp-candidates (unless (acm-in-comment-p) (acm-backend-lsp-candidates keyword)))
(setq lsp-workspace-symbol-candidates (unless (acm-in-comment-p) (acm-backend-lsp-workspace-symbol-candidates keyword)))
(when acm-enable-lsp-workspace-symbol
(setq lsp-workspace-symbol-candidates (unless (acm-in-comment-p) (acm-backend-lsp-workspace-symbol-candidates keyword))))
(setq mode-candidates
(apply #'append (mapcar (lambda (mode-candidate-name)
(pcase mode-candidate-name
Expand Down

0 comments on commit f57c8ce

Please sign in to comment.