Skip to content
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

Include device names in generated launch configs for Select & Start Debugging #3937

Closed
guidezpl opened this issue Apr 21, 2022 · 6 comments
Closed
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement
Milestone

Comments

@guidezpl
Copy link
Contributor

guidezpl commented Apr 21, 2022

Is your feature request related to a problem? Please describe.
Currently, when running multiple instances (e.g. on multiple devices), they are simply numbered, making it hard to identify which one is which.

Describe the solution you'd like
Specify the device name in parens such that it shows up in the running instance selector.

Screen Shot 2022-04-21 at 13 14 34

@DanTup
Copy link
Member

DanTup commented Apr 21, 2022

How are you starting the debug sessions? Do you have a launch.json?

Without a launch.json, starting with F5 or the Run menu, the device ID should already be added:

Screenshot 2022-04-21 at 14 41 07

If you have a launch.json or launch through another means, things may be a little different. I'm not sure it would make sense to overwrite the name supplied in a launch.json. We could perhaps support some variable $deviceName or something, although it would show literally as the variable in many places in VS Code's UI (like the sidebar) where it's not been replaced as part of launching a debug session 🤔

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Apr 21, 2022
@DanTup DanTup added this to the v3.40.0 milestone Apr 21, 2022
@DanTup DanTup added in flutter Relates to running Flutter apps in debugger Relates to the debug adapter or process of launching a debug session labels Apr 21, 2022
@guidezpl
Copy link
Contributor Author

Oh, neat I didn't know it was already working in some cases.

I don't have a launch.json, I'm selecting "Select and start debug configuration" in the bottom bar and then selecting Flutter
Screen Shot 2022-04-21 at 16 34 50

@DanTup DanTup removed the awaiting info Requires more information from the customer to progress label Apr 21, 2022
@DanTup DanTup changed the title Specify device name when running multiple instances Include device names in generated launch configs for Select & Start Debugging Apr 21, 2022
@DanTup
Copy link
Member

DanTup commented Apr 21, 2022

I can't make the name dynamic there (if I do, when you change device and then try to run from that "recently used" list, it will error, because it uses the name to look it up in the list again), but I was able to add a new entry for each supported device to the top of the list:

Screenshot 2022-04-21 at 16 27 41

Since these don't change when you change your selected device, these will still work from the recently used list (which is the top entry in your screenshot, where you haven't gone into the "Dart & Flutter" section):

Screenshot 2022-04-21 at 16 27 50

@DanTup DanTup closed this as completed in 0710d18 Apr 21, 2022
@guidezpl
Copy link
Contributor Author

Sweet, thanks!

@DanTup
Copy link
Member

DanTup commented Apr 28, 2022

Just an FYI, I noticed some weirdness where pressing F5 in a project without a launch.json would sometimes run on the wrong device. It's either related to VS Code being clever and picking the most recent thing I picked from Select&Start Debugging, or the top one from the list (but it seemed quite inconsistent). In case it's the latter, I'm changing these device-specific ones to appear in the list after the original one (which runs on the "current" device).

@guidezpl
Copy link
Contributor Author

Ack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants