How to have editor plugin add menu item?




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!


editor automatically adds a menu item in view>editors.
to add a menuitem to the tree context menu use something like