still working on it, on attach is not firing :/
This commit is contained in:
parent
1cefee76d8
commit
26597230e3
@ -14,9 +14,29 @@ return {
|
||||
automatic_enable = true,
|
||||
ensure_installed = {
|
||||
"lua_ls",
|
||||
"gopls"
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
-- get all the servers that are available thourgh mason-lspconfig
|
||||
local all_mslp_servers = vim.tbl_keys(require("mason-lspconfig").get_mappings().lspconfig_to_package)
|
||||
|
||||
local ensure_installed = {} ---@type string[]
|
||||
for server, server_opts in pairs(require("lazyvim.plugins.lsp.config").opts.servers) do
|
||||
if server_opts then
|
||||
server_opts = server_opts == true and {} or server_opts
|
||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
||||
if server_opts.mason == true or vim.tbl_contains(all_mslp_servers, server) then
|
||||
ensure_installed[#ensure_installed + 1] = server
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
opts.ensure_installed = vim.tbl_deep_extend("force",
|
||||
{},
|
||||
opts.ensure_installed or {},
|
||||
ensure_installed)
|
||||
|
||||
require("mason-lspconfig").setup(opts)
|
||||
require("lazyvim.plugins.lsp.config").setup()
|
||||
end,
|
||||
|
||||
@ -167,4 +167,37 @@ function M.exists(path)
|
||||
end
|
||||
end
|
||||
|
||||
local format = string.format
|
||||
local rep = string.rep
|
||||
local write = io.write
|
||||
|
||||
---Recursively print the table, if not table value is just printed.
|
||||
---@param t any
|
||||
---@param level? number
|
||||
function M.print_table(t, level)
|
||||
level = level or 0
|
||||
if type(t) == "table" then
|
||||
-- do not print new line on the level 0
|
||||
if level ~= 0 then
|
||||
print("\n")
|
||||
end
|
||||
print(rep("\t", level), "{\n")
|
||||
level = level + 1
|
||||
|
||||
for key, value in pairs(t) do
|
||||
print(rep("\t", level) .. format("[%s] = ", key))
|
||||
M.print_table(value, level)
|
||||
end
|
||||
|
||||
level = level - 1
|
||||
print(rep("\t", level), "}")
|
||||
else
|
||||
print(tostring(t))
|
||||
end
|
||||
-- print new line on the level 0
|
||||
if level == 0 then
|
||||
print("\n")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Loading…
Reference in New Issue
Block a user