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

Add a version of the Flutter: Inspect Widget command that auto-cancels on selection #4093

Closed
maks opened this issue Aug 8, 2022 · 5 comments
Labels
in flutter Relates to running Flutter apps is enhancement
Milestone

Comments

@maks
Copy link

maks commented Aug 8, 2022

I often want to click on a UI element and see the line of widget code where its defined.

Currently this is eminently doable but involves the following steps:

  • click "open devtools" button in debug bar
  • in Devtools click on "select widget mode" button
  • click on the widget I'm interested in the Flutter running app
  • switch back to VSCode window (I run Devtools not in embedded mode)
  • Remember to go back to Devtools to un-toggle "select widget mode" button
  • close devtools tab in web browser

It would be really nice if there was a single VSCode command palette command that I could use to do all of the above in one go, ie. select the cmd in the cmd palette, click on the widget I'm interested in the running app and then VSCode jumps to the relevant code line and exists out of "select widget mode".

@DanTup
Copy link
Member

DanTup commented Aug 8, 2022

There are already commands for toggling this without needing DevTools:

Screenshot 2022-08-08 at 15 13 07

Screenshot 2022-08-08 at 15 27 11

I think that reduces this to two steps (plus clicking a widget). Adding an additional command that auto-cancels on the first selection doesn't seem like a bad idea though.

@DanTup DanTup changed the title feature request: command to do usual show Widget in code procedure Add a version of the Flutter: Inspect Widget command that auto-cancels on selection Aug 8, 2022
@DanTup DanTup added this to the v3.48.0 milestone Aug 8, 2022
@DanTup DanTup added is enhancement in flutter Relates to running Flutter apps labels Aug 8, 2022
@maks
Copy link
Author

maks commented Aug 8, 2022

Ok wow, @DanTup, I think I need to spend more time looking through all the commands provided by DartCode! as I completely missed this one! But yes having a setting that cancels on first selection would be perfect 🙏🏻 Thanks for updating the title, that pretty much is exactly what I'm after 👍🏻

@DanTup DanTup modified the milestones: v3.48.0, v3.50.0 Aug 25, 2022
@DanTup DanTup modified the milestones: v3.50.0, v3.52.0 Oct 3, 2022
@DanTup
Copy link
Member

DanTup commented Oct 3, 2022

I discovered the new DAPs don't support Inspect Widget correctly (that is, they don't navigate in the editor) so it makes sense to fix that (#4193) before tackling this, since it's possible the mechanism used for navigating will change a bit.

@DanTup DanTup closed this as completed in 5cab904 Oct 31, 2022
@DanTup
Copy link
Member

DanTup commented Oct 31, 2022

There's a new command "Flutter: Inspect Widget (Auto-Cancel after Selection)" that will cancel the widget selection mode 1s after you click a widget (the delay is because it will also remove the visible selection of the widget on the app, and it looks buggy to have it disappear immediately when you tap).

@maks
Copy link
Author

maks commented Nov 1, 2022

Awesome! Thanks again @DanTup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in flutter Relates to running Flutter apps is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants