Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/vs/base/common/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ export class DisposableTracker implements IDisposableTracker {

const leaking = [...this.livingDisposables.entries()]
.filter(([, v]) => v.source !== null && !this.getRootParent(v, rootParentCache).isSingleton)
.map(([k]) => k)
.flat();
.flatMap(([k]) => k);

return leaking;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadNotebookKernels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ abstract class MainThreadKernel implements INotebookKernel {
}

public get preloadProvides() {
return this.preloads.map(p => p.provides).flat();
return this.preloads.flatMap(p => p.provides);
}

constructor(data: INotebookKernelDto2, private _languageService: ILanguageService) {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RenameOperation implements IFileOperation {
) { }

get uris() {
return this._edits.map(edit => [edit.newUri, edit.oldUri]).flat();
return this._edits.flatMap(edit => [edit.newUri, edit.oldUri]);
}

async perform(token: CancellationToken): Promise<IFileOperation> {
Expand Down Expand Up @@ -106,7 +106,7 @@ class CopyOperation implements IFileOperation {
) { }

get uris() {
return this._edits.map(edit => [edit.newUri, edit.oldUri]).flat();
return this._edits.flatMap(edit => [edit.newUri, edit.oldUri]);
}

async perform(token: CancellationToken): Promise<IFileOperation> {
Expand Down Expand Up @@ -297,7 +297,7 @@ class FileUndoRedoElement implements IWorkspaceUndoRedoElement {
readonly operations: IFileOperation[],
readonly confirmBeforeUndo: boolean
) {
this.resources = operations.map(op => op.uris).flat();
this.resources = operations.flatMap(op => op.uris);
}

async undo(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class CodeActionsContribution extends Disposable implements IWorkbenchCon
super();

codeActionsExtensionPoint.setHandler(extensionPoints => {
this._contributedCodeActions = extensionPoints.map(x => x.value).flat();
this._contributedCodeActions = extensionPoints.flatMap(x => x.value);
this.updateConfigurationSchema(this._contributedCodeActions);
this._onDidChangeContributions.fire();
});
Expand Down Expand Up @@ -143,7 +143,7 @@ export class CodeActionsContribution extends Disposable implements IWorkbenchCon
};

const getActions = (ofKind: CodeActionKind): ContributedCodeAction[] => {
const allActions = this._contributedCodeActions.map(desc => desc.actions).flat();
const allActions = this._contributedCodeActions.flatMap(desc => desc.actions);

const out = new Map<string, ContributedCodeAction>();
for (const action of allActions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ export class AiRelatedInformationService implements IAiRelatedInformationService
}
const result = results
.filter(r => r.status === 'fulfilled')
.map(r => (r as PromiseFulfilledResult<RelatedInformationResult[]>).value)
.flat();
.flatMap(r => (r as PromiseFulfilledResult<RelatedInformationResult[]>).value);
return result;
} finally {
stopwatch.stop();
Expand Down