mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
add recrusive-flag to deleteFile-function, #52941
This commit is contained in:
@@ -29,7 +29,7 @@ import { IConfig, IAdapterExecutable, ITerminalSettings } from 'vs/workbench/par
|
||||
import { IQuickPickItem, IPickOptions, IQuickInputButton } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions';
|
||||
import { EndOfLine, TextEditorLineNumbersStyle } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { EndOfLine, TextEditorLineNumbersStyle, IFileOperationOptions } from 'vs/workbench/api/node/extHostTypes';
|
||||
|
||||
|
||||
import { TaskSet } from 'vs/workbench/parts/tasks/common/tasks';
|
||||
@@ -774,7 +774,7 @@ export interface WorkspaceSymbolsDto extends IdObject {
|
||||
export interface ResourceFileEditDto {
|
||||
oldUri: UriComponents;
|
||||
newUri: UriComponents;
|
||||
options: { overwrite?: boolean, ignoreIfExists?: boolean };
|
||||
options: IFileOperationOptions;
|
||||
}
|
||||
|
||||
export interface ResourceTextEditDto {
|
||||
|
||||
@@ -495,11 +495,17 @@ export class TextEdit {
|
||||
}
|
||||
|
||||
|
||||
export interface IFileOperationOptions {
|
||||
overwrite?: boolean;
|
||||
ignoreIfExists?: boolean;
|
||||
recursive?: boolean;
|
||||
}
|
||||
|
||||
export interface IFileOperation {
|
||||
_type: 1;
|
||||
from: URI;
|
||||
to: URI;
|
||||
options?: { overwrite?: boolean, ignoreIfExists?: boolean; };
|
||||
options?: IFileOperationOptions;
|
||||
}
|
||||
|
||||
export interface IFileTextEdit {
|
||||
@@ -520,8 +526,8 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
|
||||
this._edits.push({ _type: 1, from: undefined, to: uri, options });
|
||||
}
|
||||
|
||||
deleteFile(uri: vscode.Uri): void {
|
||||
this._edits.push({ _type: 1, from: uri, to: undefined });
|
||||
deleteFile(uri: vscode.Uri, options?: { recursive?: boolean }): void {
|
||||
this._edits.push({ _type: 1, from: uri, to: undefined, options });
|
||||
}
|
||||
|
||||
replace(uri: URI, range: Range, newText: string): void {
|
||||
@@ -593,8 +599,8 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
|
||||
return values(textEdits);
|
||||
}
|
||||
|
||||
_allEntries(): ([URI, TextEdit[]] | [URI, URI, { overwrite?: boolean, ignoreIfExists?: boolean }])[] {
|
||||
let res: ([URI, TextEdit[]] | [URI, URI, { overwrite?: boolean, ignoreIfExists?: boolean }])[] = [];
|
||||
_allEntries(): ([URI, TextEdit[]] | [URI, URI, IFileOperationOptions])[] {
|
||||
let res: ([URI, TextEdit[]] | [URI, URI, IFileOperationOptions])[] = [];
|
||||
for (let edit of this._edits) {
|
||||
if (edit._type === 1) {
|
||||
res.push([edit.from, edit.to, edit.options]);
|
||||
|
||||
Reference in New Issue
Block a user