vimspector icon indicating copy to clipboard operation
vimspector copied to clipboard

[Feature Request]: Hot-Reloading in Dart / Flutter

Open tkreuder opened this issue 2 years ago • 7 comments

Hi, I followed the conversation in #434 and I wanted to ask if the hot-reloading approach of dart in emacs can serve as a template: https://github.com/emacs-lsp/lsp-dart/blob/master/lsp-dart-dap.el#L379. https://github.com/emacs-lsp/dap-mode

Thanks a lot for this awesome plugin ❤️

tkreuder avatar Jul 11 '22 08:07 tkreuder

the code for some random other DAP client is not a documented and supported API extension.

Currently dart/flutter support is only "community maintained" : https://github.com/puremourning/vimspector/wiki/Additional-Language-Support#dart--flutter

That is there is no way to provide custom DAP code for dart unless someone wants to own and contributed full support for it in vimspector, including samples, tests, documentation and user support.

There's almost 0 chance that I will do that because I don't (and never have) used dart.

puremourning avatar Jul 11 '22 09:07 puremourning

So looking at the emacs code, it "pushes" a hotReload request to the DAP server on save?

puremourning avatar Jul 11 '22 09:07 puremourning

you could maybe hack something like this, but obviously I wouldn't support it and I haven't tested it.

function! s:DartHotReload()
    if py3eval( 'not _vimspector_session or not _vimspector_session._connection' )
      return
    endif
    py3 _vimspector_session._connection.DoRequest( None, { 'command': 'hotReload' } )
endfunction

autocmd BufWritePost *.dart call s:DartHotReload()

puremourning avatar Jul 11 '22 10:07 puremourning

So looking at the emacs code, it "pushes" a hotReload request to the DAP server on save?

Yes! It looks like this!

Thanks a lot for your help! I will give it try 👍

tkreuder avatar Jul 11 '22 19:07 tkreuder

It works like a charm ❤️

tkreuder avatar Jul 12 '22 20:07 tkreuder

FYI: Added it to the Wiki: https://github.com/puremourning/vimspector/wiki/Additional-Language-Support#hot-reload

tkreuder avatar Jul 12 '22 20:07 tkreuder

Could you add this to #434 ? This is the first google entry that can be found typing the keyword: vimspector flutter hot reloading in this g**** search engine. So it might be of help to a lot of people hopefully :)

tkreuder avatar Jul 12 '22 20:07 tkreuder

As mentioned, it's unlikely that this will be supported unless DAP learns this feature.

puremourning avatar Apr 21 '23 11:04 puremourning