You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
monaco-editor version: 0.17.0 Browser: IE, Chrome, Firefox OS: Windows 10
The TypeScript declaration preview does not work for declarations added through monaco.languages.typescript.javascriptDefaults.addExtraLib() and causes an error.
Trigger the declaration preview on Facts (hover while pressing Ctrl)
This results in the following error:
Error: [UriError]: Scheme is missing: {scheme: "", authority: "", path: "filename/facts.d.ts", query: "", fragment: ""}
at editor.main.js:209
at t.e (editor.main.js:210)
at new t (editor.main.js:211)
at Function.e.parse (editor.main.js:211)
at tsMode.js:7
at async Promise.all (index 0)
at editor.main.js:38
The text was updated successfully, but these errors were encountered:
Not sure if this is intentional or not, but this can be fixed by adding a scheme (eg. inmemory) to the file path given to addExtraLib. In the example above from the playground on lines 19-26, it should read:
monaco.languages.typescript.javascriptDefaults.addExtraLib(['declare class Facts {',' /**',' * Returns the next fact',' */',' static next():string','}',].join('\n'),'inmemory:filename/facts.d.ts');
(inmemory:filename/facts.d.ts instead of filename/facts.d.ts)
Thank you for your hint, this solved the issue for me. I would still be interested if this is intentional or not, since the scheme was even missing in the playground example.
monaco-editor version: 0.17.0
Browser: IE, Chrome, Firefox
OS: Windows 10
The TypeScript declaration preview does not work for declarations added through
monaco.languages.typescript.javascriptDefaults.addExtraLib()
and causes an error.Steps or JS usage snippet reproducing the issue:
Facts
(hover while pressingCtrl
)This results in the following error:
The text was updated successfully, but these errors were encountered: