Closed Zeioth closed 10 months ago
This is the result of :DapShowLog
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
message = "Launching…",
progressId = "launch"
},
event = "dart.progressStart",
seq = 2,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = 'Spawning /opt/flutter/bin/flutter with args ["run","--machine","--start-paused","--target","lib/main.dart"]',
severity = 0
},
event = "dart.log",
seq = 4,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = ".. in /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/flutter/lib",
severity = 0
},
event = "dart.log",
seq = 5,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = " PID: 344342",
severity = 0
},
event = "dart.log",
seq = 6,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = "<== Changing current working directory to: /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/flutter\r\n",
severity = 0
},
event = "dart.log",
seq = 7,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = '<== [{"event":"daemon.connected","params":{"version":"0.6.1","pid":344352}}]\r\n',
severity = 0
},
event = "dart.log",
seq = 9,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = '<== [{"event":"app.start","params":{"appId":"cc7a6607-2497-433a-a851-d1a933425a00","deviceId":"linux","directory":"/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/flutter","supportsRestart":true,"launchMode":"run","mode":"debug"}}]\r\n',
severity = 0
},
event = "dart.log",
seq = 10,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = "<== Launching lib/main.dart on Linux in debug mode...\r\n",
severity = 0
},
event = "dart.log",
seq = 11,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = '<== [{"event":"app.progress","params":{"appId":"cc7a6607-2497-433a-a851-d1a933425a00","id":"0","progressId":null,"message":"Building Linux application...","finished":false}}]\r\n',
severity = 0
},
event = "dart.log",
seq = 13,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
message = "Building Linux application...",
progressId = "launch"
},
event = "dart.progressUpdate",
seq = 14,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = "CMake Error: The current CMakeCache.txt directory /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/flutter/build/linux/x64/debug/CMakeCache.txt is different than the directory /home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/build/build/linux/x64/debug where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt\n",
severity = 2
},
event = "dart.log",
seq = 15,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = 'CMake Error: The source "/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/flutter/linux/CMakeLists.txt" does not match the source "/home/zeioth/.local/share/nvim/lazy/compiler.nvim/tests/examples/dart/build/linux/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.\n',
severity = 2
},
event = "dart.log",
seq = 17,
type = "event"
}
[ WARN ] 2023-08-26T10:56:28Z+0200 ] ...ioth/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:985 ] "No event handler for " {
body = {
category = 9,
message = '<== [{"event":"app.progress","params":{"appId":"cc7a6607-2497-433a-a851-d1a933425a00","id":"0","progressId":null,"finished":true}}]\r\n',
severity = 0
},
event = "dart.log",
seq = 19,
type = "event"
}
Ok it works fine. I solved it
flutter create .
to ensure the project is correct.Updating wiki.
Report: It also works for pure Dart with this config
dap.adapters.dart = {
type = 'executable',
command = vim.fn.stdpath('data')..'/mason/bin/dart-debug-adapter',
args = { 'dart' }
}
dap.configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch flutter",
dartSdkPath = "/opt/flutter/bin/cache/dart-sdk/",
flutterSdkPath = "/opt/flutter",
program = "${workspaceFolder}/main.dart",
cwd = "${workspaceFolder}",
}
}
Ok awesome, I've managed a config that can debug both dart and flutter. Tested and working
-- Dart / Flutter
dap.adapters.dart = {
type = 'executable',
command = vim.fn.stdpath('data')..'/mason/bin/dart-debug-adapter',
args = {'dart'}
}
dap.adapters.flutter = {
type = 'executable',
command = vim.fn.stdpath('data')..'/mason/bin/dart-debug-adapter',
args = {'flutter'}
}
dap.configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch dart",
dartSdkPath = "/opt/flutter/bin/cache/dart-sdk/", -- ensure this is correct
flutterSdkPath = "/opt/flutter", -- ensure this is correct
program = "${workspaceFolder}/lib/main.dart", -- ensure this is correct
cwd = "${workspaceFolder}",
},
{
type = "dart",
request = "launch",
name = "Launch flutter",
dartSdkPath = "/opt/flutter/bin/cache/dart-sdk/", -- ensure this is correct
flutterSdkPath = "/opt/flutter", -- ensure this is correct
program = "${workspaceFolder}/lib/main.dart", -- ensure this is correct
cwd = "${workspaceFolder}",
}
}
Debug adapter definition and debug configuration
Debug adapter version
v3.70.0
Steps to Reproduce
In this hello world flutter project I wrote, I insert a breakpoint and call
:DapContinue
.~/.local/share/nvim/mason/bin/dart-debug-adapter flutter
on the terminal, seems to work fineAs you can see I can debug ok other languages so my setup should be about correct
I've also checked the sdk dir and seems to be correct:
![screenshot_2023-08-26_10-47-49_328696879](https://github.com/mfussenegger/nvim-dap/assets/3357792/59f2dd15-b311-4b69-95e8-a96da0fe2f19)
Expected Result
DAP opens
Actual Result
Nothing happens