Closed despairblue closed 6 years ago
I amended the commit, I messed a bit up while selectively committing lines. Now it should be fine.
Hey @despairblue - I asked the team to take a look at this and related issues/PRs and while the general idea is good, the decision was to pursue the approach in https://github.com/atom/command-palette/pull/92. Thanks very much for this and your many other contributions in issues and PRs :bow:
Description of the Change
This adds a new configuration that takes a comma separated list of namespaces that should be hidden from the palette. A namespace is what comes before the first colon in a command name. If set
this.commandsForActiveElement
is filtered from commands that match any of those namespaces beforethis.panel.show
is called.Alternate Designs
x
results.I assume that 1. and 2. need changes to atom's core and how commands are handled. Also I'm not sure about 2. since that takes away control from the user. 3. is tackling this from a different angle but defaulting to a small
x
may confuse users that do try to go through the list.Benefits
This helps to reduce the amount of entries rendered to the palette. Some packages register a lot of commands that are only supposed to be used via shortcuts (like character-table or vim-mode-plus).
In my case I can cut the rendered elements almost in half by hiding everything from
vim-mode-plus
: 424 (vmp) / 1050 (total).Possible Drawbacks
Prefixing commands with the package name seems more of a convention. So this only works if the package one's trying to hide the commands from adheres to this convention. That's also why I chose to use the word
namespace
instead ofpackage
, to make a distinction there, so no one assumes this work on a package level.Applicable Issues
35, #80, #81