Add dap support
This commit is contained in:
parent
e5f3edd8c8
commit
c56438c44b
5 changed files with 70 additions and 6 deletions
|
@ -20,12 +20,15 @@
|
||||||
"multicursor.nvim": { "branch": "1.0", "commit": "ffe2e402e85150516d096842f7be99fd1321a72b" },
|
"multicursor.nvim": { "branch": "1.0", "commit": "ffe2e402e85150516d096842f7be99fd1321a72b" },
|
||||||
"neoconf.nvim": { "branch": "main", "commit": "a7b03bc23971ea9d569da70e21817d9d49b78c19" },
|
"neoconf.nvim": { "branch": "main", "commit": "a7b03bc23971ea9d569da70e21817d9d49b78c19" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" },
|
"nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" },
|
||||||
|
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||||
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
||||||
"nvim-genghis": { "branch": "main", "commit": "cdf584d05ffc9d5c1f247079991552249e4f7487" },
|
"nvim-genghis": { "branch": "main", "commit": "cdf584d05ffc9d5c1f247079991552249e4f7487" },
|
||||||
"nvim-jdtls": { "branch": "master", "commit": "b69924ca90014fef485ee153571bdcbc1ece8c2e" },
|
"nvim-jdtls": { "branch": "master", "commit": "b69924ca90014fef485ee153571bdcbc1ece8c2e" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "0864f81c681e15d9bdc1156fe3a17bd07db5a3ed" },
|
"nvim-lint": { "branch": "master", "commit": "0864f81c681e15d9bdc1156fe3a17bd07db5a3ed" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" },
|
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" },
|
||||||
"nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" },
|
"nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" },
|
||||||
"nvim-metals": { "branch": "main", "commit": "db6c9ffb32ec698b96d11cba1317dccc26f5c16d" },
|
"nvim-metals": { "branch": "main", "commit": "db6c9ffb32ec698b96d11cba1317dccc26f5c16d" },
|
||||||
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
"nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" },
|
"nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "41847d3dafb5004464708a3db06b14f12bde548a" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "41847d3dafb5004464708a3db06b14f12bde548a" },
|
||||||
|
|
|
@ -23,7 +23,7 @@ return {
|
||||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||||
},
|
},
|
||||||
-- Set up format-on-save
|
-- Set up format-on-save
|
||||||
format_on_save = { timeout_ms = 500, lsp_fallback = true },
|
--format_on_save = { timeout_ms = 500, lsp_fallback = true },
|
||||||
-- Customize formatters
|
-- Customize formatters
|
||||||
formatters = {
|
formatters = {
|
||||||
shfmt = {
|
shfmt = {
|
||||||
|
|
60
lua/plugins/dap.lua
Normal file
60
lua/plugins/dap.lua
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
config = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
dap.adapters["pwa-node"] = {
|
||||||
|
type = "server",
|
||||||
|
host = "localhost",
|
||||||
|
port = "${port}",
|
||||||
|
executable = {
|
||||||
|
command = "js-debug-adapter",
|
||||||
|
args = { "${port}" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dap.configurations.javascript = {
|
||||||
|
{
|
||||||
|
type = "pwa-node",
|
||||||
|
request = "launch",
|
||||||
|
name = "Launch file",
|
||||||
|
program = "${file}",
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = 'pwa-node',
|
||||||
|
request = 'attach',
|
||||||
|
name = 'Attach to Node app',
|
||||||
|
address = 'localhost',
|
||||||
|
port = 9229,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
restart = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||||
|
config = function(opts)
|
||||||
|
local dap, dapui = require("dap"), require("dapui")
|
||||||
|
dapui.setup(opts)
|
||||||
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
|
dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ return {
|
||||||
-- See the configuration section for more details
|
-- See the configuration section for more details
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
"nvim-dap-ui"
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -46,9 +47,9 @@ return {
|
||||||
completion = {
|
completion = {
|
||||||
documentation = { auto_show = false },
|
documentation = { auto_show = false },
|
||||||
list = { selection = { preselect = false, auto_insert = true } },
|
list = { selection = { preselect = false, auto_insert = true } },
|
||||||
|
ghost_text = { enabled = true },
|
||||||
},
|
},
|
||||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||||
ghost_text = { enabled = true },
|
|
||||||
},
|
},
|
||||||
opts_extend = { "sources.default" },
|
opts_extend = { "sources.default" },
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,22 +23,22 @@ return {
|
||||||
--},
|
--},
|
||||||
config = function()
|
config = function()
|
||||||
local highlightLines = {
|
local highlightLines = {
|
||||||
"RainbowRed",
|
"RainbowCyan",
|
||||||
"RainbowYellow",
|
"RainbowYellow",
|
||||||
"RainbowBlue",
|
"RainbowBlue",
|
||||||
"RainbowOrange",
|
"RainbowOrange",
|
||||||
"RainbowGreen",
|
"RainbowGreen",
|
||||||
"RainbowViolet",
|
"RainbowViolet",
|
||||||
"RainbowCyan",
|
"RainbowRed",
|
||||||
}
|
}
|
||||||
local highlightDimLines = {
|
local highlightDimLines = {
|
||||||
"RainbowDimRed",
|
"RainbowDimCyan",
|
||||||
"RainbowDimYellow",
|
"RainbowDimYellow",
|
||||||
"RainbowDimBlue",
|
"RainbowDimBlue",
|
||||||
"RainbowDimOrange",
|
"RainbowDimOrange",
|
||||||
"RainbowDimGreen",
|
"RainbowDimGreen",
|
||||||
"RainbowDimViolet",
|
"RainbowDimViolet",
|
||||||
"RainbowDimCyan",
|
"RainbowDimRed",
|
||||||
}
|
}
|
||||||
local hooks = require 'ibl.hooks'
|
local hooks = require 'ibl.hooks'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue