akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FlutterReload and FlutterRestart not working with run_via_dap=true

justjew opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Here's my flutter-tools config

require("flutter-tools").setup({
	debugger = {
		enabled = true,
		run_via_dap = true,
		exception_breakpoints = {},
        }
})

When I start debugger with require("dap").continue(), it runs correctly. Then I change something in code and want to hot reload. But FlutterReload does absolutely nothing. Neither FlutterRestart.

Expected Behavior

Expected behavior is FlutterReload does hot reload

Steps To Reproduce

  1. Install flutter-tools via lazy
  2. Enable debugger and run_via_dap
  3. Run debug by 'dap'.continue
  4. Change some .dart code
  5. Run :FlutterReload
  6. See? Nothing happens

Environment

- OS: Mac OS 13.2.1
- Flutter version: 3.13.0
- Is flutter in $PATH: true
- neovim version: v0.9.1

Anything else?

No response

I've spent the last few days around this "problem". The fact is that if you use :DapContinue, there is no relationship with this tool and thus you won't be able to use :FlutterReload, which has no runner attached.
run_with_dap will run the debugger when you run :FlutterRun (not with :DapContinue) and thus have the debug_runner instance which enables the use of all the standard commands.

The PR #294 will introduce these two custom commands natively in the DAP session.

#294 was merged, so closing this issue.