Skip to content

Commit 4470881

Browse files
authored
Trigger suggests: ensure that company-mode bound (#2648)
* Trigger suggests: ensure that `company-mode' bound Also remove the `defvar' for it, since it isn't needed anywhere else. * `let'-bind `company-minimum-prefix-length' to 0 This way, `company-auto-begin' will always be triggered in triggerSuggests, no matter the minimum prefix length. * Declare `company-minimum-prefix-length'
1 parent 7f27a8f commit 4470881

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lsp-mode.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
(defvar yas-also-auto-indent-first-line)
7272
(defvar dap-auto-configure-mode)
7373
(defvar dap-ui-menu-items)
74+
(defvar company-minimum-prefix-length)
7475

7576
(defconst lsp--message-type-face
7677
`((1 . ,compilation-error-face)
@@ -5152,18 +5153,17 @@ It will show up only if current point has signature help."
51525153
"Handler for editor.action.triggerParameterHints."
51535154
(lsp-signature-activate))
51545155

5155-
(defvar company-mode)
5156-
51575156
(defun lsp--action-trigger-suggest (_command)
51585157
"Handler for editor.action.triggerSuggest."
51595158
(cond
5160-
((and company-mode
5159+
((and (bound-and-true-p company-mode)
51615160
(fboundp 'company-auto-begin)
51625161
(fboundp 'company-post-command))
51635162
(run-at-time 0 nil
51645163
(lambda ()
5165-
(company-auto-begin)
5166-
(let ((this-command 'company-idle-begin))
5164+
(let ((this-command 'company-idle-begin)
5165+
(company-minimum-prefix-length 0))
5166+
(company-auto-begin)
51675167
(company-post-command)))))
51685168
(t
51695169
(completion-at-point))))

0 commit comments

Comments
 (0)