Skip to content

Commit a42fc90

Browse files
committed
Make sure we properly restore uris for local resource roots
For microsoft#98746
1 parent 5b3e8dc commit a42fc90

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export class WebviewEditorInputFactory implements IEditorInputFactory {
7878
extension: reviveWebviewExtensionDescription(data.extensionId, data.extensionLocation),
7979
iconPath: reviveIconPath(data.iconPath),
8080
state: reviveState(data.state),
81+
options: reviveOptions(data.options)
8182
};
8283
}
8384

@@ -143,3 +144,10 @@ function reviveUri(data: string | UriComponents | undefined): URI | undefined {
143144
function reviveState(state: unknown | undefined): undefined | string {
144145
return typeof state === 'string' ? state : undefined;
145146
}
147+
148+
function reviveOptions(options: WebviewInputOptions): WebviewInputOptions {
149+
return {
150+
...options,
151+
localResourceRoots: options.localResourceRoots?.map(components => URI.from(components)),
152+
};
153+
}

0 commit comments

Comments
 (0)