vimspector
vimspector copied to clipboard
[Feature Request]: Hot-Reloading in Dart / Flutter
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 ❤️
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.
So looking at the emacs code, it "pushes" a hotReload request to the DAP server on save?
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()
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 👍
It works like a charm ❤️
FYI: Added it to the Wiki: https://github.com/puremourning/vimspector/wiki/Additional-Language-Support#hot-reload
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 :)
As mentioned, it's unlikely that this will be supported unless DAP learns this feature.