mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 22:57:35 +00:00
Add luadev for nvim lsp support
This commit is contained in:
parent
5a1a907529
commit
27eccf2b51
4
.luarc.json
Normal file
4
.luarc.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||||
|
"Lua.workspace.checkThirdParty": false
|
||||||
|
}
|
@ -197,7 +197,10 @@ return require("packer").startup({
|
|||||||
requires = "neovim/nvim-lspconfig",
|
requires = "neovim/nvim-lspconfig",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Better display of diagnostics
|
-- Lua dev for vim
|
||||||
|
use("folke/lua-dev.nvim")
|
||||||
|
|
||||||
|
-- Better display of lsp diagnostics
|
||||||
use("folke/trouble.nvim")
|
use("folke/trouble.nvim")
|
||||||
|
|
||||||
-- Generic linter/formatters in diagnostics API
|
-- Generic linter/formatters in diagnostics API
|
||||||
|
@ -220,12 +220,45 @@ function M.config_null_ls()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function get_luadev_config()
|
||||||
|
local luadev = utils.try_require("lua-dev")
|
||||||
|
if luadev ~= nil then
|
||||||
|
return luadev.setup({
|
||||||
|
-- add any options here, or leave empty to use the default settings
|
||||||
|
lspconfig = {
|
||||||
|
on_attach = default_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Disable",
|
||||||
|
keywordSnippet = "Disable",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
function M.config_lsp_intaller()
|
function M.config_lsp_intaller()
|
||||||
utils.try_require("nvim-lsp-installer", function(lsp_installer)
|
utils.try_require("nvim-lsp-installer", function(lsp_installer)
|
||||||
|
-- Default options
|
||||||
|
local opts = {
|
||||||
|
on_attach = default_attach,
|
||||||
|
}
|
||||||
|
|
||||||
lsp_installer.on_server_ready(function(server)
|
lsp_installer.on_server_ready(function(server)
|
||||||
server:setup({
|
-- Config luadev opts
|
||||||
on_attach = default_attach,
|
if server.name == "sumneko_lua" then
|
||||||
})
|
local luadev = get_luadev_config()
|
||||||
|
if luadev ~= nil then
|
||||||
|
opts.settings = luadev.settings
|
||||||
|
print(vim.inspect(opts.settings.Lua))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
server:setup(opts)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user