mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Move the webviewResourceRoot property to be set on each webview instead of as a global property
For #72155 This allows us to potentially change the resource root per webview
This commit is contained in:
@@ -12,6 +12,7 @@ import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/common/we
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IActiveCodeEditor, IViewZone } from 'vs/editor/browser/editorBrowser';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
// todo@joh move these things back into something like contrib/insets
|
||||
class EditorWebviewZone implements IViewZone {
|
||||
@@ -59,6 +60,7 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
|
||||
|
||||
constructor(
|
||||
context: IExtHostContext,
|
||||
@IEnvironmentService private readonly _environmentService: IEnvironmentService,
|
||||
@ICodeEditorService private readonly _editorService: ICodeEditorService,
|
||||
@IWebviewService private readonly _webviewService: IWebviewService,
|
||||
) {
|
||||
@@ -144,4 +146,8 @@ export class MainThreadEditorInsets implements MainThreadEditorInsetsShape {
|
||||
}
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
async $getResourceRoot(_handle: number): Promise<string> {
|
||||
return this._environmentService.webviewResourceRoot;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user