Commit 4f843a6b487a
Changed files (1)
lisp
lisp/setup-company.el
@@ -44,7 +44,32 @@
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
- :hook (go-mode . lsp-deferred))
+ :custom
+ (lsp-gopls-staticcheck t)
+ (lsp-eldoc-render-all t)
+ (lsp-gopls-complete-unimported t)
+ (lsp-enable-snippet nil)
+ (lsp-enable-links nil)
+ (lsp-ui-sideline-enable t)
+ (lsp-ui-sideline-delay 2.0)
+ (lsp-ui-doc-max-width 30)
+ (lsp-ui-doc-max-height 15)
+ (lsp-document-highlight-delay 2.0)
+ (lsp-auto-guess-root t)
+ (lsp-ui-flycheck-enable t)
+ (lsp-prefer-flymake nil) ; Use flycheck instead of flymake
+ :hook ((go-mode . lsp-deferred)
+ (python-mode . lsp-deferred)))
+
+;; lsp-ui: This contains all the higher level UI modules of lsp-mode, like flycheck support and code lenses.
+;; https://github.com/emacs-lsp/lsp-ui
+(use-package lsp-ui
+ :after lsp-mode
+ :hook ((lsp-mode . lsp-ui-mode)
+ (lsp-ui-mode . lsp-ui-peek-mode))
+ :config
+ (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
+ (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references))
;;Set up before-save hooks to format buffer and add/delete imports.
;;Make sure you don't have other gofmt/goimports hooks enabled.
@@ -65,20 +90,6 @@
(setq projectile-project-root (lsp--workspace-root lsp--cur-workspace))))
(add-hook 'lsp-before-open-hook #'my-set-projectile-root))
-;; lsp-ui: This contains all the higher level UI modules of lsp-mode, like flycheck support and code lenses.
-;; https://github.com/emacs-lsp/lsp-ui
-(use-package lsp-ui
- :after lsp-mode
- :hook ((lsp-mode . lsp-ui-mode)
- (lsp-ui-mode . lsp-ui-peek-mode))
- :config
- (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions)
- (define-key lsp-ui-mode-map [remap xref-find-references] #'lsp-ui-peek-find-references)
- (setq lsp-ui-sideline-enable t
- lsp-ui-doc-enable nil
- lsp-ui-flycheck-enable t
- lsp-ui-imenu-enable t
- lsp-ui-sideline-ignore-duplicate t))
(provide 'setup-company)