···
dap.adapters.ocamlearlybird = {
command = 'ocamlearlybird',
10
+
cwd = "${workspaceFolder}",
13
+
local pickers = require("telescope.pickers")
14
+
local finders = require("telescope.finders")
15
+
local conf = require("telescope.config").values
16
+
local actions = require("telescope.actions")
17
+
local action_state = require("telescope.actions.state")
dap.configurations.ocaml = {
24
+
-- https://github.com/hackwaly/ocamlearlybird/issues/75
25
+
arguments = function()
26
+
return vim.split(vim.fn.input('Arguments: '), " ", { trimempty = true })
18
-
local path = vim.fn.input({
19
-
prompt = 'Path to executable: ',
20
-
default = vim.fn.getcwd() .. '/_build/default/bin/',
23
-
return (path and path ~= "") and path or dap.ABORT
29
+
return coroutine.create(function(coro)
33
+
prompt_title = "Path to executable",
34
+
finder = finders.new_oneshot_job({ "fd", "--hidden", "--no-ignore", "--type", "x" }, {}),
35
+
sorter = conf.generic_sorter(opts),
36
+
attach_mappings = function(buffer_number)
37
+
actions.select_default:replace(function()
38
+
actions.close(buffer_number)
39
+
coroutine.resume(coro, action_state.get_selected_entry()[1])
···
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.scopes)
end, { desc = 'DAP scopes' })
68
+
vim.keymap.set('n', '<leader>;t', function() require('dap').terminate() end, { desc = 'DAP terminate' })