You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please support hot reload for certain assets #5031
I've a Flutter app that contains a lot of markdown files as assets and needs to display them.
Changing such a file doesn't automatically trigger a hot reload so I have to manually press the yellow lightening button to verify whether my changes to those files look good. It would improve quality of life if this could happen automatically.
Hence, it would be nice if the plugin would use the pubspec file to find all assets and then optionally also hot reload if those assets are changed. Or just add md to the list of watched files in the shouldHotReloadFor function :)
I think this should be opt-in because it might be unexpected if you're editing a README or something and it triggers reload (not to mention that the use case for .md is equally applicable to other assets).
This fix was included in a new pre-release version. If you want to test it out without waiting for the next stable version, you can switch to the pre-release versions of the extensions in VS Code using the button shown in the screenshot below.
At first, I used "assets/**" as pattern which didn't work but when I added the **/ prefix, it worked like a charm. I added the configuration as a workspace setting to my project so it gets only activated for my wiki project. Thanks.
Yeah, the pattern is matched against the full path:
The pattern is matched against the absolute path of the file. Use **/assets/** to trigger reloading for everything in the assets directory.
There was something odd when we didn't do it this way but I don't recall what off the top off my head (this use of globs was copied from a similar legacy setting we had for formatting).
Glad it's working :)
Reacted by Stefan Matthias Aust and mono — Masayuki Ono
Activity
DanTup commentedon Mar 12, 2024
I think this should be opt-in because it might be unexpected if you're editing a README or something and it triggers reload (not to mention that the use case for
.mdis equally applicable to other assets).DanTup commentedon Mar 12, 2024
I added a new setting for this:
DanTup commentedon Mar 14, 2024
This fix was included in a new pre-release version. If you want to test it out without waiting for the next stable version, you can switch to the pre-release versions of the extensions in VS Code using the button shown in the screenshot below.
Please let me know if you hit any issues. Thanks!
sma commentedon Mar 19, 2024
At first, I used
"assets/**"as pattern which didn't work but when I added the**/prefix, it worked like a charm. I added the configuration as a workspace setting to my project so it gets only activated for my wiki project. Thanks.DanTup commentedon Mar 19, 2024
Yeah, the pattern is matched against the full path:
There was something odd when we didn't do it this way but I don't recall what off the top off my head (this use of globs was copied from a similar legacy setting we had for formatting).
Glad it's working :)
jacob314 commentedon Apr 2, 2024
If this works well it is probably worth specifying in pubspec.yaml