Make dart debugger work with :FlutterRun

This commit is contained in:
Marco 2024-02-23 23:15:50 +01:00
parent 95c376c0ff
commit cac0d5fe8b
2 changed files with 18 additions and 22 deletions

View File

@ -1,21 +0,0 @@
local dap = require('dap')
dap.adapters.dart = {
type = "executable",
-- As of this writing, this functionality is open for review in https://github.com/flutter/flutter/pull/91802
command = "flutter",
args = { "debug_adapter" }
}
dap.configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch Flutter Program",
-- The nvim-dap plugin populates this variable with the filename of the current buffer
program = "./lib/main.dart",
-- The nvim-dap plugin populates this variable with the editor's current working directory
cwd = "${workspaceFolder}",
-- This gets forwarded to the Flutter CLI tool, substitute `linux` for whatever device you wish to launch
toolArgs = { "-d", "chrome" }
}
}

View File

@ -1 +1,18 @@
require('flutter-tools').setup {}
require('flutter-tools').setup {
debugger = { -- integrate with nvim dap + install dart code debugger
enabled = true,
run_via_dap = true,
exception_breakpoints = {},
register_configurations = function(paths)
require("dap").configurations.dart = {
{
type = "dart",
request = "launch",
name = "Launch Flutter Program",
program = "./lib/main.dart",
cwd = "${workspaceFolder}",
}
}
end,
},
}