lsp-go company-lsp补全函数无法参数

补全go方法时,回车只会把方法名补全,不会添加括号,也不会添加参数

补全时:

回车后:

image

只补全了函数名

我的配置:

(use-package lsp-mode
  :ensure t
  :commands (lsp lsp-deferred)
  :init
  (setq lsp-auto-guess-root t
        lsp-prefer-flymake nil
        lsp-file-watch-threshold 10000
        )
  :config
  ;; Configure LSP clients
  (use-package lsp-clients)
  )

(use-package lsp-ui
  :ensure t
  :commands lsp-ui-mode
  :custom-face (lsp-ui-doc-background ((t (:background ,(face-background 'tooltip)))))
  :bind (:map lsp-ui-mode-map
              ([remap xref-find-definitions] . lsp-ui-peek-find-definitions)
              ([remap xref-find-references] . lsp-ui-peek-find-references)
              ("C-c u" . lsp-ui-imenu))
  :init
  (setq lsp-ui-doc-border (face-foreground 'default))
  :config
  (setq lsp-ui-sideline-enable nil)
  (setq lsp-ui-doc-enable nil))

(use-package company-lsp
  :ensure t
  :commands company-lsp
  :init (setq company-lsp-cache-candidates 'auto))

(use-package helm-lsp
  :ensure t
  :commands (helm-lsp-workspace-symbol helm-lsp-global-workspace-symbol))

(provide 'init-lsp)

各种变量值:

company-backends

lsp-gopls-use-placeholders

image

有人遇到过这个问题吗?

设置lsp-enable-snippet为t,安装yasnippet。

1 个赞

对的,没有启用 snippet 功能

你用的是什么theme? 好像颜色很好看

sanityinc-tomorrow-bright 这个

1 个赞