Added back in schemastore support

This commit is contained in:
Dreaded_X 2025-01-26 05:59:59 +01:00
parent bbe09a41e6
commit 684445b4f7
Signed by: Dreaded_X
GPG Key ID: FA5F485356B0D2D4
3 changed files with 55 additions and 53 deletions

View File

@ -120,14 +120,14 @@ return {
} }
local handler = function(server_name) local handler = function(server_name)
local server = require("tools").servers[server_name] or {} local server = require("tools").servers()[server_name] or {}
server.capabilities = vim.tbl_deep_extend("force", capabilities, server.capabilities or {}) server.capabilities = vim.tbl_deep_extend("force", capabilities, server.capabilities or {})
server.handlers = handlers server.handlers = handlers
require("lspconfig")[server_name].setup(server) require("lspconfig")[server_name].setup(server)
end end
for server, config in pairs(require("tools").servers) do for server, config in pairs(require("tools").servers()) do
if config.system then if config.system then
handler(server) handler(server)
end end

View File

@ -15,13 +15,13 @@ return {
}, },
config = function() config = function()
local tools = require("tools") local tools = require("tools")
local ensure_installed = vim.tbl_keys(vim.tbl_map(function(server) local ensure_installed = vim.tbl_keys(vim.tbl_map(function(tool)
if server.system then if tool.system then
return nil return nil
else else
return server return tool
end end
end, tools.servers)) end, tools.servers()))
ensure_installed = ensure_installed =
vim.list_extend(ensure_installed, require("util.mason").process_formatters(tools.formatters)) vim.list_extend(ensure_installed, require("util.mason").process_formatters(tools.formatters))
ensure_installed = vim.list_extend(ensure_installed, tools.extra) ensure_installed = vim.list_extend(ensure_installed, tools.extra)

View File

@ -1,60 +1,62 @@
local tools = {} local tools = {}
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
tools.servers = { tools.servers = function()
clangd = { return {
cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" }, clangd = {
}, cmd = { "clangd", "--offset-encoding=utf-16", "--clang-tidy" },
gopls = {}, },
pyright = {}, gopls = {},
rust_analyzer = { pyright = {},
system = true, rust_analyzer = {
settings = { system = true,
["rust-analyzer"] = { settings = {
check = { ["rust-analyzer"] = {
command = "clippy", check = {
command = "clippy",
},
}, },
}, },
}, },
}, lua_ls = {
lua_ls = { settings = {
settings = { Lua = {
Lua = { workspace = { checkThirdParty = false },
workspace = { checkThirdParty = false }, telemetry = { enable = false },
telemetry = { enable = false },
},
},
},
jsonls = {
settings = {
json = {
validate = { enable = true },
-- schemas = require("schemastore").json.schemas(),
},
},
},
yamlls = {
settings = {
yaml = {
schemaStore = {
enable = false,
url = "",
}, },
-- schemas = require("schemastore").yaml.schemas(),
}, },
}, },
}, jsonls = {
taplo = {}, settings = {
neocmake = {}, json = {
nil_ls = { validate = { enable = true },
system = true, schemas = require("schemastore").json.schemas(),
}, },
typos_lsp = { },
init_options = {
diagnosticSeverity = "Hint",
}, },
}, yamlls = {
} settings = {
yaml = {
schemaStore = {
enable = false,
url = "",
},
schemas = require("schemastore").yaml.schemas(),
},
},
},
taplo = {},
neocmake = {},
nil_ls = {
system = true,
},
typos_lsp = {
init_options = {
diagnosticSeverity = "Hint",
},
},
}
end
-- https://github.com/stevearc/conform.nvim -- https://github.com/stevearc/conform.nvim
tools.formatters = require("util.conform").assign_formatters({ tools.formatters = require("util.conform").assign_formatters({