Skip to content
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

[BUG] The package 'whatever' is not installed #25

Closed
blastik opened this issue Jun 11, 2018 · 2 comments
Closed

[BUG] The package 'whatever' is not installed #25

blastik opened this issue Jun 11, 2018 · 2 comments

Comments

@blastik
Copy link

blastik commented Jun 11, 2018

For example:
image

Obviously it is installed because it comes with Atom by default. It also happens with others like Hydrogen that are installed (i promise):
image

Here is my config:

const { dispatchAction } = require('./dispatchAction');

exports.configuration = [{
  type: 'button',
  label: '🌳',
  clickDispatchAction: 'tree-view:toggle',
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '//',
  clickDispatchAction: 'editor:toggle-line-comments',
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '👨‍🎤',
  clickDispatchAction: 'atom-beautify:beautify-editor',
  backgroundColor: '#000000'
}, {
  type: 'group',
  items: [{
    type: 'popover',
    label: 'Find',
    items: [{
      type: 'button',
      label: '🎯',
      clickDispatchAction: 'tree-view:reveal-active-file',
      backgroundColor: '#000000'
      }, {
      type: 'button',
      label: '🔍',
      clickDispatchAction: 'project-find:show',
      backgroundColor: '#000000'
    }]
  }]
}, {
  type: 'button',
  label: '▶️',
  clickDispatchAction: 'hydrogen:run',
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '🐙',
  clickDispatchAction: 'github:toggle-git-tab-focus',
  backgroundColor: '#000000'
}, {
 type: 'button',
 label: '⌨️',
 clickDispatchAction: 'command-palette:toggle',
 backgroundColor: '#000000'
}]

Thoughts?

Thanks!
D.

@inakineitor
Copy link
Owner

inakineitor commented Jun 11, 2018

This problem has ocurred before. THe package, to avoid error ocurring, first check through Atom's built-in functions, if a package is installed. Atom does not provide a check for their own packages, and when those packages are checked with the regular functions, they return that the package is not installed. Because of this, I created a function that allows you to override these checks and forcefully issue commands. You can see how its used in this issue: Link
If you need more help, don't hesitate to reopen this issue.
P.D.: You could also try changing the target to editor or workspace

@blastik
Copy link
Author

blastik commented Jun 11, 2018

correct. see differences below.

const { dispatchAction } = require('./dispatchAction');

exports.configuration = [{
  type: 'button',
  label: '🌳',
  clickDispatchAction: 'tree-view:toggle',
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '//',
  clickDispatchAction: 'editor:toggle-line-comments',
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '👨‍🎤',
  clickDispatchAction: 'atom-beautify:beautify-editor',
  backgroundColor: '#000000'
}, {
  type: 'group',
  items: [{
    type: 'popover',
    label: 'Find',
    items: [{
      type: 'button',
      label: '🎯',
      clickDispatchAction: 'tree-view:reveal-active-file',
      backgroundColor: '#000000'
      }, {
      type: 'button',
      label: '🔍',
      click: () => {
      dispatchAction('project-find:show', 'workspace', true);
      },
      backgroundColor: '#000000'
    }]
  }]
}, {
  type: 'button',
  label: '▶️',
  click: () => {
  dispatchAction('hydrogen:run', 'editor', true);
  },
  backgroundColor: '#000000'
}, {
  type: 'button',
  label: '🐙',
  clickDispatchAction: 'github:toggle-git-tab-focus',
  backgroundColor: '#000000'
}, {
 type: 'button',
 label: '⌨️',
 clickDispatchAction: 'command-palette:toggle',
 backgroundColor: '#000000'
}]

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

No branches or pull requests

2 participants