fix(ftplugin/c): Setup debugger only if the executable exists
Removed redundant `load_launchjs` as the plugin loads it automatically
This commit is contained in:
parent
b09c001954
commit
b2f592d529
@ -28,23 +28,28 @@ local conf = require("telescope.config").values
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
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 = {
|
||||
if vim.fn.executable('gdb') == 1 then
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "-i", "dap" }
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
dap.adapters.cppdbg = {
|
||||
-- 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
|
||||
-- require("dap.ext.vscode").load_launchjs(nil, { cppdbg = { "c", "cpp", "asm" } })
|
||||
-- require("dap.ext.vscode").load_launchjs(nil, { gdb = { "c", "cpp", "asm" } })
|
||||
-- end
|
||||
|
||||
if vim.fn.executable('OpenDebugAD7') == 1 then
|
||||
dap.adapters.cppdbg = {
|
||||
id = 'cppdbg',
|
||||
type = 'executable',
|
||||
command = 'OpenDebugAD7',
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.c = {
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch an executable",
|
||||
type = "cppdbg",
|
||||
@ -71,4 +76,5 @@ dap.configurations.c = {
|
||||
end,
|
||||
stopAtBeginningOfMainSubprogram = true,
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user