Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Bierner <matb@microsoft.com>2020-05-28 20:25:01 +0300
committerMatt Bierner <matb@microsoft.com>2020-05-28 20:25:07 +0300
commita42fc9031da1c3ffa8a3ed06b45b8ddbe2deb74d (patch)
tree53009903e3bbddeb1d8314b9174f7cb0a0eb8751
parent5b3e8dc54366998a538510a7c35acd9e792e3a6e (diff)
Make sure we properly restore uris for local resource roots
For #98746
-rw-r--r--src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts
index e78b7edb957..f9b7763a8fd 100644
--- a/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts
+++ b/src/vs/workbench/contrib/webview/browser/webviewEditorInputFactory.ts
@@ -78,6 +78,7 @@ export class WebviewEditorInputFactory implements IEditorInputFactory {
extension: reviveWebviewExtensionDescription(data.extensionId, data.extensionLocation),
iconPath: reviveIconPath(data.iconPath),
state: reviveState(data.state),
+ options: reviveOptions(data.options)
};
}
@@ -143,3 +144,10 @@ function reviveUri(data: string | UriComponents | undefined): URI | undefined {
function reviveState(state: unknown | undefined): undefined | string {
return typeof state === 'string' ? state : undefined;
}
+
+function reviveOptions(options: WebviewInputOptions): WebviewInputOptions {
+ return {
+ ...options,
+ localResourceRoots: options.localResourceRoots?.map(components => URI.from(components)),
+ };
+}