dart-pad icon indicating copy to clipboard operation
dart-pad copied to clipboard

Code assistance context menu is missing

Open math1man opened this issue 1 year ago • 6 comments

What happened?

DartPad appears to have been updated in a major way. I noticed that following the update, the code assistance context menu for Flutter (with commands like "Wrap in SizedBox", "Remove widget", "Swap with parent", etc) is no longer accessible.

Steps to reproduce problem

Open DartPad, switch to a Flutter sample, position the cursor on a widget constructor and press Opt-Enter (for Mac, may vary by OS).

Browser

Browser: Chrome

Version: 121.0.6167.160

Are you using any extensions/plugins that affect website behavior (particularly those that affect iframes, such as ad blockers)? No

Are there any warnings or errors in your browser's JavaScript console? No

Machine

Operating system: MacOS

Version: Sonoma 14.3.1

math1man avatar Feb 21 '24 16:02 math1man

Whoa, I didn't even know this feature existed. If we bring it back (and it sounds like a cool thing to have!), I suggest we do something to make it more discoverable. For example, maybe a button in the toolbar or something like that.

mit-mit avatar Feb 21 '24 20:02 mit-mit

It works similarly in VS Code and AndroidStudio when using the Flutter plugins.

math1man avatar Feb 21 '24 20:02 math1man

I think the issue is that keybinding changed - it's now command-. (visible from the keybindings shortcut action in the bottom left).

Screenshot 2024-02-21 at 12 15 51 PM

It may be that we should alias the keyboard shortcut?

devoncarew avatar Feb 21 '24 20:02 devoncarew

Oh interesting. I guess this changed from the default AndroidStudio key binding to the default VS Code keybinding. It would be much appreciated if you could support both!

math1man avatar Feb 21 '24 20:02 math1man

It works similarly in VS Code and AndroidStudio when using the Flutter plugins.

Right, but one big difference is that they show a small UI element (in code it's a lightbulb) to let the user know that this menu exists. I've love to see something similar in DartPad.

mit-mit avatar Feb 21 '24 20:02 mit-mit

That's true.

math1man avatar Feb 21 '24 20:02 math1man