mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Finalize asWebviewUri api
Fixes #79242 As discussed, renames `toWebviewResource` to `asWebviewUri` to be consistent with the `asAbsolutePath` api naming
This commit is contained in:
@@ -10,7 +10,7 @@ import { ExtHostTextEditor } from 'vs/workbench/api/common/extHostTextEditor';
|
||||
import { ExtHostEditors } from 'vs/workbench/api/common/extHostTextEditors';
|
||||
import * as vscode from 'vscode';
|
||||
import { ExtHostEditorInsetsShape, MainThreadEditorInsetsShape } from './extHost.protocol';
|
||||
import { toWebviewResource, WebviewInitData } from 'vs/workbench/api/common/shared/webview';
|
||||
import { asWebviewUri, WebviewInitData } from 'vs/workbench/api/common/shared/webview';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
|
||||
@@ -65,8 +65,8 @@ export class ExtHostEditorInsets implements ExtHostEditorInsetsShape {
|
||||
private _html: string = '';
|
||||
private _options: vscode.WebviewOptions = Object.create(null);
|
||||
|
||||
toWebviewResource(resource: vscode.Uri): vscode.Uri {
|
||||
return toWebviewResource(that._initData, this._uuid, resource);
|
||||
asWebviewUri(resource: vscode.Uri): vscode.Uri {
|
||||
return asWebviewUri(that._initData, this._uuid, resource);
|
||||
}
|
||||
|
||||
get cspSource(): string {
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ExtHostWebviewsShape, IMainContext, MainContext, MainThreadWebviewsShap
|
||||
import { Disposable } from './extHostTypes';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import * as modes from 'vs/editor/common/modes';
|
||||
import { WebviewInitData, toWebviewResource } from 'vs/workbench/api/common/shared/webview';
|
||||
import { WebviewInitData, asWebviewUri } from 'vs/workbench/api/common/shared/webview';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
|
||||
type IconPath = URI | { light: URI, dark: URI };
|
||||
@@ -35,8 +35,8 @@ export class ExtHostWebview implements vscode.Webview {
|
||||
this._onMessageEmitter.dispose();
|
||||
}
|
||||
|
||||
public toWebviewResource(resource: vscode.Uri): vscode.Uri {
|
||||
return toWebviewResource(this._initData, this._handle, resource);
|
||||
public asWebviewUri(resource: vscode.Uri): vscode.Uri {
|
||||
return asWebviewUri(this._initData, this._handle, resource);
|
||||
}
|
||||
|
||||
public get cspSource(): string {
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface WebviewInitData {
|
||||
readonly webviewCspSource: string;
|
||||
}
|
||||
|
||||
export function toWebviewResource(
|
||||
export function asWebviewUri(
|
||||
initData: WebviewInitData,
|
||||
uuid: string,
|
||||
resource: vscode.Uri
|
||||
|
||||
Reference in New Issue
Block a user