Skip to content

Commit

Permalink
rename WorkspaceEditMetadata to WorkspaceEditEntryMetadata #77728
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Feb 20, 2020
1 parent 125c9ea commit aea05e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ declare module 'vscode' {
* as needing confirmation by the user. The editor groups edits with equal labels into tree nodes,
* for instance all edits labelled with "Changes in Strings" would be a tree node.
*/
export interface WorkspaceEditMetadata {
export interface WorkspaceEditEntryMetadata {

/**
* A flag which indicates that user confirmation is needed.
Expand All @@ -1440,13 +1440,13 @@ declare module 'vscode' {

export interface WorkspaceEdit {

insert(uri: Uri, position: Position, newText: string, metadata?: WorkspaceEditMetadata): void;
delete(uri: Uri, range: Range, metadata?: WorkspaceEditMetadata): void;
replace(uri: Uri, range: Range, newText: string, metadata?: WorkspaceEditMetadata): void;
insert(uri: Uri, position: Position, newText: string, metadata?: WorkspaceEditEntryMetadata): void;
delete(uri: Uri, range: Range, metadata?: WorkspaceEditEntryMetadata): void;
replace(uri: Uri, range: Range, newText: string, metadata?: WorkspaceEditEntryMetadata): void;

createFile(uri: Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean }, metadata?: WorkspaceEditMetadata): void;
deleteFile(uri: Uri, options?: { recursive?: boolean, ignoreIfNotExists?: boolean }, metadata?: WorkspaceEditMetadata): void;
renameFile(oldUri: Uri, newUri: Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean }, metadata?: WorkspaceEditMetadata): void;
createFile(uri: Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
deleteFile(uri: Uri, options?: { recursive?: boolean, ignoreIfNotExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
renameFile(oldUri: Uri, newUri: Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean }, metadata?: WorkspaceEditEntryMetadata): void;
}

//#endregion
Expand Down
16 changes: 8 additions & 8 deletions src/vs/workbench/api/common/extHostTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,42 +576,42 @@ export interface IFileOperation {
from?: URI;
to?: URI;
options?: IFileOperationOptions;
metadata?: vscode.WorkspaceEditMetadata;
metadata?: vscode.WorkspaceEditEntryMetadata;
}

export interface IFileTextEdit {
_type: 2;
uri: URI;
edit: TextEdit;
metadata?: vscode.WorkspaceEditMetadata;
metadata?: vscode.WorkspaceEditEntryMetadata;
}

@es5ClassCompat
export class WorkspaceEdit implements vscode.WorkspaceEdit {

private _edits = new Array<IFileOperation | IFileTextEdit>();

renameFile(from: vscode.Uri, to: vscode.Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean; }, metadata?: vscode.WorkspaceEditMetadata): void {
renameFile(from: vscode.Uri, to: vscode.Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean; }, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this._edits.push({ _type: 1, from, to, options, metadata });
}

createFile(uri: vscode.Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean; }, metadata?: vscode.WorkspaceEditMetadata): void {
createFile(uri: vscode.Uri, options?: { overwrite?: boolean, ignoreIfExists?: boolean; }, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this._edits.push({ _type: 1, from: undefined, to: uri, options, metadata });
}

deleteFile(uri: vscode.Uri, options?: { recursive?: boolean, ignoreIfNotExists?: boolean; }, metadata?: vscode.WorkspaceEditMetadata): void {
deleteFile(uri: vscode.Uri, options?: { recursive?: boolean, ignoreIfNotExists?: boolean; }, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this._edits.push({ _type: 1, from: uri, to: undefined, options, metadata });
}

replace(uri: URI, range: Range, newText: string, metadata?: vscode.WorkspaceEditMetadata): void {
replace(uri: URI, range: Range, newText: string, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this._edits.push({ _type: 2, uri, edit: new TextEdit(range, newText), metadata });
}

insert(resource: URI, position: Position, newText: string, metadata?: vscode.WorkspaceEditMetadata): void {
insert(resource: URI, position: Position, newText: string, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this.replace(resource, new Range(position, position), newText, metadata);
}

delete(resource: URI, range: Range, metadata?: vscode.WorkspaceEditMetadata): void {
delete(resource: URI, range: Range, metadata?: vscode.WorkspaceEditEntryMetadata): void {
this.replace(resource, range, '', metadata);
}

Expand Down

0 comments on commit aea05e0

Please sign in to comment.