-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-lsp.el
106 lines (87 loc) · 2.14 KB
/
init-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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
;;; init-lsp.el --- LSP
;;; Commentary:
;;
;;; Code:
(use-package lsp-mode
:disabled
:ensure t
:commands lsp
:hook ((java-mode . lsp)
(python-mode . lsp)
(haskell-mode . lsp)
(haskell-literate-mode . lsp)
(latex-mode . lsp)
(tex-mode . lsp)
(yatex-mode . lsp)
(bibtex-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration))
:custom
(lsp-completion-enable t)
(lsp-completion-provider :capf)
(lsp-enable-snippet))
;; LSP UI tools
(use-package lsp-ui
:disabled
:ensure t
:commands lsp-ui-mode)
(use-package lsp-ivy
:disabled
:ensure t
:commands lsp-ivy-workspace-symbol)
;; https://github.com/emacs-lsp/lsp-docker
;; (use-package lsp-docker :ensure t)
(use-package lsp-haskell
:disabled
:after haskell-mode
:ensure t
:config
(add-hook 'haskell-mode-hook #'lsp)
(add-hook 'haskell-literate-mode-hook #'lsp))
(use-package lsp-java
:disabled
:ensure t
:after lsp-mode
:config
(require 'lsp-java-boot)
;; to enable the lenses
(add-hook 'lsp-mode-hook #'lsp-lens-mode)
(add-hook 'java-mode-hook #'lsp-java-lens-mode))
(use-package lsp-julia
:disabled
:ensure t
:after (:all julia-mode lsp-mode)
:hook ((julia-mode-hook . lsp-mode)
(julia-mode-hook . lsp)))
(use-package which-key
:ensure t
:config
(which-key-mode))
(use-package eglot
:ensure t
:hook ((go-mode . eglot-ensure)
(haskell-mode . eglot-ensure)
(csharp-mode . eglot-ensure)
(rust-mode . eglot-ensure))
:bind (:map eglot-mode-map
("C-c a r" . #'eglot-rename)
("C-c C-c" . #'eglot-code-actions))
:custom
(eglot-autoshutdown t))
(use-package eglot-fsharp
:requires eglot
:ensure t)
(use-package eglot-java
:requires eglot
:ensure t)
(use-package xref
:ensure t
:bind (("s-r" . #'xref-find-references)
("s-[" . #'xref-go-back)
("C-<down-mouse-2>" . #'xref-go-back)
("s-]" . #'xref-go-forward)))
(use-package eldoc
:bind ("s-d" . #'eldoc)
:custom (eldoc-echo-area-prefer-doc-buffer t))
(message "loading init-lsp done.")
(provide 'init-lsp)
;;; init-lsp.el ends here