Skip to content

Commit

Permalink
Merge pull request #655 from MasahiroSakoda/654-feat-cleanup-dap-config
Browse files Browse the repository at this point in the history
feat: cleanup dap config
  • Loading branch information
MasahiroSakoda authored Nov 15, 2024
2 parents 02432ed + e8e3dfa commit 827bc1f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
8 changes: 5 additions & 3 deletions home/dot_config/nvim/lua/dap/adapters/javascript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ dapjs.setup({
node_path = "node",
debugger_path = debugger_path,
debugger_cmd = { "js-debug-adapter" },
adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" }, -- which adapters to register in nvim-dap
-- log_file_path = "(stdpath cache)/dap_vscode_js.log", -- Path for file logging
-- which adapters to register in nvim-dap
adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" },
log_file_path = "(stdpath cache)/dap_vscode_js.log", -- Path for file logging
log_file_level = vim.log.levels.TRACE,
-- log_console_level = vim.log.levels.ERROR, -- Logging level for output to console. Set to false to disable console output.
-- Logging level for output to console. Set to false to disable console output.
log_console_level = vim.log.levels.ERROR,
})

-- Language specific configurations
Expand Down
7 changes: 3 additions & 4 deletions home/dot_config/nvim/lua/dap/config/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ local dap_ok, dap = pcall(require, "dap")
local dapui_ok, dapui = pcall(require, "dapui")
if not (dap_ok or dapui_ok) then return end

-- INFO:
require("dap.ext.vscode").json_decode = require("overseer.json").decode

dapui.setup({
icons = {
expanded = "",
Expand Down Expand Up @@ -88,7 +85,9 @@ dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open()
dap.listeners.after.event_terminated["dapui_config"] = function() dapui.close() end
dap.listeners.after.event_exited["dapui_config"] = function() dapui.open() end

require("overseer").patch_dap(true)
require("dap.ext.vscode").json_decode = require("overseer.json").decode
-- https://github.com/stevearc/overseer.nvim/blob/master/doc/third_party.md#dap
require("overseer").enable_dap()

local bp = {
breakpoint = {
Expand Down
13 changes: 0 additions & 13 deletions home/dot_config/nvim/lua/plugins/dap.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-- -*-mode:lua-*- vim:ft=lua
local filetypes = require("user.filetypes")

return {
{
Expand All @@ -18,16 +17,4 @@ return {
dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" },
config = function() require("dap.config.virtual_text") end,
},

{
"microsoft/vscode-js-debug",
build = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
ft = filetypes.lang.js,
cond = not vim.g.vscode,
},
{
"mxsdev/nvim-dap-vscode-js",
ft = filetypes.lang.js,
config = function() require("dap.adapters.javascript") end,
},
}
2 changes: 1 addition & 1 deletion home/dot_config/nvim/lua/user/filetypes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Filetypes.lsp = {
Filetypes.ignore = {
archive = { "%.tar$", "%.tar.gz$", "%.tar.xz$", "%.zip$", "%.rar$", "%.7z$", "%.bz2$" },
vcs = { ".git/", ".svn/", ".hg/" },
build = { "build/", "dist/", ".cache/", "%.o$", "%.obj$", "%.so$", "%.a$", "%.out$", "%.whl$", "%.bin$" },
build = { "build/", "dist/", "%.o$", "%.obj$", "%.so$", "%.a$", "%.out$", "%.whl$", "%.bin$" },
ide = { ".idea/", ".vscode/", ".project/" },
node = { "node_modules/", ".yarn/", ".pnpm/", ".npm", "%-lock.json$" },
js = { "%.min.js$", "%.min.gzip.js$" },
Expand Down

0 comments on commit 827bc1f

Please sign in to comment.