-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlsp.el
60 lines (48 loc) · 1.85 KB
/
lsp.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;;; lsp.el --- Language Server Protocol setup -*- lexical-binding: t; -*-
(use-package eglot
:hook ((ess-r-mode . eglot-ensure)
;; (latex-mode . eglot-ensure)
;; (LaTeX-mode . eglot-ensure)
)
:disabled
:config
(setq eldoc-echo-area-use-multiline-p 1)
(setq eglot-ignored-server-capabilites nil)
;; https://joaotavora.github.io/eglot/#Customizing-Eglot
;;(add-to-list eglot-stay-out-of 'imenu)
;; (defun jds~latex-eglot-hook ()
;; "Hook run on eglot start in latex-mode"
;; (setq-local eglot-stay-out-of '("imenu")))
;; add hook at front (before eglot) and make it local
;; (add-hook 'LaTeX-mode-hook 'jds~latex-eglot-hook -100)
;; (add-hook 'latex-mode-hook 'jds~latex-eglot-hook -100)
;; use texlab instead of digestif
;; (add-to-list 'eglot-server-programs '((tex-mode context-mode texinfo-mode bibtex-mode) . ("texlab")))
)
(use-package consult-eglot
:disabled)
;; don't have to use the mouse to see errors in echo area
(use-package flymake-cursor
:disabled
:diminish flymake-mode
:config
(eval-after-load 'flymake '(require 'flymake-cursor)))
;;; lsp-mode rather than eglot
(use-package lsp-mode
:disabled t
:custom
(lsp-completion-provider :none) ;; we use Corfu!
:init
(defun my/orderless-dispatch-flex-first (_pattern index _total)
(and (eq index 0) 'orderless-flex))
(defun my/lsp-mode-setup-completion ()
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
'(orderless)))
;; Optionally configure the first word as flex filtered.
(add-hook 'orderless-style-dispatchers #'my/orderless-dispatch-flex-first nil 'local)
;; Optionally configure the cape-capf-buster.
(setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point)))
:hook
(lsp-completion-mode . my/lsp-mode-setup-completion)
(ess-r-mode . lsp)
:commands lsp)