Fix "Open Flutter DevTools" action opening a instance DevTools disconnected from the VM service #8585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work towards #8583
Work towards flutter/devtools#9282
Currently, if a user triggers the "Open Flutter DevTools" command from IntelliJ, it will open up a DevTools instance that is not connected to the VM service, regardless of whether or not the user is already running their app and has a connected DevTools instance open in their IDE.
This is because it triggers the
OpenDevToolsAction
registered in plugin.xml, which uses the default constructor for the action (which does not have a param for the connector). Therefore, when the action is triggered, we check if the connector isnull
, and if so we first check if there is a running app, and therefore connector, that we can use.I'm not sure how to determine the correct Flutter app if there are more than one running. Any suggestions here would be appreciated.
Note: This is part of the work to add better Network panel support to DevTools. We would like to either fix the issues of copy-paste not working when DevTools is embedded in IntelliJ, or as a not-ideal but last case scenario show a banner in DevTools that tells them copy-paste does not work in IntelliJ, and that they should open DevTools in their browser instead (that is what this change is addressing).
FYI @srawlins