LoginSignup
1
0

More than 3 years have passed since last update.

Spacemacs: golang LSPを導入

Last updated at Posted at 2019-07-30

tldr

Spacemacs(Emacs)でgolangのLSP実装である goplsを使ってみた。
(今のところ)邪魔になる処理を無効にすれば、使える :thumbsup:

gopls のインストール

go get -u golang.org/x/tools/cmd/gopls

設定

dotspacemacs/layers

(defun dotspacemacs/layers ()

...

     (go :variables
         godoc-at-point-function 'godoc-gogetdoc
         ;; go-use-gometalinter t
         go-use-golangci-lint t
         ;; go-backend 'go-mode
         go-backend 'lsp

...

dotspacemacs/user-config

(defun dotspacemacs/user-config ()

 ...

  ;; lsp
  (setq company-lsp-cache-candidates t)
  (setq company-lsp-async t)
  (setq lsp-ui-doc-enable nil)
  (setq lsp-ui-doc-include-signature nil)
  ;; lsp-ui-sideline
  (setq lsp-ui-sideline-enable nil)
  ;; lsp-ui-flycheck
  (setq lsp-ui-flycheck-enable t)
  ;; lsp-ui-imenu
  (setq lsp-ui-imenu-enable t)
  ;; lsp-ui-peek
  (setq lsp-ui-peek-enable t)

...

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0