How to have editor plugin add menu item?

sdk

#1

Hi,

So working on this editor plugin whose purpose is to show hex representation for the contents of a file (a la xxd).

Ideally any file can be opened on that editor (but it shouldn’t be the default for any extensions), so perhaps gonna need the plugin to add some sort of an “Open” menu item to tree’s context menu, even if no editor instances exist yet.

Not sure exactly what’s the best way to achieve that, since the example per the tutorial doesn’t demo such scenario?

Thoughts? Thanks in advance!


#2

editor automatically adds a menu item in view>editors.
to add a menuitem to the tree context menu use something like https://github.com/c9/core/blob/f46f266c0a33e519abcb6de4ece013ce1416fc6b/plugins/c9.ide.terminal/opentermhere.js#L34-L40