feat(plugins): Add workspace-diagnostics.nvim
and trouble.nvim
Fix `nvim-navic` for some LSPs
This commit is contained in:
parent
b2f592d529
commit
9e58b1629d
11 changed files with 101 additions and 66 deletions
|
@ -16,5 +16,9 @@ vim.lsp.start {
|
|||
cmd = { 'asm-lsp' },
|
||||
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)
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
|
||||
end,
|
||||
-- capabilities = { offsetEncoding = "utf-8" },
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -25,6 +25,10 @@ vim.lsp.start {
|
|||
cmd = { lua_ls_cmd },
|
||||
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("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
|
||||
require("nvim-navic").attach(client, bufnr)
|
||||
end,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
|
|
|
@ -15,4 +15,8 @@ vim.lsp.start {
|
|||
cmd = { 'nil' },
|
||||
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)
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -15,29 +15,8 @@ vim.lsp.start {
|
|||
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
|
||||
-- capabilities = require('user.lsp').make_client_capabilities(),
|
||||
single_file_support = true,
|
||||
on_attach = function(client, bufnr)
|
||||
require("nvim-navic").attach(client, bufnr)
|
||||
require("workspace-diagnostics").populate_workspace_diagnostics(client, bufnr)
|
||||
end,
|
||||
}
|
||||
|
||||
-- local dap = require("dap")
|
||||
--
|
||||
-- if require('user.file_exists').file_exists(vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) .. "/.vscode/launch.json") then
|
||||
-- require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } })
|
||||
-- end
|
||||
--
|
||||
-- dap.adapters.gdb = {
|
||||
-- type = "executable",
|
||||
-- command = "gdb",
|
||||
-- args = { "-i", "dap" }
|
||||
-- }
|
||||
--
|
||||
-- dap.configurations.c = {
|
||||
-- {
|
||||
-- name = "Launch",
|
||||
-- type = "gdb",
|
||||
-- request = "launch",
|
||||
-- program = function()
|
||||
-- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
-- end,
|
||||
-- cwd = "${workspaceFolder}",
|
||||
-- stopAtBeginningOfMainSubprogram = false,
|
||||
-- },
|
||||
-- }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue