mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 10:38:31 -05:00
Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 (#9385)
* Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 * distro
This commit is contained in:
@@ -130,6 +130,7 @@ class BulkEditModel implements IDisposable {
|
||||
private _tasks: ModelEditTask[] | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly _label: string | undefined,
|
||||
private readonly _editor: ICodeEditor | undefined,
|
||||
private readonly _progress: IProgress<void>,
|
||||
edits: WorkspaceTextEdit[],
|
||||
@@ -232,7 +233,7 @@ class BulkEditModel implements IDisposable {
|
||||
}
|
||||
|
||||
const multiModelEditStackElement = new MultiModelEditStackElement(
|
||||
localize('workspaceEdit', "Workspace Edit"),
|
||||
this._label || localize('workspaceEdit', "Workspace Edit"),
|
||||
tasks.map(t => new EditStackElement(t.model, t.getBeforeCursorState()))
|
||||
);
|
||||
this._undoRedoService.pushElement(multiModelEditStackElement);
|
||||
@@ -250,11 +251,13 @@ type Edit = WorkspaceFileEdit | WorkspaceTextEdit;
|
||||
|
||||
class BulkEdit {
|
||||
|
||||
private readonly _label: string | undefined;
|
||||
private readonly _edits: Edit[] = [];
|
||||
private readonly _editor: ICodeEditor | undefined;
|
||||
private readonly _progress: IProgress<IProgressStep>;
|
||||
|
||||
constructor(
|
||||
label: string | undefined,
|
||||
editor: ICodeEditor | undefined,
|
||||
progress: IProgress<IProgressStep> | undefined,
|
||||
edits: Edit[],
|
||||
@@ -265,6 +268,7 @@ class BulkEdit {
|
||||
@IWorkingCopyFileService private readonly _workingCopyFileService: IWorkingCopyFileService,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService
|
||||
) {
|
||||
this._label = label;
|
||||
this._editor = editor;
|
||||
this._progress = progress || Progress.None;
|
||||
this._edits = edits;
|
||||
@@ -361,7 +365,7 @@ class BulkEdit {
|
||||
private async _performTextEdits(edits: WorkspaceTextEdit[], progress: IProgress<void>): Promise<void> {
|
||||
this._logService.debug('_performTextEdits', JSON.stringify(edits));
|
||||
|
||||
const model = this._instaService.createInstance(BulkEditModel, this._editor, progress, edits);
|
||||
const model = this._instaService.createInstance(BulkEditModel, this._label, this._editor, progress, edits);
|
||||
|
||||
await model.prepare();
|
||||
|
||||
@@ -439,7 +443,7 @@ export class BulkEditService implements IBulkEditService {
|
||||
// If the code editor is readonly still allow bulk edits to be applied #68549
|
||||
codeEditor = undefined;
|
||||
}
|
||||
const bulkEdit = this._instaService.createInstance(BulkEdit, codeEditor, options?.progress, edits);
|
||||
const bulkEdit = this._instaService.createInstance(BulkEdit, options?.quotableLabel || options?.label, codeEditor, options?.progress, edits);
|
||||
return bulkEdit.perform().then(() => {
|
||||
return { ariaSummary: bulkEdit.ariaMessage() };
|
||||
}).catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user