Skip to content

Commit

Permalink
refactor!: remove schemastore from default plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mehalter committed Apr 1, 2024
1 parent fb1abe9 commit aeb24b0
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 74 deletions.
132 changes: 59 additions & 73 deletions lua/astronvim/plugins/_astrolsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,68 @@ return {
end,
},
},
---@param opts AstroLSPOpts
opts = function(_, opts)
local schemastore_avail, schemastore = pcall(require, "schemastore")
---@type AstroLSPOpts
local extension = {
features = {
autoformat = true,
codelens = true,
diagnostics_mode = 3,
inlay_hints = false,
lsp_handlers = true,
semantic_tokens = true,
},
capabilities = vim.tbl_deep_extend("force", vim.lsp.protocol.make_client_capabilities(), {
textDocument = {
completion = {
completionItem = {
documentationFormat = { "markdown", "plaintext" },
snippetSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
deprecatedSupport = true,
commitCharactersSupport = true,
tagSupport = { valueSet = { 1 } },
resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits" } },
},
},
foldingRange = { dynamicRegistration = false, lineFoldingOnly = true },
},
}),
config = {
jsonls = {
settings = {
json = {
schemas = schemastore_avail and schemastore.json.schemas() or nil,
validate = { enable = schemastore_avail },
},
---@type AstroLSPOpts
opts = {
features = {
autoformat = true,
codelens = true,
diagnostics_mode = 3,
inlay_hints = false,
lsp_handlers = true,
semantic_tokens = true,
},
capabilities = vim.tbl_deep_extend("force", vim.lsp.protocol.make_client_capabilities(), {
textDocument = {
completion = {
completionItem = {
documentationFormat = { "markdown", "plaintext" },
snippetSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
deprecatedSupport = true,
commitCharactersSupport = true,
tagSupport = { valueSet = { 1 } },
resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits" } },
},
},
yamlls = { settings = { yaml = { schemas = schemastore_avail and schemastore.json.schemas() or nil } } },
lua_ls = { settings = { Lua = { workspace = { checkThirdParty = false } } } },
foldingRange = { dynamicRegistration = false, lineFoldingOnly = true },
},
diagnostics = {
virtual_text = true,
signs = {
active = {
{ name = "DiagnosticSignError", text = "", texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignHint", text = "󰌵", texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = "󰋼", texthl = "DiagnosticSignInfo" },
{ name = "DiagnosticSignWarn", text = "", texthl = "DiagnosticSignWarn" },
{ name = "DapBreakpoint", text = "", texthl = "DiagnosticInfo" },
{ name = "DapBreakpointCondition", text = "", texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = "", texthl = "DiagnosticError" },
{ name = "DapLogPoint", text = ".>", texthl = "DiagnosticInfo" },
{ name = "DapStopped", text = "󰁕", texthl = "DiagnosticWarn" },
},
},
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focused = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
}),
config = {
lua_ls = { settings = { Lua = { workspace = { checkThirdParty = false } } } },
},
diagnostics = {
virtual_text = true,
signs = {
active = {
{ name = "DiagnosticSignError", text = "", texthl = "DiagnosticSignError" },
{ name = "DiagnosticSignHint", text = "󰌵", texthl = "DiagnosticSignHint" },
{ name = "DiagnosticSignInfo", text = "󰋼", texthl = "DiagnosticSignInfo" },
{ name = "DiagnosticSignWarn", text = "", texthl = "DiagnosticSignWarn" },
{ name = "DapBreakpoint", text = "", texthl = "DiagnosticInfo" },
{ name = "DapBreakpointCondition", text = "", texthl = "DiagnosticInfo" },
{ name = "DapBreakpointRejected", text = "", texthl = "DiagnosticError" },
{ name = "DapLogPoint", text = ".>", texthl = "DiagnosticInfo" },
{ name = "DapStopped", text = "󰁕", texthl = "DiagnosticWarn" },
},
},
flags = {},
formatting = { format_on_save = { enabled = true }, disabled = {} },
handlers = { function(server, server_opts) require("lspconfig")[server].setup(server_opts) end },
servers = {},
on_attach = nil,
}
return require("astrocore").extend_tbl(opts, extension)
end,
update_in_insert = true,
underline = true,
severity_sort = true,
float = {
focused = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
},
flags = {},
formatting = { format_on_save = { enabled = true }, disabled = {} },
handlers = { function(server, server_opts) require("lspconfig")[server].setup(server_opts) end },
servers = {},
on_attach = nil,
},
}
1 change: 0 additions & 1 deletion lua/astronvim/plugins/lsp.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
return {
{ "b0o/SchemaStore.nvim", lazy = true },
{ "folke/neodev.nvim", lazy = true, opts = {} },
{
"neovim/nvim-lspconfig",
Expand Down

0 comments on commit aeb24b0

Please sign in to comment.