emacs/neovim: add `lua-language-server`

This commit is contained in:
Hoang Nguyen 2021-03-02 17:05:45 +03:00
parent 9e16310d4e
commit 40c9496e1f
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
4 changed files with 58 additions and 3 deletions

View File

@ -109,6 +109,8 @@
"--header-insertion=iwyu"
"--header-insertion-decorators"))
;;(after! lsp-clangd (set-lsp-priority! 'clangd 2)) ;; Prefer clangd instead of default ccls
(setq lua-lsp-dir "~/.config/emacs/.local/etc/lsp/lua-language-server/"
lua-lsp-completion-call-snippet "Replace")
;; Quicker which-key
(after! which-key

View File

@ -159,7 +159,7 @@
;;lean
;;factor
;;ledger ; an accounting system in Emacs
lua ; one-based indices? one-based indices
(lua +lsp) ; one-based indices? one-based indices
(markdown ; writing docs for people to ignore
+grip)
;;nim ; python + lisp at the speed of c

View File

@ -76,7 +76,7 @@
]
},
"coc-actions.useCursorLine": true,
"python.venvPath": "~/.local/share/pyenv/versions",
"python.venvPath": "/home/follie/.local/share/pyenv/versions",
"python.pythonPath": "python3",
"python.linting.enabled": true,
"python.linting.banditEnabled": true,
@ -91,6 +91,34 @@
],
"clangd.semanticHighlighting": true,
"languageserver": {
"lua-language-server": {
"command": "/home/follie/.local/share/nvim/lsp/lua-language-server/bin/Linux/lua-language-server",
"args": [
"-E",
"/home/follie/.local/share/nvim/lsp/lua-language-server/main.lua"
],
"filetypes": [
"lua"
],
"rootPatterns": [
".git/",
".hg/",
".projectile"
],
"settings": {
"Lua": {
"completion": {
"callSnippet": "Replace"
},
"hint": {
"enable": true
},
"telemetry": {
"enable": false
}
}
}
},
"ccls": {
"command": "ccls",
"filetypes": [
@ -105,7 +133,8 @@
".ccls",
"compile_commands.json",
".git/",
".hg/"
".hg/",
".projectile"
],
"initializationOptions": {
"cache": {

24
setup/lua-language-server.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
# clone the repo
git clone https://github.com/sumneko/lua-language-server
cd lua-language-server || exit
git submodule update --init --recursive
# build
# You need `ninja`
cd 3rd/luamake || exit
ninja -f ninja/linux.ninja
cd ../..
./3rd/luamake/luamake rebuild
# Just for the convenience sake
cd ../
mv -rfv lua-language-server ~/Code/lua-language-server
# For coc.nvim
mkdir -pv ~/.local/share/nvim/lsp
ln -sv ~/Code/lua-language-server ~/.local/share/nvim/lsp/
# For Doom Emacs
mkdir -pv ~/.config/emacs/.local/etc/lsp
ln -sv ~/Code/lua-language-server ~/.config/emacs/.local/etc/lsp/