I’m trying to use addOpener to just open a particular filetype with a view I’ve written, and it doesn’t appear to be registering, either when I open a file manually with ctrl-o, or when I call atom.workspace.open(filepath).
Here is the code:
atom.workspace.addOpener (uri) -> console.log "hey" atom.workspace.activePane.activateItem new MyView uri
As you’ll note, the opener is registered for every possible filetype. However, when atom.workspace.open is called, the view is not displaying, and the console.log is not showing up at all. I’ve tried limiting it by filetype, and when that didn’t work, I registered it for every possible uri. The console merely shows the result of an atom.workspace.open. Why isn’t the opener registering?
Also, is opening with ctrl-o the same as an atom.workspace.open, or do the two call different functions?