feat(plugins): Add workspace-diagnostics.nvim and trouble.nvim

Fix `nvim-navic` for some LSPs
This commit is contained in:
Jiří Štefka 2024-10-01 12:55:40 +02:00
parent b2f592d529
commit 9e58b1629d
Signed by: jiriks74
GPG key ID: 1D5E30D3DB2264DE
11 changed files with 101 additions and 66 deletions
nvim/ftplugin

View file

@ -17,8 +17,9 @@ vim.lsp.start {
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = require('user.lsp').make_client_capabilities(),
on_attach = function(client, bufnr)
require("nvim-navic").attach(client, bufnr)
end
require("nvim-navic").attach(client, bufnr)
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
end
}
local dap = require("dap")
@ -59,19 +60,19 @@ if vim.fn.executable('OpenDebugAD7') == 1 then
return coroutine.create(function(coro)
local opts = {}
pickers
.new(opts, {
prompt_title = "Path to executable",
finder = finders.new_oneshot_job({ "fd", "--hidden", "--no-ignore", "--type", "x" }, {}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(buffer_number)
actions.select_default:replace(function()
actions.close(buffer_number)
coroutine.resume(coro, action_state.get_selected_entry()[1])
end)
return true
end,
})
:find()
.new(opts, {
prompt_title = "Path to executable",
finder = finders.new_oneshot_job({ "fd", "--hidden", "--no-ignore", "--type", "x" }, {}),
sorter = conf.generic_sorter(opts),
attach_mappings = function(buffer_number)
actions.select_default:replace(function()
actions.close(buffer_number)
coroutine.resume(coro, action_state.get_selected_entry()[1])
end)
return true
end,
})
:find()
end)
end,
stopAtBeginningOfMainSubprogram = true,