I'd like to add a hyperlink in a editor, like vscode does:
I'd like to add this formatted document and when you click into it, some operation happens, open a file dialog, for example.
I have no code to show yet because I didn't find anything like that yet, only for regular text that goes like this:
const line = editor.getPosition();
if(!line) {
throw new Error('line is null');
}
const range = new monaco.Range(line.lineNumber, 1,
line.lineNumber, 1);
const text = "empty tab";
const op: monaco.editor.IIdentifiedSingleEditOperation = {
range: range,
text: text,
forceMoveMarkers: true
};
editor.executeEdits('my-source', [op]);
but I didn't see how add a format it.

You can use an overlay element and define the placeholder content in HTML, with links that will perform actions (e.g. change the editor theme, change the language etc).
The HTML for the placeholder would look something like this:
Along with the following CSS:
You can then wire this up in JavaScript as follows:
Functions to hide and show the placeholder:
Create the editor and show the placeholder:
Add event handlers for any links in the placeholder that you want to perform actions when clicked:
Event handler to clear the placeholder and focus into the editor when the user clicks on any part of the placeholder apart from the links:
If you copy the HTML, CSS and JavaScript below into the Monaco Playground, you will see this working:
HTML
CSS
JavaScript