Browse Source

update emacs lsp configs

VHDL Tool 2 months ago
parent
commit
6b1a9e2118
1 changed files with 11 additions and 32 deletions
  1. 11 32
      lsp-init.el

+ 11 - 32
lsp-init.el

@@ -1,39 +1,18 @@
1 1
 (require 'package) 
2
-(add-to-list 'package-archives
2
+(add-to-list 'package-archives 
3 3
              '("melpa" . "https://melpa.org/packages/"))
4
-(when (< emacs-major-version 24)
5
-  ;; For important compatibility libraries like cl-lib
6
-  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
7 4
 (package-initialize) 
8 5
 
9
-(custom-set-variables
10
- ;; custom-set-variables was added by Custom.
11
- ;; If you edit it by hand, you could mess it up, so be careful.
12
- ;; Your init file should contain only one such instance.
13
- ;; If there is more than one, they won't work right.
14
- '(inhibit-startup-screen t)
15
- '(package-selected-packages (quote (flycheck use-package))))
16
-(custom-set-faces
17
- ;; custom-set-faces was added by Custom.
18
- ;; If you edit it by hand, you could mess it up, so be careful.
19
- ;; Your init file should contain only one such instance.
20
- ;; If there is more than one, they won't work right.
21
- )
22
-
23
-(use-package flycheck
24
-  :ensure t
25
-  :init (global-flycheck-mode))
26
-
27
-(add-to-list 'load-path "~/.emacs.d/lsp-mode")
28
-(with-eval-after-load 'lsp-mode
29
-    (require 'lsp-flycheck))
30 6
 (require 'lsp-mode)
7
+(add-hook 'vhdl-mode-hook #'lsp)
31 8
 
32
-(add-hook 'vhdl-mode-hook #'lsp-mode)
33
-
34
-(lsp-define-stdio-client 'vhdl-mode "VHDL" 'stdio (lsp-make-traverser "vhdltool-config.yaml")
35
-			 "VHDL Language Server"
36
-			 '("vhdl-tool" "lsp"))
37
-
38
-(provide 'lsp-vhdl)
9
+(add-to-list 'lsp-language-id-configuration '(vhdl-mode . "vhdl"))
10
+(lsp-register-client
11
+   (make-lsp-client :new-connection (lsp-stdio-connection '("vhdl-tool" "lsp"))
12
+                    :major-modes '(vhdl-mode)
13
+                    :language-id "VHDL"
14
+                    :server-id 'lsp-vhdl-mode))
39 15
 
16
+(require 'lsp-ui)
17
+(add-hook 'lsp-mode-hook 'lsp-ui-mode)
18
+(add-hook 'vhdl-mode-hook 'flycheck-mode)