This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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