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
| ;; lsp related
(use-package lsp-mode
:ensure t
:hook
(scala-mode . lsp)
(lsp-mode . lsp-lens-mode)
(python-mode . lsp)
(c++-mode . lsp)
(sh-mode . lsp-deferred)
(yaml-mode . lsp)
:init
(setq lsp-bash-server-command '("bash-language-server" "start"))
:config
;; Uncomment following section if you would like to tune lsp-mode performance according to
;; https://emacs-lsp.github.io/lsp-mode/page/performance/
;; (setq gc-cons-threshold 100000000) ;; 100mb
;; (setq read-process-output-max (* 1024 1024)) ;; 1mb
;; (setq lsp-idle-delay 0.500)
;; (setq lsp-log-io nil)
;; (setq lsp-completion-provider :capf)
(setq lsp-prefer-flymake nil)
;; Makes LSP shutdown the metals server when all buffers in the project are closed.
;; https://emacs-lsp.github.io/lsp-mode/page/settings/mode/#lsp-keep-workspace-alive
(setq lsp-keep-workspace-alive nil))
(with-eval-after-load 'flycheck
(add-to-list 'flycheck-disabled-checkers 'python-flake8)
(flycheck-add-next-checker 'python-pylint
'(warning . python-flake8)))
;; Disable pylint for lsp-mode
(setq lsp-pyls-plugins-pycodestyle-enabled nil)
(setq lsp-pyls-plugins-flake8-enabled t)
;; Add metals backend for lsp-mode
(use-package lsp-metals
:ensure t)
(when (display-graphic-p)
;; Do any keybindings and theme setup here
(use-package lsp-ui
:ensure t
:commands lsp-ui-mode)
(use-package posframe
:ensure t)
(use-package dap-mode
:ensure t
:hook
(lsp-mode . dap-mode)
(lsp-mode . dap-ui-mode))
(use-package helm-lsp
:ensure t
:config
(define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol)
)
(use-package lsp-treemacs
:ensure t)
)
(defun my/python-mode-setup ()
(setq lsp-pylsp-configuration-sources ["pycodestyle"])
(setq lsp-pylsp-plugins-pydocstyle-enabled t)
(setq lsp-pylsp-plugins-pydocstyle-ignore ["D100" "D101" "D203", "D107", "D105", "D104", "D102", "D103", "D106", "D401", "D413", "D202", "D204", "D213", "D406", "D407", "D408", "D409", "D410", "D411", "D412", "D415", "D416", "D417", "D418", "D419", "D420", "D421", "D422", "D423", "D424", "D425", "D426", "D427", "D428", "D429", "D430", "D431", "D432", "D433", "D434", "D435", "D436", "D437", "D438", "D439", "D440", "D441", "D442", "D443", "D444", "D445", "D446", "D447", "D448", "D449", "D450", "D451", "D452", "D453", "D454", "D455", "D456", "D457", "D458", "D459", "D460", "D461", "D462", "D463", "D464", "D465", "D466", "D467", "D468", "D469", "D470", "D471", "D472", "D473", "D474", "D475", "D476", "D477", "D478", "D479", "D480", "D481", "D482", "D483", "D484", "D485", "D486", "D487", "D488", "D489", "D490", "D491", "D492", "D493", "D494", "D495", "D496", "D497", "D498", "D499", "D500", "D501", "D502", "D503", "D504", "D505", "D506", "D507", "D508", "D509", "D510", "D511", "D512", "D513", "D514", "D515", "D516", "D517", "D518", "D519", "D520", "D521", "D522"]))
(add-hook 'python-mode-hook #'my/python-mode-setup)
|