diff --git a/monaco-editor-iframe.js b/monaco-editor-iframe.js index a4d46cc..56d88c1 100644 --- a/monaco-editor-iframe.js +++ b/monaco-editor-iframe.js @@ -42,6 +42,16 @@ event: 'registerSignatureHelpProvider', args: [languageId, provider] }); + }, + registerHoverProvider: (languageId, provider) => { + if (provider.provideHover) { + provider.provideHover = provider.provideHover.toString(); + } + this.postMessage({ + path: ['monaco', 'languages'], + event: 'registerHoverProvider', + args: [languageId, provider] + }); } }; } @@ -331,6 +341,11 @@ args[1].provideSignatureHelp = eval(args[1].provideSignatureHelp); } } + if (event === 'registerHoverProvider') { + if (args[1].provideHover) { + args[1].provideHover = eval(args[1].provideHover); + } + } try { let cmd = proxy; path.forEach(k => { cmd = cmd[k]; });