Open plafosse opened 2 years ago
Rename could be implemented the same way "e" is for inline assembly editing. Let the user edit the token in-place. Change type might not work with that though.
Note that N allows renaming to e.g. this
without using backticks, while Y requires backticks, currently making N more convenient in some cases.
y
would bring up that window, but with the function prototype being editable and your cursor in the box so that y -> <editing> -> Enter
is still preserved as a workflow.)Also, I'm not sure combining n
and y
is a good idea. You can rename things that aren't functions (e.g. variables), some of which don't have a type (e.g. labels). If we have a way around that and still want to do a unified interface, I would still argue for the n
hotkey to remain and automatically allow the name to be quickly edited to preserve the very fast n -> <edit name> -> Enter
workflow, which is used a lot.
I think I would personally prefer option 1 from above for rename (e.g. eliminating the extra window altogether in favor of a non-modal edit box) and then implementing #3115. This is an example from VSCode of the former:
Some furious internal discussion prompted this picture which most people seemed to like better than my text description above 😅
So these are some of the things I’ve seen people do in the user studies:
The goal in a non-modal unification is to:
Also potential solutions. Add a new "SHIFT + Y" command to "Change Type Only". Which would allow but then ignore the variable name if typed.
Some furious internal discussion prompted this picture which most people seemed to like better than my text description above 😅
Couple of questions:
Some furious internal discussion prompted this picture which most people seemed to like better than my text description above 😅
I couldn't help but comment that this looks great!
Modal dialogs for change type and change name are not a great solution because once the dialog is up the user looses context of what they triggered the dialog on. Additionally users frequently hit "N" to rename instead of "Y" which allows them to set the type AND name.
Suggestion on how to fix: