Open akriese opened 11 months ago
UPDATE: It might have something to do with my config somehow, as I recently switched from vim-plug
to lazy.nvim
. Just tried out the old config with the same versions of everything that aren't working with my current config, and that works...
Nevermind, I had altered the flutter-tools
code in the repo clone of my old config. My new config used a fresh clone of the repo without my "fix", that's why it didnt work.
What's fixing the issue for me is setting the option detached
to false
in the adapter config. Like so:
function M.setup(config)
local opts = config.debugger
require("flutter-tools.executable").get(function(paths)
dap.adapters.dart = {
type = "executable",
command = paths.flutter_bin,
args = { "debug-adapter" },
options = {
detached = false,
},
}
opts.register_configurations(paths)
if opts.exception_breakpoints and type(opts.exception_breakpoints) == "table" then
dap.defaults.dart.exception_breakpoints = opts.exception_breakpoints
end
end)
end
I am wondering, wheather this is a useful fix, or if it can be done differently. Also, I am wondering why I seem to be the only person to encounter this issue. If a maintainer of flutter-tools
sees this, could you give me some feedback on this? I guess, otherwise this could be closed :)
Hello,
debugger = {
enabled = false,
run_via_dap = false, -- use dap instead of a plenary job to run flutter apps
-- if empty dap will not stop on any exceptions, otherwise it will stop on those specified
-- see |:help dap.set_exception_breakpoints()| for more info
exception_breakpoints = {}
register_configurations = function(paths)<------------- HERE put debugger config as nvim-dap doc
require("dap").configurations.dart = {
<put here config that you would find in .vscode/launch.json>
}
end,
Yep, that works. So how would I use it with dap
now? I am using dap-ui
and that does not open automatically, as run_with_dap
is false.
You must have enabled in true , and run_via_dap too.
Is there an existing issue for this?
Current Behavior
When running
:FlutterStart
ordap.continue()
, a new shell window is opened, where the debug adapter is run. In nvim, the message pops up:Debug adapter didn't respond. Either the adapter is slow or there is a problem with your adapter or 'dart' configuration.
I am using the following config for flutter-tools:
I've tried using
run_via_dap=false
and this works, but obviously, the debug functionality of dap then is missing. I haven't changed anything about the section and it worked about half a year ago. So, these are the possible problems:I'd like to fix this somehow, but I don't see a good starting point to dig deeper.
Expected Behavior
The debug adapter does not time out and dap-ui etc. is started.
Steps To Reproduce
Config:
Environment
Anything else?
Dap log with TRACE: