Skip to content

Commit 3e6ba16

Browse files
committed
show preview only for rename
1 parent 517ff5d commit 3e6ba16

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/vs/editor/browser/services/bulkEditService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const IBulkEditService = createDecorator<IBulkEditService>('IWorkspaceEdi
1414
export interface IBulkEditOptions {
1515
editor?: ICodeEditor;
1616
progress?: IProgress<IProgressStep>;
17-
noPreview?: boolean;
17+
showPreview?: boolean;
1818
}
1919

2020
export interface IBulkEditResult {

src/vs/editor/contrib/rename/rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class RenameController implements IEditorContribution {
200200

201201
this._bulkEditService.apply(renameResult, {
202202
editor: this.editor,
203-
noPreview: !inputFieldResult.wantsPreview
203+
showPreview: inputFieldResult.wantsPreview
204204
}).then(result => {
205205
if (result.ariaSummary) {
206206
alert(nls.localize('aria', "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc!.text, inputFieldResult.newName, result.ariaSummary));

src/vs/workbench/api/browser/mainThreadEditors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
217217

218218
$tryApplyWorkspaceEdit(dto: IWorkspaceEditDto): Promise<boolean> {
219219
const { edits } = reviveWorkspaceEditDto(dto);
220-
return this._bulkEditService.apply({ edits }, { noPreview: false }).then(() => true, err => false);
220+
return this._bulkEditService.apply({ edits }).then(() => true, _err => false);
221221
}
222222

223223
$tryInsertSnippet(id: string, template: string, ranges: readonly IRange[], opts: IUndoStopOptions): Promise<boolean> {

src/vs/workbench/contrib/search/browser/replaceService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class ReplaceService implements IReplaceService {
105105
replace(match: FileMatchOrMatch, progress?: IProgress<IProgressStep>, resource?: URI): Promise<any>;
106106
replace(arg: any, progress: IProgress<IProgressStep> | undefined = undefined, resource: URI | null = null): Promise<any> {
107107
const edits: ResourceTextEdit[] = this.createEdits(arg, resource);
108-
return this.bulkEditorService.apply({ edits }, { progress, noPreview: true }).then(() => this.textFileService.saveAll(edits.map(e => e.resource)));
108+
return this.bulkEditorService.apply({ edits }, { progress }).then(() => this.textFileService.saveAll(edits.map(e => e.resource)));
109109
}
110110

111111
openReplacePreview(element: FileMatchOrMatch, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<any> {

src/vs/workbench/services/bulkEdit/browser/bulkEditService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ export class BulkEditService implements IBulkEditService {
406406

407407
async apply(edit: WorkspaceEdit, options?: IBulkEditOptions): Promise<IBulkEditResult> {
408408

409-
if (this._previewHandler && !options?.noPreview) {
409+
if (this._previewHandler && options?.showPreview) {
410410
edit = await this._previewHandler(edit, options);
411411
}
412412

0 commit comments

Comments
 (0)