Skip to content

Commit

Permalink
Set lsp-bridge-completion-obey-trigger-characters-p to t
Browse files Browse the repository at this point in the history
  • Loading branch information
manateelazycat committed Nov 2, 2023
1 parent 25a4ae6 commit 97b060f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ lsp-bridge provides support for more than two language servers for many language
- `lsp-bridge-signature-show-with-frame-position`: When using `lsp-bridge-signature-show-with-frame` to display signature information, this option defines the position of the pop-up signature information, the default is `"bottom-right"`, you can also choose `"top-left"`, `"top-right"`, `"bottom-left"`, `"point"`
- `lsp-bridge-completion-popup-predicates`: the predicate function for completion menu, completion menu popup after all the functions pass
- `lsp-bridge-completion-stop-commands`: completion menu will not popup if these commands are executed
- `lsp-bridge-completion-hide-characters`: The default value is `‘(":" ";" "(" ")" "[" "]" "{" "}" ", " "\"")`, the completion menu does not pop up when the cursor is behind these characters. You can customize this option to remove this restriction, or call the `lsp-bridge-popup-complete-menu` command to force the menu to pop up
- `lsp-bridge-completion-hide-characters`: The default value is `‘(":" ";" "(" ")" "[" "]" "{" "}" ", " "\"")`, the completion menu does not pop up when the cursor is behind these characters. You can customize this option to remove this restriction, or call the `lsp-bridge-popup-complete-menu` command to force the menu to pop up. To make this option works, you need to set `lsp-bridge-completion-obey-trigger-characters-p` to nil.
- `lsp-bridge-user-langserver-dir`: the dir where user place langserver configuration file, if the configuration file name in the dir is the same as that in [lsp-bridge/langserver](https://github.com/manateelazycat/lsp-bridge/tree/master/langserver) , lsp-bridge will use the configuration file in this dir
- `lsp-bridge-user-multiserver-dir`: the dir where user place multiserver configuration file, if the configuration file name in the dir is the same as that in [lsp-bridge/multiserver](https://github.com/manateelazycat/lsp-bridge/tree/master/multiserver) , lsp-bridge will use the configuration file in this dir
- `lsp-bridge-symbols-enable-which-func`: Using lsp backend for `which-func`, disable by default
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ lsp-bridge 针对许多语言都提供 2 个以上的语言服务器支持,
- `lsp-bridge-signature-show-with-frame-position`: 当使用 `lsp-bridge-signature-show-with-frame` 来显示签名信息时, 这个选项定义弹出签名信息的位置, 默认是 `"bottom-right"`, 你还可以选择 `"top-left"`, `"top-right"`, `"bottom-left"`, `"point"`
- `lsp-bridge-completion-popup-predicates`: 补全菜单显示的检查函数, 这个选项包括的所有函数都检查过以后, 补全菜单才能显示
- `lsp-bridge-completion-stop-commands`: 这些命令执行以后, 不再弹出补全菜单
- `lsp-bridge-completion-hide-characters`: 默认值为 `'(":" ";" "(" ")" "[" "]" "{" "}" ", " "\"")` , 光标在这些字符的后面时不弹出补全菜单, 你可以定制这个选项以解除这个限制, 或者调用 `lsp-bridge-popup-complete-menu` 命令强制弹出菜单
- `lsp-bridge-completion-hide-characters`: 默认值为 `'(":" ";" "(" ")" "[" "]" "{" "}" ", " "\"")` , 光标在这些字符的后面时不弹出补全菜单, 你可以定制这个选项以解除这个限制, 或者调用 `lsp-bridge-popup-complete-menu` 命令强制弹出菜单。 为了让这个选项生效, 你需要先把 `lsp-bridge-completion-obey-trigger-characters-p` 选项设置为 nil
- `lsp-bridge-user-langserver-dir`: 用户 langserver 配置文件目录, 如果目录下的配置文件和 [lsp-bridge/langserver](https://github.com/manateelazycat/lsp-bridge/tree/master/langserver) 里的配置文件同名, lsp-bridge 会使用这个目录下的配置文件
- `lsp-bridge-user-multiserver-dir`: 用户 multiserver 配置文件目录, 如果目录下的配置文件和 [lsp-bridge/multiserver](https://github.com/manateelazycat/lsp-bridge/tree/master/multiserver) 里的配置文件同名, lsp-bridge 会使用这个目录下的配置文件
- `lsp-bridge-symbols-enable-which-func`: 在`which-func`使用 lsp 后端, 默认关闭
Expand Down
9 changes: 7 additions & 2 deletions lsp-bridge.el
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,16 @@ Setting this to nil or 0 will turn off the indicator."
:group 'lsp-bridge)

(defcustom lsp-bridge-completion-hide-characters '(":" ";" "(" ")" "[" "]" "{" "}" "," "\"")
"If character before match this option, stop popup completion ui."
"If character before match this option, stop popup completion ui.
To make this option works, you need set option `lsp-bridge-completion-obey-trigger-characters-p' with nil first.
After set `lsp-bridge-completion-obey-trigger-characters-p' to nil, you need use `setq' set this value, don't use `custom-set-variables'."
:type '(repeat string)
:safe #'listp
:group 'lsp-bridge)

(defcustom lsp-bridge-completion-obey-trigger-characters-p nil
(defcustom lsp-bridge-completion-obey-trigger-characters-p t
"If non-nil makes trigger characters a higher priority than `lsp-bridge-completion-hide-characters'."
:type 'boolean
:safe #'booleanp
Expand Down Expand Up @@ -1143,6 +1147,7 @@ So we build this macro to restore postion after code format."
(if (cl-every (lambda (pred)
(if (functionp pred)
(let ((result (funcall pred)))
;; DEBUG:
;; Uncomment below code when you want to know why `lsp-bridge-try-completion' failed.
;; (message "*** %s %s" pred result)
result)
Expand Down

0 comments on commit 97b060f

Please sign in to comment.