Add lua-language-server
This commit is contained in:
parent
d22987fc1f
commit
76c77db30a
8 changed files with 66 additions and 9 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -19,3 +19,6 @@
|
||||||
[submodule "bundle/vim-table-mode"]
|
[submodule "bundle/vim-table-mode"]
|
||||||
path = bundle/vim-table-mode
|
path = bundle/vim-table-mode
|
||||||
url = https://github.com/dhruvasagar/vim-table-mode.git
|
url = https://github.com/dhruvasagar/vim-table-mode.git
|
||||||
|
[submodule "opt/lua-language-server"]
|
||||||
|
path = opt/lua-language-server
|
||||||
|
url = https://github.com/LuaLS/lua-language-server.git
|
||||||
|
|
5
README.md
Normal file
5
README.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# NVIM Configuration
|
||||||
|
|
||||||
|
## Lua
|
||||||
|
|
||||||
|
<https://github.com/LuaLS/lua-language-server/releases/>
|
15
build.sh
Executable file
15
build.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
(
|
||||||
|
cd opt/lua-language-server
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
(
|
||||||
|
cd 3rd/luamake
|
||||||
|
./compile/build.sh
|
||||||
|
)
|
||||||
|
|
||||||
|
3rd/luamake/luamake rebuild
|
||||||
|
)
|
||||||
|
|
||||||
|
# EOF
|
|
@ -1,14 +1,12 @@
|
||||||
if vim.fn.has('nvim-0.5.1') == 1 then
|
require('vim.lsp.log').set_format_func(vim.inspect)
|
||||||
require('vim.lsp.log').set_format_func(vim.inspect)
|
-- vim.lsp.set_log_level("debug")
|
||||||
end
|
|
||||||
|
|
||||||
vim.lsp.set_log_level("off")
|
|
||||||
|
|
||||||
require("config.lsp.pyright")
|
require("config.lsp.pyright")
|
||||||
-- require("config.lsp.pylsp")
|
-- require("config.lsp.pylsp")
|
||||||
-- require("config.lsp.typescript")
|
-- require("config.lsp.typescript")
|
||||||
require("config.lsp.clangd")
|
require("config.lsp.clangd")
|
||||||
require("config.lsp.vls")
|
require("config.lsp.vls")
|
||||||
|
require("config.lsp.lua_ls")
|
||||||
|
|
||||||
local api = vim.api
|
local api = vim.api
|
||||||
local keymap = vim.keymap.set
|
local keymap = vim.keymap.set
|
||||||
|
|
38
lua/config/lsp/lua_ls.lua
Normal file
38
lua/config/lsp/lua_ls.lua
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
local bin_name = "lua-language-server"
|
||||||
|
local cmd = { bin_name, "--stdio", }
|
||||||
|
|
||||||
|
local root_files = {
|
||||||
|
'.luarc.json',
|
||||||
|
'.luarc.jsonc',
|
||||||
|
'.luacheckrc',
|
||||||
|
'.stylua.toml',
|
||||||
|
'stylua.toml',
|
||||||
|
'selene.toml',
|
||||||
|
'selene.yml',
|
||||||
|
'lua/',
|
||||||
|
'.git',
|
||||||
|
}
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "lua",
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.start({
|
||||||
|
name = "lua_ls",
|
||||||
|
cmd = cmd,
|
||||||
|
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
vim.env.VIMRUNTIME,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
|
@ -1,10 +1,6 @@
|
||||||
local bin_name = "pyright-langserver"
|
local bin_name = "pyright-langserver"
|
||||||
local cmd = { bin_name, "--stdio", }
|
local cmd = { bin_name, "--stdio", }
|
||||||
|
|
||||||
if vim.fn.has("win32") == 1 then
|
|
||||||
cmd = { "cmd.exe", "/C", bin_name, "--stdio" }
|
|
||||||
end
|
|
||||||
|
|
||||||
local root_files = {
|
local root_files = {
|
||||||
"pyproject.toml",
|
"pyproject.toml",
|
||||||
"setup.py",
|
"setup.py",
|
||||||
|
|
1
opt/bin/lua-language-server
Symbolic link
1
opt/bin/lua-language-server
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../lua-language-server/bin/lua-language-server
|
1
opt/lua-language-server
Submodule
1
opt/lua-language-server
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2dfb12ad3759acb7ff47b4c5c54ad0a62c598b22
|
Loading…
Reference in a new issue