|
|
@ -49,22 +49,22 @@ return { |
|
|
|
|
|
|
|
opts.desc = "Go to previous diagnostic" |
|
|
|
keymap.set("n", "[d", function() |
|
|
|
vim.diagnostic.jump({ count=-1, float=true }) |
|
|
|
vim.diagnostic.jump({ count = -1, float = true }) |
|
|
|
end, opts) |
|
|
|
|
|
|
|
opts.desc = "Go to next diagnostic" |
|
|
|
keymap.set("n", "]d", function() |
|
|
|
vim.diagnostic.jump({ count=1, float=true }) |
|
|
|
vim.diagnostic.jump({ count = 1, float = true }) |
|
|
|
end, opts) |
|
|
|
|
|
|
|
opts.desc = "Go to previous diagnostic (error only)" |
|
|
|
keymap.set("n", "[e", function() |
|
|
|
vim.diagnostic.jump({ count=-1, float=true, severity = vim.diagnostic.severity.ERROR }) |
|
|
|
vim.diagnostic.jump({ count = -1, float = true, severity = vim.diagnostic.severity.ERROR }) |
|
|
|
end, opts) |
|
|
|
|
|
|
|
opts.desc = "Go to next diagnostic (error only)" |
|
|
|
keymap.set("n", "]e", function() |
|
|
|
vim.diagnostic.jump({ count=1, float=true, severity = vim.diagnostic.severity.ERROR }) |
|
|
|
vim.diagnostic.jump({ count = 1, float = true, severity = vim.diagnostic.severity.ERROR }) |
|
|
|
end, opts) |
|
|
|
|
|
|
|
opts.desc = "Show documentation for what is under cursor" |
|
|
@ -102,7 +102,7 @@ return { |
|
|
|
local global_ts = base_path .. "/typescript/lib" |
|
|
|
local found_ts = "" |
|
|
|
local function check_dir(path) |
|
|
|
found_ts = table.concat({path, "typescript", "lib"}, "/") |
|
|
|
found_ts = table.concat({ path, "typescript", "lib" }, "/") |
|
|
|
if vim.loop.fs_stat(found_ts) then |
|
|
|
return path |
|
|
|
end |
|
|
@ -165,13 +165,10 @@ return { |
|
|
|
|
|
|
|
intelephense = { |
|
|
|
root_dir = function(pattern) |
|
|
|
---@diagnostic disable-next-line: undefined-field |
|
|
|
local cwd = vim.loop.cwd() |
|
|
|
local root = util.root_pattern("composer.json")(pattern) |
|
|
|
|
|
|
|
-- prefer cwd if root is a descendant |
|
|
|
return util.path.is_descendant(cwd, root) and cwd or root |
|
|
|
local root = util.root_pattern("composer.json", "composer.lock")(pattern) |
|
|
|
return root or vim.fn.getcwd() |
|
|
|
end, |
|
|
|
single_file_support = false, |
|
|
|
init_options = { |
|
|
|
licenceKey = vim.fn.expand("$HOME/.local/share/nvim/intelephense-licence.txt"), |
|
|
|
}, |
|
|
@ -247,30 +244,11 @@ return { |
|
|
|
|
|
|
|
require("mason").setup() |
|
|
|
|
|
|
|
local ensure_installed = vim.tbl_keys(servers or {}) |
|
|
|
vim.list_extend(ensure_installed, { |
|
|
|
"stylua", |
|
|
|
"prettier", |
|
|
|
"prettierd", |
|
|
|
"eslint", |
|
|
|
"eslint_d", |
|
|
|
"jsonlint", |
|
|
|
"markdownlint", |
|
|
|
"phpcbf", |
|
|
|
"phpcs", |
|
|
|
"golangci-lint", |
|
|
|
"hadolint", |
|
|
|
"gofumpt", |
|
|
|
"goimports", |
|
|
|
}) |
|
|
|
|
|
|
|
require("mason-tool-installer").setup({ |
|
|
|
ensure_installed = ensure_installed, |
|
|
|
run_on_start = false, |
|
|
|
require("mason-lspconfig").setup({ |
|
|
|
ensure_installed = {}, |
|
|
|
automatic_enable = false, |
|
|
|
}) |
|
|
|
|
|
|
|
require("mason-lspconfig").setup() |
|
|
|
|
|
|
|
for server_name, server in pairs(servers) do |
|
|
|
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) |
|
|
|
lspconfig[server_name].setup(server) |
|
|
|