mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -05:00
Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)
* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c * remove files we don't want * fix hygiene * update distro * update distro * fix hygiene * fix strict nulls * distro * distro * fix tests * fix tests * add another edit * fix viewlet icon * fix azure dialog * fix some padding * fix more padding issues
This commit is contained in:
@@ -226,17 +226,18 @@ class BulkEditModel implements IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
export type Edit = ResourceFileEdit | ResourceTextEdit;
|
||||
type Edit = ResourceFileEdit | ResourceTextEdit;
|
||||
|
||||
export class BulkEdit {
|
||||
class BulkEdit {
|
||||
|
||||
private _edits: Edit[] = [];
|
||||
private _editor: ICodeEditor | undefined;
|
||||
private _progress: IProgress<IProgressStep>;
|
||||
private readonly _edits: Edit[] = [];
|
||||
private readonly _editor: ICodeEditor | undefined;
|
||||
private readonly _progress: IProgress<IProgressStep>;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor | undefined,
|
||||
progress: IProgress<IProgressStep> | undefined,
|
||||
edits: Edit[],
|
||||
@ILogService private readonly _logService: ILogService,
|
||||
@ITextModelService private readonly _textModelService: ITextModelService,
|
||||
@IFileService private readonly _fileService: IFileService,
|
||||
@@ -246,14 +247,7 @@ export class BulkEdit {
|
||||
) {
|
||||
this._editor = editor;
|
||||
this._progress = progress || emptyProgress;
|
||||
}
|
||||
|
||||
add(edits: Edit[] | Edit): void {
|
||||
if (Array.isArray(edits)) {
|
||||
this._edits.push(...edits);
|
||||
} else {
|
||||
this._edits.push(edits);
|
||||
}
|
||||
this._edits = edits;
|
||||
}
|
||||
|
||||
ariaMessage(): string {
|
||||
@@ -419,8 +413,11 @@ export class BulkEditService implements IBulkEditService {
|
||||
// If the code editor is readonly still allow bulk edits to be applied #68549
|
||||
codeEditor = undefined;
|
||||
}
|
||||
const bulkEdit = new BulkEdit(codeEditor, options.progress, this._logService, this._textModelService, this._fileService, this._textFileService, this._labelService, this._configurationService);
|
||||
bulkEdit.add(edits);
|
||||
const bulkEdit = new BulkEdit(
|
||||
codeEditor, options.progress, edits,
|
||||
this._logService, this._textModelService, this._fileService, this._textFileService, this._labelService, this._configurationService
|
||||
);
|
||||
|
||||
|
||||
return bulkEdit.perform().then(() => {
|
||||
return { ariaSummary: bulkEdit.ariaMessage() };
|
||||
|
||||
Reference in New Issue
Block a user