my demo first config lua
This commit is contained in:
1
back/lua/alpha/dap/configs/golang.lua
Normal file
1
back/lua/alpha/dap/configs/golang.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("dap-go").setup()
|
||||
45
back/lua/alpha/dap/configs/javascript.lua
Normal file
45
back/lua/alpha/dap/configs/javascript.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
require("dap-vscode-js").setup {
|
||||
debugger_cmd = { "js-debug-adapter" },
|
||||
adapters = { "pwa-node", "pwa-chrome", "node-terminal" },
|
||||
}
|
||||
|
||||
for _, language in ipairs { "typescript", "javascript" } do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "attach",
|
||||
name = "Attach",
|
||||
processId = require("dap.utils").pick_process,
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
for _, language in ipairs { "typescriptreact", "javascriptreact" } do
|
||||
require("dap").configurations[language] = {
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
name = "Attach - Remote Debugging",
|
||||
request = "attach",
|
||||
program = "${file}",
|
||||
cwd = vim.fn.getcwd(),
|
||||
sourceMaps = true,
|
||||
protocol = "inspector",
|
||||
port = 9222,
|
||||
webRoot = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = "pwa-chrome",
|
||||
name = "Launch Chrome",
|
||||
request = "launch",
|
||||
url = "http://localhost:3000",
|
||||
},
|
||||
}
|
||||
end
|
||||
27
back/lua/alpha/dap/configs/php.lua
Normal file
27
back/lua/alpha/dap/configs/php.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local dap = require("dap")
|
||||
|
||||
dap.adapters.php = {
|
||||
type = "executable",
|
||||
command = "php-debug-adapter",
|
||||
}
|
||||
|
||||
dap.configurations.php = {
|
||||
{
|
||||
type = "php",
|
||||
request = "launch",
|
||||
name = "Laravel",
|
||||
port = 9003,
|
||||
pathMappings = {
|
||||
["/var/www/html"] = "${workspaceFolder}",
|
||||
},
|
||||
},
|
||||
{
|
||||
type = "php",
|
||||
request = "launch",
|
||||
name = "Symfony",
|
||||
port = 9003,
|
||||
pathMappings = {
|
||||
["/app"] = "${workspaceFolder}",
|
||||
},
|
||||
},
|
||||
}
|
||||
57
back/lua/alpha/dap/configs/rust.lua
Normal file
57
back/lua/alpha/dap/configs/rust.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
local dap = require("dap")
|
||||
|
||||
local rust_adapter = nil
|
||||
local rust_adapters = { "lldb-vscode", "codelldb" }
|
||||
for _, adapter in pairs(rust_adapters) do
|
||||
if vim.fn.executable(adapter) then
|
||||
rust_adapter = adapter
|
||||
end
|
||||
end
|
||||
|
||||
if rust_adapter ~= nil then
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = rust_adapter,
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.configurations.rust = {
|
||||
{
|
||||
name = "launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
local dir = vim.fn.getcwd()
|
||||
return dir .. "/target/debug/" .. vim.fs.basename(dir)
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = function()
|
||||
local resp = vim.fn.input "Arguments: "
|
||||
if resp == "" then
|
||||
return {}
|
||||
end
|
||||
|
||||
return vim.fn.split(resp, " ")
|
||||
end,
|
||||
},
|
||||
{
|
||||
name = "custom",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = function()
|
||||
local resp = vim.fn.input "Arguments: "
|
||||
if resp == "" then
|
||||
return {}
|
||||
end
|
||||
|
||||
return vim.fn.split(resp, " ")
|
||||
end,
|
||||
},
|
||||
}
|
||||
end
|
||||
Reference in New Issue
Block a user