mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-10-31 22:56:26 +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",
|
||||
})
|
||||
|
||||
-- Better display of diagnostics
|
||||
-- Lua dev for vim
|
||||
use("folke/lua-dev.nvim")
|
||||
|
||||
-- Better display of lsp diagnostics
|
||||
use("folke/trouble.nvim")
|
||||
|
||||
-- Generic linter/formatters in diagnostics API
|
||||
|
@ -220,12 +220,45 @@ function M.config_null_ls()
|
||||
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()
|
||||
utils.try_require("nvim-lsp-installer", function(lsp_installer)
|
||||
-- Default options
|
||||
local opts = {
|
||||
on_attach = default_attach,
|
||||
}
|
||||
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
server:setup({
|
||||
on_attach = default_attach,
|
||||
})
|
||||
-- Config luadev opts
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user