-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96eabc1
commit 5c9f8af
Showing
7 changed files
with
150 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md | ||
-- | ||
local M = {} | ||
|
||
function M.adapters(callback, _) | ||
local stdout = vim.loop.new_pipe(false) | ||
local handle | ||
local pid_or_err | ||
local port = 38697 | ||
local opts = { | ||
stdio = { nil, stdout }, | ||
args = { 'dap', '-l', '127.0.0.1:' .. port }, | ||
detached = true, | ||
} | ||
|
||
handle, pid_or_err = vim.loop.spawn('dlv', opts, function(code) | ||
stdout:close() | ||
handle:close() | ||
if code ~= 0 then | ||
print('dlv exited with code', code) | ||
end | ||
end) | ||
|
||
assert(handle, 'Error running dlv: ' .. tostring(pid_or_err)) | ||
stdout:read_start(function(err, chunk) | ||
assert(not err, err) | ||
if chunk then | ||
vim.schedule(function() | ||
require('dap.repl').append(chunk) | ||
end) | ||
end | ||
end) | ||
|
||
-- Wait for delve to start | ||
vim.defer_fn(function() | ||
callback({ type = 'server', host = '127.0.0.1', port = port }) | ||
end, 100) | ||
end | ||
|
||
M.configuration = { | ||
{ | ||
type = 'go', | ||
name = 'Debug', | ||
request = 'launch', | ||
program = '${file}', | ||
}, | ||
|
||
{ | ||
type = 'go', | ||
name = 'Debug test', -- configuration for debugging test files | ||
request = 'launch', | ||
mode = 'test', | ||
program = '${file}', | ||
}, | ||
|
||
{ | ||
type = 'go', | ||
name = 'Debug test (go.mod)', | ||
request = 'launch', | ||
mode = 'test', | ||
program = './${relativeFileDirname}', | ||
}, | ||
} | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
local M = {} | ||
|
||
M.adapters = { | ||
type = 'executable', | ||
command = 'haskell-debug-adapter', | ||
args = { '--hackage-version=0.0.35.0' }, | ||
} | ||
|
||
M.configuration = { | ||
{ | ||
type = 'haskell', | ||
request = 'launch', | ||
name = 'Debug', | ||
workspace = '${workspaceFolder}', | ||
startup = '${file}', | ||
stopOnEntry = true, | ||
logFile = vim.fn.stdpath('data') .. '/haskell-dap.log', | ||
logLevel = 'WARNING', | ||
ghciEnv = vim.empty_dict(), | ||
ghciPrompt = 'λ: ', | ||
-- Adjust the prompt to the prompt you see when you invoke the stack ghci command below | ||
ghciInitialPrompt = 'λ: ', | ||
ghciCmd = 'stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show', | ||
}, | ||
} | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters