I'm using Monaco Editor to make my own IDE. I use provideHover over certain kinds of code.
I realize that the hover window shows several texts. One kind of texts come from contents; another kind of texts consist of marker.message and marker.code (https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.imarker.html).
Does anyone know if it is possible to not show these the texts consisting of marker.message and marker.code?
PS: code of provideHover:
public async provideHover(model: monaco.editor.ITextModel, position: monaco.Position, token: CancellationToken): Promise<monaco.languages.Hover | undefined> {
let marker = monaco.editor.getModelMarkers({}).find(marker => { // https://microsoft.github.io/monaco-editor/api/modules/monaco.editor.html#getmodelmarkers
let markerStart = new monaco.Position(marker.startLineNumber, marker.startColumn);
let markerEnd = new monaco.Position(marker.endLineNumber, marker.endColumn);
if (markerStart.isBeforeOrEqual(position) && position.isBeforeOrEqual(markerEnd)) return marker;
return null;
});
if (marker != null) {
if (marker.code == "113") {
return {
contents: [{
value: "contents[0].value ",
isTrusted: false
}
, {
value: "contents[1].value",
isTrusted: false
}
]
};
}
}
return undefined
}
