Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tkreuder opened this issue Jul 11, 2022 · 8 comments
Closed

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

tkreuder opened this issue Jul 11, 2022 · 8 comments

Comments

@tkreuder
Copy link

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 ❤️

@puremourning
Copy link
Owner

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
Copy link
Owner

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

@puremourning
Copy link
Owner

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()

@tkreuder
Copy link
Author

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
Copy link
Author

It works like a charm ❤️

@tkreuder
Copy link
Author

@tkreuder
Copy link
Author

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 :)

@puremourning
Copy link
Owner

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants