mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix bug where webview options weren't revived, causing URI lookup to fail (#2453)
This commit is contained in:
@@ -26,6 +26,13 @@ import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } fro
|
|||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||||
|
|
||||||
|
function reviveWebviewOptions(options: vscode.WebviewOptions): vscode.WebviewOptions {
|
||||||
|
return {
|
||||||
|
...options,
|
||||||
|
localResourceRoots: Array.isArray(options.localResourceRoots) ? options.localResourceRoots.map(URI.revive) : undefined
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: '',
|
template: '',
|
||||||
selector: 'modelview-webview-component'
|
selector: 'modelview-webview-component'
|
||||||
@@ -192,6 +199,7 @@ export default class WebViewComponent extends ComponentBase implements IComponen
|
|||||||
|
|
||||||
private getExtendedOptions(): WebviewOptions {
|
private getExtendedOptions(): WebviewOptions {
|
||||||
let options = this.options || { enableScripts: true };
|
let options = this.options || { enableScripts: true };
|
||||||
|
options = reviveWebviewOptions(options);
|
||||||
return {
|
return {
|
||||||
allowScripts: options.enableScripts,
|
allowScripts: options.enableScripts,
|
||||||
allowSvgs: true,
|
allowSvgs: true,
|
||||||
@@ -208,4 +216,5 @@ export default class WebViewComponent extends ComponentBase implements IComponen
|
|||||||
}
|
}
|
||||||
return rootPaths;
|
return rootPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ class ComponentWrapper implements sqlops.Component {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(nls.localize('invalidIndex', 'The index is invalid.'));
|
throw new Error(nls.localize('invalidIndex', 'The index is invalid.'));
|
||||||
}
|
}
|
||||||
this._proxy.$addToContainer(this._handle, this.id, config.toIItemConfig(), index).then(undefined, this.handleError);
|
this._proxy.$addToContainer(this._handle, this.id, config.toIItemConfig(), index).then(undefined, (err) => this.handleError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
public setLayout(layout: any): Thenable<void> {
|
public setLayout(layout: any): Thenable<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user