Package command won't fire [solved]


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: ->

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

What have I missed that keeps the command from working?


Do you have activationCommands defined for the package?


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


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


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