用了最小的配置,也没法在补全列表里找到yasnippet。感觉是company-lsp的问题。。好像不维护了?你们有能正常工作的吗? 我用的最小的测试配置
(package-initialize)
(setq use-package-always-ensure t)
(defun hardcore/init-use-package ()
(setq
package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("org" . "http://orgmode.org/elpa/")
("melpa" . "http://melpa.org/packages/")))
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
(setq use-package-always-ensure t)
(use-package use-package-ensure-system-package))
(hardcore/init-use-package)
(use-package yasnippet
:diminish yas-minor-mode
:hook (after-init . yas-global-mode)
:config (use-package yasnippet-snippets))
(use-package lsp-mode
:diminish lsp-mode
:hook (go-mode . lsp-deferred)
:commands (lsp lsp-deferred))
(use-package go-mode
:mode "\\.go\\'"
:custom (gofmt-command "goimports")
:bind (:map go-mode-map
("C-c C-n" . go-run)
("C-c ." . go-test-current-test)
("C-c f" . go-test-current-file)
("C-c a" . go-test-current-project))
:config
(add-hook 'before-save-hook #'gofmt-before-save)
(use-package gotest)
(use-package go-tag
:config (setq go-tag-args (list "-transform" "camelcase"))))
(use-package company
:diminish company-mode
:defines (company-dabbrev-ignore-case company-dabbrev-downcase)
:commands company-abort
:bind (
:map company-active-map
("C-p" . company-select-previous)
("C-n" . company-select-next)
("<tab>" . company-complete-common-or-cycle)
:map company-search-map
("C-p" . company-select-previous)
("C-n" . company-select-next))
:hook (after-init . global-company-mode)
:config
(setq company-tooltip-align-annotations t
company-tooltip-limit 12
company-idle-delay 0
company-echo-delay (if (display-graphic-p) nil 0)
company-minimum-prefix-length 2
company-require-match nil
company-dabbrev-ignore-case nil
company-dabbrev-downcase nil)
(defun company-backend-with-yas (backends)
"Add :with company-yasnippet to company BACKENDS.
Taken from https://github.com/syl20bnr/spacemacs/pull/179."
(if (and (listp backends) (memq 'company-yasnippet backends))
backends
(append (if (consp backends)
backends
(list backends))
'(:with company-yasnippet))))
;; add yasnippet to all backends
(setq company-backends (mapcar #'company-backend-with-yas company-backends)))
(use-package company-lsp
:defer t
:after (lsp-mode company)
:commands company-lsp
:init
(setq company-lsp-async t
compan-lsp-cache-candidates 'nil))
能工作的都是用的哪个版本的company-lsp呢?