summaryrefslogblamecommitdiff
path: root/emacs/custom/my-lsp.el
blob: c10e06c5771c97be63772099003647d803c81d9d (plain) (tree)
1
2
3
4
5
6
7
8
9








                                                                     


                          
 



                                                                             

                                                                          
                                                                             
 
                                       
 

                                            
 

                                        
 

                                                                         

                                       



                                                                                                      


                       
;;; my-lsp.el --- Configures emacs for LSP -*- lexical-binding: t -*-
;; Author: Franck Cuny <franck@fcuny.net>

;;; Commentary:

;;; Code:

(require 'lsp-mode)
(require 'lsp-ui)
(require 'lsp-diagnostics)
(require 'consult-lsp)
(require 'lsp-completion)

(setq lsp-ui-doc-enable                 t) ;; Enable documentation
(setq lsp-ui-doc-position       'at-point) ;; Show the documentation at point
(setq lsp-ui-doc-header                 t)
(setq lsp-ui-doc-include-signature      t)
(setq lsp-ui-peek-enable                t) ;; Enable `lsp-ui-peek'.
(setq lsp-ui-peek-show-directory        t) ;; Show the directory of files.
(setq lsp-ui-sideline-enable          nil) ;; Don't enable `lsp-ui-sideline'.

(add-hook 'lsp-mode-hook #'lsp-ui-mode)

;; Enable `completion-at-point' integration.
(setq lsp-completion-enable t)

;; The default is to use flycheck
(setq lsp-diagnostics-provider :flymake)

(define-key lsp-mode-map [remap xref-find-apropos] #'consult-lsp-symbols)

;; Configure the completion to be corfu
(setq lsp-completion-provider :none)
(add-hook 'lsp-completion-mode-hook
          (lambda ()
	    (setf (alist-get 'lsp-capf completion-category-defaults) '((styles . (orderless flex))))))

(provide 'my-lsp)

;;; my-lsp.el ends here