p42ai / js-assistant

120+ refactorings and code-assists for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=p42ai.refactor
MIT License
119 stars 7 forks source link

Command Palette integration #64

Open coffenbacher opened 1 year ago

coffenbacher commented 1 year ago

I've never used the Refactor menu in VSCode, so I was surprised to find out it doesn't seem to be integrated with the Command Palette (I can't find Refactor commands through it, like Surround With etc.).

The Command Palette is my preferred method of interaction with this type of command so I don't have to remember custom keyboard shortcuts (or god forbid, use a mouse 😄 ).

Is there a way to add some/all of these commands to the Command Palette? Or is there a design reason those aren't tied together?

Thanks! Love the power of the extension, just trying to figure out how to fit it in my workflow.

lgrammel commented 1 year ago

Thanks for the suggestion!

Code actions (as shown in the code action menu) are context specific and are not available most of the time. Adding them to the command palette would add a lot of commands which won't be working most of the time.

I'm keeping this issue open, in case I find a way to filter/hide them when they are not available for the given cursor location.

coffenbacher commented 1 year ago

Adding them to the command palette would add a lot of commands which won't be working most of the time.

Good point, I'm surprised that there's not a way to make them context-dependent, doesn't look like there is...

I wonder how big of an issue it is to have not-working commands available, however? I guess there are three reasons I can think of to avoid them, and then my thoughts on those...