Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

add option to hide namespaces #90

Closed
wants to merge 1 commit into from

Conversation

despairblue
Copy link

@despairblue despairblue commented Oct 1, 2017

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 before this.panel.show is called.

Alternate Designs

  1. If there is a way to quickly find out from which package a command is coming from that would probably be a preferable solution.
  2. When registering a command a flag could be given that would hide that command from the palette.
  3. Only render the first 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 of package, to make a distinction there, so no one assumes this work on a package level.

Applicable Issues

#35, #80, #81

@despairblue despairblue force-pushed the feature/hide-namespaces branch 2 times, most recently from e64cde2 to 4797d04 Compare October 1, 2017 20:41
@despairblue
Copy link
Author

I amended the commit, I messed a bit up while selectively committing lines. Now it should be fine.

@rsese
Copy link

rsese commented Nov 1, 2017

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 #92. Thanks very much for this and your many other contributions in issues and PRs 🙇

@rsese rsese closed this Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants