Capture / Intercept file open

In my extension I am loading a specific file path that the extension needs to receive the path name of. What I would like to do is bind an event in my extension to file open, check the path of the file that is opened, if it matches a string, stop the editor from opening.

This might fall in the same area of binding to save ( which I am also hoping to do.

[original thread by Eiso Kant]

By an editor do you mean your widget or Monaco editor?

I’m not totally sure, but you can implement NavigatableWidgetOpenHandler with canHandler returning a number greate than a number returned by EditorManager. In this case your handler will be used as a primar.


[Eiso Kant]

This looks exactly what I need. I want to stop Monaco editor from opening and have my widget handle it instead. Thank you.