Open howdoicomputer opened 5 years ago
Also,
(setq company-lsp-enable-snippet t)
(setq lsp-enable-snippet t)
Are set.
I have this issue too. From my understand, the default value of company-lsp-enable-snippet
is t, so If I set up company-lsp and yasnippet correctly, the company-lsp should show yasnippets completion in my autocompletion dropdown.
got same issue,but i think the problem has nothing to do with company-lsp-enable-snippet
,because this setting is show the snippet which from lsp not yasnippet, so i think the problem is about company-lsp and yasnippet.
configure as blew , then the company-yasnippet
works well with company-lsp
(setq lsp-auto-configure nil)
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "gopls")
:major-modes '(go-mode)
:priority 0
:initialization-options 'lsp-clients-go--make-init-options
:server-id 'gopls
:library-folders-fn (lambda (_workspace)
lsp-clients-go-library-directories)))
(with-eval-after-load 'lsp-mode
(require 'lsp-ui)
(add-hook 'lsp-mode-hook 'lsp-ui-mode)
(require 'lsp-ui-flycheck)
(lsp-ui-flycheck-enable t)
(flycheck-mode 1)
(require 'company)
(push '(company-lsp :with company-yasnippet) company-backends))
Same issue. company-backends
evals to: (company-lsp (company-lsp :with company-yasnippet))
Here is my config
For people that still have this problem; I somehow managed to make company-yasnippet
work with company-lsp
and make the snippets sort better. Look around in my config for the possible fix.
@neftt I can't find your workaround in the linked repository. Could you maybe copy it as a reply here.
Creating this issue off of the back of https://github.com/syl20bnr/spacemacs/issues/12173
Essentially, when company-lsp is enabled then snippets from yasnippets-snippets don't show up in the autocompletion drop down. If I wanted to autocomplete an
if err = nil
block in Go, then I'd have to disable company-lsp to do so.Every package is at their latest version.