diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-25 23:27:45 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-08-25 23:27:45 +0200 |
commit | f93bad12f1b4feeeee007ceab4a350eb1aa26c1e (patch) | |
tree | 15b9edf259fc93da70a599dec47de3cfea551a95 /.config/nvim/lua/core/dap.lua | |
parent | f52dce93777c41671217ced2894c28d6da9114a0 (diff) |
Updates from lvim, remove legacy
Diffstat (limited to '.config/nvim/lua/core/dap.lua')
-rw-r--r-- | .config/nvim/lua/core/dap.lua | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/.config/nvim/lua/core/dap.lua b/.config/nvim/lua/core/dap.lua index a325c7c..6179ea3 100644 --- a/.config/nvim/lua/core/dap.lua +++ b/.config/nvim/lua/core/dap.lua @@ -1,8 +1,9 @@ local M = {} -local Log = require "core.log" + M.config = function() options.builtin.dap = { active = false, + on_config_done = nil, breakpoint = { text = "", texthl = "LspDiagnosticsSignError", @@ -13,11 +14,7 @@ M.config = function() end M.setup = function() - local status_ok, dap = pcall(require, "dap") - if not status_ok then - Log:get_default().error "Failed to load dap" - return - end + local dap = require "dap" vim.fn.sign_define("DapBreakpoint", options.builtin.dap.breakpoint) dap.defaults.fallback.terminal_win_cmd = "50vsplit new" @@ -38,6 +35,27 @@ M.setup = function() s = { "<cmd>lua require'dap'.continue()<cr>", "Start" }, q = { "<cmd>lua require'dap'.close()<cr>", "Quit" }, } + + if options.builtin.dap.on_config_done then + options.builtin.dap.on_config_done(dap) + end end +-- TODO put this up there ^^^ call in ftplugin + +-- M.dap = function() +-- if options.plugin.dap.active then +-- local dap_install = require "dap-install" +-- dap_install.config("python_dbg", {}) +-- end +-- end +-- +-- M.dap = function() +-- -- gem install readapt ruby-debug-ide +-- if options.plugin.dap.active then +-- local dap_install = require "dap-install" +-- dap_install.config("ruby_vsc_dbg", {}) +-- end +-- end + return M |