Add more strict typing for webview options

We can only send URI components over from the extension host to the renderer process. Make sure the typings reflect that

Follow up on #98746
This commit is contained in:
Matt Bierner
2020-05-30 00:52:47 -07:00
parent b2cb8682f9
commit 50f907f0ba
3 changed files with 16 additions and 4 deletions

View File

@@ -127,7 +127,10 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
$setOptions(handle: number, options: modes.IWebviewOptions): void {
const inset = this.getInset(handle);
inset.webview.contentOptions = options;
inset.webview.contentOptions = {
...options,
localResourceRoots: options.localResourceRoots?.map(components => URI.from(components)),
};
}
async $postMessage(handle: number, value: any): Promise<boolean> {