Fellow coders,
I'm having a hard time to find a hook into the 'ctrl+click' (follow link) editor option.
On the demo page the link is opened in a new tab: https://microsoft.github.io/monaco-editor/index.html
After a thorough google search which came up with nothing I searched through the api but only found the context actions which do not include the follow link or ctrl+click action.
I would like to parse the filepath and fire some custom methods of my own instead of opening in a new tab.
Any of you guys found a clue where to add/modify the behavoir?
Thank you in advance.
You can override the IOpenerService's Open method, something like this:
var openerService = {
open: function (resource, options) {
// do something here, resource will contain the Uri
}
};
var editor = monaco.editor.create(document.getElementById('container'),
{
automaticLayout: true, language: 'plaintext'
},
{
openerService: openerService
}
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With