File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ ; ;; tblgen-lsp-client.el --- Description -*- lexical-binding : t ; -*-
2
+ ; ;
3
+ ; ; Package-Requires: ((emacs "24.3"))
4
+ ; ;
5
+ ; ; This file is not part of GNU Emacs.
6
+ ; ;
7
+ ; ;; Commentary:
8
+ ; ; LSP client to use with `tablegen-mode' that uses `tblgen-lsp-server' or any
9
+ ; ; user made compatible server.
10
+ ; ;
11
+ ; ;
12
+ ; ;; Code:
13
+ (require 'lsp-mode )
14
+
15
+ (defgroup lsp-tblgen nil
16
+ " LSP support for Tablegen."
17
+ :group 'lsp-mode
18
+ :link '(url-link " https://mlir.llvm.org/docs/Tools/MLIRLSP/" ))
19
+
20
+ (defcustom lsp-tblgen-server-executable " tblgen-lsp-server"
21
+ " Command to start the mlir language server."
22
+ :group 'lsp-tblgen
23
+ :risky t
24
+ :type 'file )
25
+
26
+
27
+ (defcustom lsp-tblgen-server-args " "
28
+ " Args of LSP client for TableGen, for example '--tablegen-compilation-database=.../build/tablegen_compile_commands.yml'"
29
+ :group 'lsp-tblgen
30
+ :risky t
31
+ :type 'file )
32
+
33
+ (defun lsp-tblgen-setup ()
34
+ " Setup the LSP client for TableGen."
35
+ (add-to-list 'lsp-language-id-configuration '(tablegen-mode . " tablegen" ))
36
+
37
+ (lsp-register-client
38
+ (make-lsp-client
39
+ :new-connection (lsp-stdio-connection (lambda () (cons lsp-tblgen-server-executable (split-string-shell-command lsp-tblgen-server-args))))
40
+ :activation-fn (lsp-activate-on " tablegen" )
41
+ :priority -1
42
+ :server-id 'tblgen-lsp )))
43
+
44
+ (provide 'tblgen-lsp )
45
+ ; ;; tblgen-lsp-client.el ends here
You can’t perform that action at this time.
0 commit comments