summaryrefslogblamecommitdiff
path: root/config/init-lsp.el
blob: d7eda935ff80c40f814c3b51601f6afc620e9632 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                                                        


                                              
                                        
                                                
                                                                      
         
                             
                                             




                                                                      
 
                                                                                  

                                                              






                                             


                         
;;; init-lsp.el --- Configure LSP integration -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;; Configure LSP integration

;;; Code:

(use-package eglot
  :after yasnippet
  :bind (:map eglot-mode-map
              ("C-c l a" . eglot-code-actions)
              ("C-c l r" . eglot-rename)
	      ("C-c l f" . eglot-format-buffer))
  :hook (eglot-managed-mode . (lambda () (eglot-inlay-hints-mode -1)))
  :config
  (setq eglot-autoshutdown t)
  (setq-default eglot-workspace-configuration
                '(:pylsp (:plugins (:ruff (:enabled t)))
                  :gopls (:usePlaceholders t
					   :staticcheck t
					   :completeUnimported t
					   :matcher "CaseSensitive")))

  ;; uses https://github.com/nix-community/nixd for the LSP server instead of rnix
  (add-to-list 'eglot-server-programs '(nix-mode . ("nixd"))))

(use-package eldoc-box
  :ensure t
  :hook
  (eglot-managed-mode . eldoc-box-hover-mode)
  :custom
  (eldoc-box-max-pixel-width 1024))

(provide 'init-lsp)

;;; init-lsp.el ends here