mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:47:34 +00:00
Use new neodev config (only works for 0.7)
There is no check here because Mason won't even install the LSP for 0.6 versions.
This commit is contained in:
parent
8277be8360
commit
3d6071d222
@ -232,7 +232,7 @@ use({
|
|||||||
|
|
||||||
-- Lua dev for vim
|
-- Lua dev for vim
|
||||||
use({
|
use({
|
||||||
"folke/lua-dev.nvim",
|
"folke/neodev.nvim",
|
||||||
requires = "neovim/nvim-lspconfig",
|
requires = "neovim/nvim-lspconfig",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -42,11 +42,8 @@ local function get_default_attach(override_capabilities)
|
|||||||
return function(client, bufnr)
|
return function(client, bufnr)
|
||||||
-- Allow overriding capabilities to avoid duplicate lsps with capabilities
|
-- Allow overriding capabilities to avoid duplicate lsps with capabilities
|
||||||
if override_capabilities ~= nil then
|
if override_capabilities ~= nil then
|
||||||
client.resolved_capabilities = vim.tbl_extend(
|
client.resolved_capabilities =
|
||||||
"force",
|
vim.tbl_extend("force", client.resolved_capabilities, override_capabilities or {})
|
||||||
client.resolved_capabilities,
|
|
||||||
override_capabilities or {}
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function buf_set_keymap(...)
|
local function buf_set_keymap(...)
|
||||||
@ -175,10 +172,11 @@ local function merged_capabilities()
|
|||||||
return capabilities
|
return capabilities
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
local function get_luadev_config()
|
local function get_luadev_config()
|
||||||
local luadev = utils.try_require("lua-dev")
|
local neodev = utils.try_require("neodev")
|
||||||
if luadev ~= nil then
|
if neodev ~= nil then
|
||||||
return luadev.setup({
|
return neodev.setup({
|
||||||
-- add any options here, or leave empty to use the default settings
|
-- add any options here, or leave empty to use the default settings
|
||||||
lspconfig = {
|
lspconfig = {
|
||||||
on_attach = get_default_attach(),
|
on_attach = get_default_attach(),
|
||||||
@ -196,6 +194,7 @@ local function get_luadev_config()
|
|||||||
|
|
||||||
return { settings = nil }
|
return { settings = nil }
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
|
|
||||||
function M.config_lsp()
|
function M.config_lsp()
|
||||||
utils.try_require("lspconfig", function(lsp_config)
|
utils.try_require("lspconfig", function(lsp_config)
|
||||||
@ -219,11 +218,18 @@ function M.config_lsp()
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Configure neovim dev for when sumneko_lua is installed
|
||||||
|
utils.try_require("neodev", function(neodev)
|
||||||
|
neodev.setup({})
|
||||||
|
end)
|
||||||
|
--[[
|
||||||
lsp_config.sumneko_lua.setup({
|
lsp_config.sumneko_lua.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = default_attach,
|
on_attach = default_attach,
|
||||||
settings = get_luadev_config().settings,
|
-- settings = get_luadev_config().settings,
|
||||||
})
|
})
|
||||||
|
--]]
|
||||||
|
|
||||||
-- Auto setup mason installed servers
|
-- Auto setup mason installed servers
|
||||||
utils.try_require("mason-lspconfig", function(mason_lspconfig)
|
utils.try_require("mason-lspconfig", function(mason_lspconfig)
|
||||||
|
Loading…
Reference in New Issue
Block a user