-
Notifications
You must be signed in to change notification settings - Fork 21
/
lsp-julia.el
31 lines (24 loc) · 1.08 KB
/
lsp-julia.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
(require 'ess-site)
(require 'julia-mode)
(require 'lsp-mode)
(defun lsp-julia--get-root ()
"Try to find the package directory by searching for a .gitignore file.
If no .gitignore file can be found use the default directory "
(let ((dir (locate-dominating-file default-directory ".gitignore")))
(if dir
(expand-file-name dir)
default-directory)))
(defun lsp-julia--rls-command ()
`("julia" "--startup-file=no" "--history-file=no" "-e"
"using LanguageServer; server = LanguageServer.LanguageServerInstance(STDIN, STDOUT, false); server.runlinter = true; run(server);"))
(defconst lsp-julia--handlers
'(("window/setStatusBusy" .
(lambda (w _p)))
("window/setStatusReady" .
(lambda(w _p)))))
(defun lsp-julia--initialize-client(client)
(mapcar #'(lambda (p) (lsp-client-on-notification client (car p) (cdr p))) lsp-julia--handlers))
(lsp-define-stdio-client lsp-julia "julia" #'lsp-julia--get-root nil
:command-fn #'lsp-julia--rls-command
:initialize #'lsp-julia--initialize-client)
(provide 'lsp-julia)