Skip to content

Conversation

elliette
Copy link
Member

@elliette elliette commented Oct 17, 2025

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 is null, 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

@elliette elliette requested review from helin24, jwren and pq October 17, 2025 21:53
@helin24
Copy link
Member

helin24 commented Oct 18, 2025

Choosing the first one for now seems fine!

I believe we have an open issue of auditing all of the DevTools windows and deciding which VM instance to show. I think @AlexV525 added some functionality to the inspector to show a different browser tab for each VM instance if multiple are running. Would it potentially make sense for DevTools / or a meta-DevTools to manage multiple VM instances at once?

Another option - are we thinking users would choose to open DevTools in browser if something doesn't work? Perhaps we could save the DevTools URLs that are currently trying to be opened in embedded windows and show those as options of URLs to open in the normal browser.

if (myConnector == null) {
final List<FlutterApp> apps = FlutterApp.allFromProjectProcess(project);
if (!apps.isEmpty()) {
myConnector = apps.get(0).getConnector();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to find the currently activated app instead of always using the first?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't figure out a way to do that unfortunately 😮‍💨 I added a TODO though to capture that.

@elliette elliette force-pushed the copy-paste-devtools branch from 9d088ad to f8d1de8 Compare October 20, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants