Addressing Command Deprecations


#1

I have a few deprecation warnings that go something like:

ContextMenuManage::add has changed to take a single object as its argument. Please consult the documentation.
at ContextMenuManager.add (/Applications/Atom.app/Contents/Resources/app/src/context-menu-manager.js:51:14)
at Package.activateResources (/Applications/Atom.app/Contents/Resources/app/src/package.js:283:57)
at /Applications/Atom.app/Contents/Resources/app/src/package.js:207:19
at Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:157:15)
at Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:205:14)
at PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:404:21)
at gobuild-spec.coffee:63:32

The cause of this is:

atom.workspaceView.command 'golang:goinfo', => @displayGoInfo(true)

It’s not immediately clear to me how I should change the way I am binding a function to the command. Does anyone have insight into this?


#2

I’m at work in between meetings or I would dig up the reference … but look for the new Command Manager at atom.commands. There should be examples in master that you can follow.


#3

I’m not sure this is something you have to fix on your end, the stack indicates that the deprecation comes from an Atom core class and should be addressed by the core team sooner or later (you can still make a PR if you think it’s important).


#4

@abe Thanks - somehow I missed that and assumed it was something I was doing when wiring up my commands to functions during activation.