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:
Anthony Dresser
2019-12-04 19:28:22 -08:00
committed by GitHub
parent a8818ab0df
commit f5ce7fb2a5
1507 changed files with 42813 additions and 27370 deletions

View File

@@ -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() };