Add support for lua-langserver in lsp-mode
This commit is contained in:
parent
af76c873aa
commit
c97d0fe9c9
2 changed files with 20 additions and 0 deletions
18
modules/lang/lua/+lsp-mode.el
Normal file
18
modules/lang/lua/+lsp-mode.el
Normal file
|
@ -0,0 +1,18 @@
|
|||
;;; lang/lua/+lsp-mode.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defun lsp-lua-langserver--lsp-command ()
|
||||
"Generate LSP startup command."
|
||||
(list (doom-path lua-lsp-dir
|
||||
(cond (IS-MAC "bin/macOS")
|
||||
(IS-LINUX "bin/Linux")
|
||||
(IS-WINDOWS "bin/Windows"))
|
||||
"lua-language-server")
|
||||
"-E" "-e" "LANG=en"
|
||||
(doom-path lua-lsp-dir "main.lua")))
|
||||
|
||||
(after! lsp-mode
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection (lsp-stdio-connection 'lsp-lua-langserver--lsp-command)
|
||||
:major-modes '(lua-mode)
|
||||
:priority -1
|
||||
:server-id 'lua-langserver)))
|
|
@ -38,6 +38,8 @@ lua-language-server.")
|
|||
(doom-path lua-lsp-dir "main.lua")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(unless (featurep! :tools lsp +eglot)
|
||||
(load! "+lsp-mode"))
|
||||
(add-hook 'lua-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue