Skip to content

Commit

Permalink
feat(dap): add option evaluate_to_string_in_debug_views (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidlatau authored Aug 23, 2024
1 parent 55460ea commit 0842bbe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ require("flutter-tools").setup {
-- 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 = {}
-- Whether to call toString() on objects in debug views like hovers and the
-- variables list.
-- Invoking toString() has a performance cost and may introduce side-effects,
-- although users may expected this functionality. null is treated like false.
evaluate_to_string_in_debug_views = true,
register_configurations = function(paths)
require("dap").configurations.dart = {
<put here config that you would find in .vscode/launch.json>
Expand Down
1 change: 1 addition & 0 deletions lua/flutter-tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ local config = {
debugger = {
enabled = false,
exception_breakpoints = nil,
evaluate_to_string_in_debug_views = true,
register_configurations = function(paths)
require("dap").configurations.dart = {
{
Expand Down
3 changes: 3 additions & 0 deletions lua/flutter-tools/runners/debugger_runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ function DebuggerRunner:run(paths, args, cwd, on_run_data, on_run_exit)
launch_config.args = vim.list_extend(launch_config.args or {}, args or {})
launch_config.dartSdkPath = paths.dart_sdk
launch_config.flutterSdkPath = paths.flutter_sdk
if config.debugger.evaluate_to_string_in_debug_views then
launch_config.evaluateToStringInDebugViews = true
end
dap.run(launch_config)
end
)
Expand Down

0 comments on commit 0842bbe

Please sign in to comment.