From a0aae4711dfb89a3465cb15d39c2bf90438a369d Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Tue, 3 Dec 2024 03:12:40 +0100 Subject: [PATCH] fix(plugin/overseer,dap): Overseer not loading, simplify DAP config (a bit) --- nvim/ftplugin/c.lua | 6 ++++-- nvim/plugin/overseer.lua | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nvim/ftplugin/c.lua b/nvim/ftplugin/c.lua index 4f13718..7475a5e 100644 --- a/nvim/ftplugin/c.lua +++ b/nvim/ftplugin/c.lua @@ -11,10 +11,12 @@ local root_files = { '.git', } +local root = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) + vim.lsp.start { name = 'clangd', cmd = { 'clangd' }, - root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + root_dir = root, capabilities = require('user.lsp').make_client_capabilities(), filetypes = { "c" }, on_attach = function(client, bufnr) @@ -39,7 +41,7 @@ if vim.fn.executable('gdb') == 1 then end -- DAP loads this automatically as of now. May be needed to load the debugger for asm? --- if require('user.file_exists').file_exists(vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) .. "/.vscode/launch.json") then +-- if require('user.file_exists').file_exists(root .. "/.vscode/launch.json") then -- require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } }) -- require("dap.ext.vscode").load_launchjs(nil, { gdb = { "c", "cpp", "asm" } }) -- end diff --git a/nvim/plugin/overseer.lua b/nvim/plugin/overseer.lua index c5c93e7..7d4514b 100644 --- a/nvim/plugin/overseer.lua +++ b/nvim/plugin/overseer.lua @@ -8,7 +8,7 @@ local file_exists = require("user.file_exists").file_exists require("which-key").add({ { "o", group = "[o]verseer", icon = "" }, { "ot", "OverseerToggle", desc = "[o]verseer: [t]oggle " }, - { "oc", "OverseerRunCmd", desc = "[o]verseer: run [c]ommand" }, + { "oc", "OverseerRunCmd", desc = "[o]verseer: run [c]ommand" }, { "or", "OverseerRun", desc = "[o]verseer: [r]un task" }, { "oq", "OverseerQuickAction", desc = "[o]verseer: [q]uick action" }, { "oa", "OverseerTaskAction", desc = "[o]verseer: task [a]ction" }, @@ -20,10 +20,10 @@ local root_files = { '.git', } -local root = vim.fs.find(root_files, { upward = true })[1] +local root = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]) if root then - if file_exists(root .. ".vscode/tasks.json") then + if file_exists(root .. "/.vscode/tasks.json") then require('overseer').setup({ strategy = { "toggleterm",