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
P0: VS Code: Don't show Hot Reload buttons/commands when not supported #1604
changed the title [-]Don't show Hot Reload buttons/commands when not supported[/-][+]VS Code: Don't show Hot Reload buttons/commands when not supported[/+]on Apr 8, 2019
changed the title [-]VS Code: Don't show Hot Reload buttons/commands when not supported[/-][+]P0: VS Code: Don't show Hot Reload buttons/commands when not supported[/+]on Apr 8, 2019
@devoncarew@jacob314 looks like VS Code is missing something here - we're currently only picking up Service Extensions (via Isolate events of kind ServiceExtensionAdded). In order to tell if Hot Reload is available is looks like we need something different (_Service events like ServiceRegistered?).
Is there any info on this I can scan through (the VM docs only seem to mention service extensions)? In particular, in addition to the registered events, is there a way to see all those that are already registered (for ex. to handle the Attach case)? For service extensions we can get these from isolate.extensionRPCs but I don't know if there's an equiv for services?
I'm also curious about the relationship between these - should I be using both, or does one supersede the other? It likes like DevTools uses both, but I couldn't find any IntelliJ code using ServiceRegistered (but I presume it's going to need to do the same thing as me here?).
nm, this turns out to be relatively straight forward :)
Though it turns out VS Code doesn't currently refresh the debug toolbar on context changes (microsoft/vscode#69398) so for now we're going to have to hard-code this rather than react to the service extensions anyway :(
If you check the devtools code for the hot reload and hot restart buttons
you will see how the buttons are disabled and enabled based on whether the
associated service is available. It is using a private API for triggering
hot reload / hot restart directly over the VMService instead of the Daemon.
@jacob314 Thanks, what's what I figured out. The work is in 4a640e4. I hope this API is stable :-)
Unfortunately VS Code doesn't update contexts once the session has started so it's too late to show/hide the button, so for now I've had to revert it to being hard-coded (though changing this is just a simple revert of the change above if VS Code gets a fix). If Web gets Hot Reload support we'll have to push a VS Code release to change it.
Activity
[-]Don't show Hot Reload buttons/commands when not supported[/-][+]VS Code: Don't show Hot Reload buttons/commands when not supported[/+][-]VS Code: Don't show Hot Reload buttons/commands when not supported[/-][+]P0: VS Code: Don't show Hot Reload buttons/commands when not supported[/+]DanTup commentedon Apr 9, 2019
@devoncarew @jacob314 looks like VS Code is missing something here - we're currently only picking up Service Extensions (via
Isolateevents of kindServiceExtensionAdded). In order to tell if Hot Reload is available is looks like we need something different (_Serviceevents likeServiceRegistered?).Is there any info on this I can scan through (the VM docs only seem to mention service extensions)? In particular, in addition to the registered events, is there a way to see all those that are already registered (for ex. to handle the Attach case)? For service extensions we can get these from
isolate.extensionRPCsbut I don't know if there's an equiv for services?I'm also curious about the relationship between these - should I be using both, or does one supersede the other? It likes like DevTools uses both, but I couldn't find any IntelliJ code using ServiceRegistered (but I presume it's going to need to do the same thing as me here?).
DanTup commentedon Apr 9, 2019
nm, this turns out to be relatively straight forward :)
Though it turns out VS Code doesn't currently refresh the debug toolbar on context changes (microsoft/vscode#69398) so for now we're going to have to hard-code this rather than react to the service extensions anyway :(
Hide hot reload + hot restart commands when unavailable
DanTup commentedon Apr 9, 2019
Fixed in 693612b (by hard-coding known capabilities). Opened #1608 to make this dynamic if VS Code gets a fix.
jacob314 commentedon Apr 9, 2019
DanTup commentedon Apr 10, 2019
@jacob314 Thanks, what's what I figured out. The work is in 4a640e4. I hope this API is stable :-)
Unfortunately VS Code doesn't update contexts once the session has started so it's too late to show/hide the button, so for now I've had to revert it to being hard-coded (though changing this is just a simple revert of the change above if VS Code gets a fix). If Web gets Hot Reload support we'll have to push a VS Code release to change it.