dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19k stars 4.03k forks source link

Add mnemonics or indexes to quickactions #30502

Open MarkusAmshove opened 6 years ago

MarkusAmshove commented 6 years ago

Hello,

I've seen this screenshot in #30475 and was wondering if it wouldn't be nice if the actions in the popup box had either mnemonics or indexes (numeric positions) to access the desired option faster, that way reordering wouldn't be that much needed.

I can imagine that using mnemonics would have some problems:

If I always press 'e' to extract method, but in some context where another action with 'e' has a higher priority, I could do the wrong action based on muscle memory.

With an index, I could (in the screenshot above) press ctrl+. and then 5 to extract a method. This wouldn't build up a lot of muscle memory, because action ordering could change based on the context, but I think at that point I would be better of learing the shortcut.

To actually help me learn the shortcut, it could be displayed in the popup, just like it does in quick actions (CTRL+Q) (I don't know if this is the correct naming in the English version of VS)

CyrusNajmabadi commented 6 years ago

that way reordering wouldn't be that much needed.

Note: reordering is valuable not just for the effort to select an item. But the effort to find and recognize the item you want :) So having more useful things be higher means a person needs to scan through less to find it.

@AmadeusW Do the lightbulb menus support shortcut keys?

--

One complexity here is simply that these are dynamic lists with both tons of first and third party actions added to it. I'm not sure how viable shortcuts will be as we will quickly exhaust the set of non-overlapping shortcuts. Numbers are interest. However, as mentioned, they're less helpful for memory since the lists do reorder a lot based on many different criteria.

MarkusAmshove commented 6 years ago

I had the same thoughts, mnemonics could actually make it harder.

With numbers I still have to scan the options, but once found I can quickly access them and save key strokes (up/down arrow).

I use such approaches heavily with e.g. AceJump and Firefox addons like vimperator/tredactyl because I want to do as much as possible with the keyboard