Skip to content

Give Users the Option to order their Editor Commands or create a "Favorite" option to force to top. #246

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

Open
gerane opened this issue May 27, 2016 · 10 comments

Comments

@gerane
Copy link
Contributor

gerane commented May 27, 2016

Currently, Editor Commands are ordered in the list in the order they were loaded. This is fine right now since you can just order them in your profile in the order you want them. However, when more people start adopting Editor Commands and integrating them into their functions and modules, I can see this becoming much more problematic. I am still thinking about how you might integrate this, but I wanted to start a discussion about it.

The other Idea I had was to give the user the ability to mark "Favorite" commands that would place those commands at the top of the list. You could either do this in some form of config file, some form of command you throw in your Profile, or maybe even a switch added to Register-EditorCommand. I feel like the later might be abused by Module authors though, unless you did something where it only works if executed from the users profile or something like that.

@daviwil
Copy link
Contributor

daviwil commented May 27, 2016

I think I'd ultimately prefer to just have the commands sorted alphabetically just like the main command list just so that we don't need the added complexity of allowing user-configured favorites.

The better option would be getting the PowerShell-based editor commands inserted into the main command list so that they're accessible from keybindings, etc. If there's a command that you use so often that you want it at the top of the editor commands list then you probably want a hotkey bound to it instead.

@daviwil daviwil added the Issue-Discussion Let's talk about it. label May 27, 2016
@gerane
Copy link
Contributor Author

gerane commented May 27, 2016

So far Alt + p has been working out awesome for me. The only issue, is an already open bug, which is having it work in any context.

@gerane
Copy link
Contributor Author

gerane commented May 27, 2016

I think what I am beginning to notice, is we might start to see a ton of Commands. I like have the options of being able to see the list of commands, so as long as they can be seen from the main list still I like the idea.

What I have started to notice though, is I am already starting to change how I write commands. I am needing to condense them into a selection instead of say 3 individual commands. We may not have that option if its a Module Author writing the commands. Meaning, if these become popular, you may have to really sort to find your command that you use most.

@gerane
Copy link
Contributor Author

gerane commented Jun 2, 2016

I have been thinking of a few ideas.

  • One is that you could sort commands first by the commands name that is supplied via Register-EditorCommand -name. This would place all Commands for specific module together and also sort them alphabetically.
  • Another would be to give submenus per module, but this adds time. One thing I have thought about doing is doing this myself in my own Editor Commands. Have one master command that prompts the user to select embedded commands. So you just use parameter sets or switches to run the command you want and have them all embedded under a single Editor Command for that module.
  • Right now Code just displays -DisplayName, and this becomes a little undesirable when you have a large number of commands. When using promptforselection, you can specify a note after the selections name. maybe having the modules name or portion left of period in "ModuleName.EditorCommandName" in -Name as the Note.

Some of these can be fixed in my own commands by just prefixing the names, but then it might get out of hand when others start adding commands.

@daviwil
Copy link
Contributor

daviwil commented Jun 3, 2016

Sorting by Name definitely makes sense because it'd group all of a module's commands together. It'd also be nice to show which module a command comes from so that the user has that information in case they want to remove the module or add it to a blacklist.

Maybe it's better to file a separate item for that feedback so that it's tracked?

@gerane
Copy link
Contributor Author

gerane commented Jun 3, 2016

I will do that later tonight.

@TylerLeonhardt
Copy link
Member

I'm not sure we need this as much now that we have the Integrated Console. Thoughts?

@rkeithhill
Copy link
Contributor

I think we need to keep this around. This is more of a VSCode extension GUI issue i.e. how we display the list of editor commands when someone executes: PowerShell: Show Additional Commands from PowerShell Modules.

@TylerLeonhardt
Copy link
Member

Right but how many additional commands do people typically have? If it's like 2-3, we probably don't need this feature. But if people typically have a decent amount, it sounds like a valid ask.

I think maybe I don't quite understand what this feature is suppose to do/be used for. Are the commands usually editor specific?

@SeeminglyScience
Copy link
Collaborator

@tylerl0706 it's for extending PSES from PowerShell. Here's some examples https://github.com/SeeminglyScience/EditorServicesCommandSuite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants