Changed lsp to load from mason as dependency
This commit is contained in:
@@ -28,65 +28,79 @@ local lazy_options = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
require("options")
|
|
||||||
require("lazy").setup("plugins", lazy_options)
|
require("lazy").setup("plugins", lazy_options)
|
||||||
|
require("options")
|
||||||
require("remap")
|
require("remap")
|
||||||
|
|
||||||
-- LSP
|
-- LSP
|
||||||
local lsp_servers = require("mason-lspconfig").get_installed_servers()
|
-- local lsp_servers = require("mason-lspconfig").get_installed_servers()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
-- local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
capabilities.textDocument.foldingRange = {
|
-- capabilities.textDocument.foldingRange = {
|
||||||
dynamicRegistration = false,
|
-- dynamicRegistration = false,
|
||||||
lineFoldingOnly = true
|
-- lineFoldingOnly = true
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
require("lspconfig").glsl_analyzer.setup({})
|
-- require("lspconfig").glsl_analyzer.setup({})
|
||||||
for _, server in pairs(lsp_servers) do
|
-- for _, server in pairs(lsp_servers) do
|
||||||
if server == "lua_ls" then
|
-- if server == "lua_ls" then
|
||||||
require("lspconfig")[server].setup({
|
-- require("lspconfig")[server].setup({
|
||||||
capabilities = capabilities,
|
-- capabilities = capabilities,
|
||||||
settings = {
|
-- settings = {
|
||||||
Lua = { diagnostics = { globals = { "vim" } } }
|
-- Lua = {
|
||||||
}
|
-- runtime = {
|
||||||
})
|
-- version = "LuaJIT",
|
||||||
elseif server == "svelte" then
|
-- },
|
||||||
local dyn_cap = vim.lsp.protocol.make_client_capabilities()
|
-- diagnostics = {
|
||||||
dyn_cap.workspace.didChangeWatchedFiles.dynamicRegistration = true
|
-- globals = { "vim" }
|
||||||
dyn_cap.textDocument.foldingRange = {
|
-- }
|
||||||
dynamicRegistration = false,
|
-- }
|
||||||
lineFoldingOnly = true
|
-- }
|
||||||
}
|
-- })
|
||||||
|
-- vim.lsp.enable("lua_ls")
|
||||||
require("lspconfig")[server].setup({
|
-- elseif server == "svelte" then
|
||||||
capabilities = dyn_cap,
|
-- local dyn_cap = vim.lsp.protocol.make_client_capabilities()
|
||||||
on_attach = function(client)
|
-- dyn_cap.workspace.didChangeWatchedFiles.dynamicRegistration = true
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
-- dyn_cap.textDocument.foldingRange = {
|
||||||
pattern = { "*.js", "*.ts" },
|
-- dynamicRegistration = false,
|
||||||
callback = function(ctx)
|
-- lineFoldingOnly = true
|
||||||
client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
-- }
|
||||||
end
|
--
|
||||||
})
|
-- require("lspconfig")[server].setup({
|
||||||
end,
|
-- capabilities = dyn_cap,
|
||||||
settings = {
|
-- on_attach = function(client)
|
||||||
svelte = { plugin = { svelte = { compilerWarnings = {
|
-- vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
["a11y-no-onchange"] = "ignore",
|
-- pattern = { "*.js", "*.ts" },
|
||||||
["a11y-aria-attributes"] = "ignore",
|
-- callback = function(ctx)
|
||||||
["a11y-no-static-element-interactions"] = "ignore",
|
-- client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.match })
|
||||||
["a11y-click-events-have-key-events"] = "ignore",
|
-- end
|
||||||
}}}}
|
-- })
|
||||||
}
|
-- end,
|
||||||
})
|
-- settings = {
|
||||||
else
|
-- svelte = {
|
||||||
require("lspconfig")[server].setup({ capabilities = capabilities })
|
-- plugin = {
|
||||||
end
|
-- svelte = {
|
||||||
end
|
-- compilerWarnings = {
|
||||||
|
-- ["a11y-no-onchange"] = "ignore",
|
||||||
|
-- ["a11y-aria-attributes"] = "ignore",
|
||||||
|
-- ["a11y-no-static-element-interactions"] = "ignore",
|
||||||
|
-- ["a11y-click-events-have-key-events"] = "ignore",
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
-- else
|
||||||
|
-- require("lspconfig")[server].setup({ capabilities = capabilities })
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("LspConfig", {}),
|
group = vim.api.nvim_create_augroup("LspConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||||
|
|
||||||
local opts = { buffer = ev.buf }
|
local opts = { buffer = ev.buf }
|
||||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
|
||||||
@@ -105,15 +119,22 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
|||||||
vim.lsp.buf.format { async = true }
|
vim.lsp.buf.format { async = true }
|
||||||
end, opts)
|
end, opts)
|
||||||
|
|
||||||
require("lsp_signature").on_attach({
|
-- require("lsp_signature").on_attach({
|
||||||
|
--
|
||||||
},ev.buf)
|
-- }, ev.buf)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
--Color
|
--Color
|
||||||
local color = nil
|
-- local color = nil
|
||||||
-- vim.cmd.colorscheme(color or "rose-pine")
|
-- vim.cmd.colorscheme(color or "rose-pine")
|
||||||
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||||
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||||
|
--
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
float = {
|
||||||
|
source = "always",
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "neovim/nvim-lspconfig" },
|
|
||||||
}
|
|
||||||
+23
-2
@@ -1,4 +1,25 @@
|
|||||||
return {
|
return {
|
||||||
{ "williamboman/mason-lspconfig.nvim", config = true },
|
{
|
||||||
{ "williamboman/mason.nvim", config = true },
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
config = function ()
|
||||||
|
require("mason-lspconfig").setup();
|
||||||
|
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = { "vim" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user