Package command won't fire [solved]


#1

I have a simple start to a package with one command to log an entry to the console, but I can’t seem to get that one command to fire. I see it in the Package and context menus and can select it. But nothing shows up in the console.

The code is:

{CompositeDisposable} = require 'atom'

module.exports = MarkdownUtilities =
  subscriptions: null

  activate: (state) ->
    @subscriptions = new CompositeDisposable

    @subscriptions.add atom.commands.add 'atom-workspace', 'markdown-utilities:link': => @link()

  deactivate: ->
    @subscriptions.dispose()

  link: ->
    console.log 'Markdown Utilities Link command fired'

What have I missed that keeps the command from working?


#2

Do you have activationCommands defined for the package?


#3

Hmm. I do, and it’s pointing to the wrong command function (toggle instead of link). Let me see if that’s the problem…


#4

And that was it! In package.json I suppose I must declare all the commands that the package will respond to?


#5

If you declare any activationCommands, then you have to declare all commands that you want to activate the package, yes.