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
Inspector navigation doesn't work in noDebug mode with the SDK DAPs #4878
Comments
Some options:
|
@jacob314 @jwren I've tested some possible fixes that don't require SDK releases/hot-fixes. I'm interested in your opinions. The details of each fix is above. I haven't implemented any SDK changes yet because I think the changes there will be too risky for a hotfix so will have to wait for the next SDK release. At first I thought (1) would be a good fix (and would be implemented in the extension where we'll ultimately connect to DTD). However, after implementing it I realised it was missing URI mappings (required for google3) and although we could add that, it'll make the solution more complicated. My feeling is that we should ship (3) which feels like the simplest/least risky change. We rewrite the While (2) works, it also may teach users that they need to use Debug mode for this functionality, and if we decide that's not the long-term behaviour we want, that's a little odd (I've opened #4876 about determining exactly what we want the difference between Run/Debug to be). |
@DanTup Thanks for articulating the current situation, yes option (3) looks to be the most pragmatic. |
Great - I'll add some tests tomorrow with a simulated navigate ToolEvent and ensure we handle it in both debug + noDebug mode, and then I'll push this out in the pre-release version of the extension. I'd like to leave it there at least a few days / a week before doing a stable hotfix just to ensure there aren't any unexpected consequences I didn't find in my own testing. I'll also think a bit more about #4876 so we can try plan a "proper" fix (for example one that won't cause noDebug sessions to use --start-pause which might slow down startup a little). |
I've merged the fix for this and published a pre-release version. If nothing comes up for the rest of the week, I'll push a stable patch out for this. |
Thank you! Making sure inspector navigation works outside of debug mode is a P0. We should think about how we can test it better end to end. For example, maybe IDEs could start ACKing when they accept a code navigation request so DevTools can at least display a warning message and track analytics. E.g. "something went wrong and your IDE wasn't able to navigate to the location... go here for tips on setting up your IDE..." |
The new tests I added here will post a navigation event:
And the tests will verify that file is actually opened: Dart-Code/src/test/flutter_debug/flutter_run.test.ts Lines 270 to 274 in da36c47
Wrapping up the We can't respond directly to this event (because it's a stream of events and not a request, and there could in theory be multiple or zero connected IDEs) so I'm not sure how worthwhile it is changing how this works if we have tests at both sides (verifying Flutter sends the event, and verifying IDEs given an event perform the navigation). |
It might not be obvious to users (especially as it changed with the new adapters) that they should run using Debug mode to get some functionality from the inspector (navigating to files as they select widgets).
#4876 is for deciding (and documenting) the differences between Run/Debug (which should probably be based on specific features rather than arbitrarily what comes over the VM Service) but in the short-term we should do something to avoid confusion from users that don't realise navigation only works in Debug mode.
As a minimum, we should warn users opening the inspector that they should use Debug mode, but we should also evaluate other options (such as a hotfix that connects the VM Service for noDebug mode, or forcing noDebug mode
off
in the extension and intercepting breakpoints/pause-on-exception requests).The text was updated successfully, but these errors were encountered: