flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

Add a way for developers of DevTools to use Flutter plugin with locally served DevTools #7676

Closed helin24 closed 1 month ago

helin24 commented 1 month ago

This offers a way to use a development version of DevTools (whatever devtools_tool serve runs) while using a standard Flutter plugin. This should be helpful when testing DevTools-IJ interactions.

Typically, the Dart plugin starts DTD and then also starts DevTools, passing in the DTD URL. The Flutter plugin will then use this instance of DevTools to access embedded tool windows. When using this locally served DevTools, the Dart plugin behaves the same way, but the Flutter plugin starts its own instance of local DevTools using the same DTD URL. (Note that there could be some side effects from having two DevTools instances started, connected to the same DTD instance.)

Instructions for using this:

  1. Set the registry key to your DevTools directory: Go to Help > Find action > Registry > Find "flutter.local.devtools.dir" and set to your DevTools directory. (e.g. Users/helinx/Documents/devtools). If you want to add additional args, put these in the option "flutter.local.devtools.args".
  2. Restart IntelliJ
  3. You should be able to open Help > Show log in finder > Open idea.log; in here with the registry key set as above, then you should see output like "DevTools startup: <various messages that come from running devtools_tool serve>"
  4. To turn off using local DevTools, go back to the registry key and clear out the setting.

CC @kenzieschmoll @elliette