chore - ES6, use for-of instead of forEach

This commit is contained in:
Johannes Rieken
2020-06-12 16:16:41 +02:00
parent a1feacf5c4
commit 28cb90be8c
19 changed files with 75 additions and 97 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { ICommandService, CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ExtHostContext, MainThreadCommandsShape, ExtHostCommandsShape, MainContext, IExtHostContext } from '../common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { revive } from 'vs/base/common/marshalling';
@@ -28,7 +28,7 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
dispose() {
this._commandRegistrations.forEach(value => value.dispose());
dispose(this._commandRegistrations.values());
this._commandRegistrations.clear();
this._generateCommandsDocumentationRegistration.dispose();

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { onUnexpectedError } from 'vs/base/common/errors';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { URI, UriComponents } from 'vs/base/common/uri';
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { Range } from 'vs/editor/common/core/range';
@@ -35,8 +35,8 @@ export class MainThreadDocumentContentProviders implements MainThreadDocumentCon
}
dispose(): void {
this._resourceContentProvider.forEach(p => p.dispose());
this._pendingUpdate.forEach(source => source.dispose());
dispose(this._resourceContentProvider.values());
dispose(this._pendingUpdate.values());
}
$registerTextContentProvider(handle: number, scheme: string): void {

View File

@@ -266,11 +266,11 @@ class MainThreadDocumentAndEditorStateComputer {
}
if (candidate) {
editors.forEach(snapshot => {
for (const snapshot of editors.values()) {
if (candidate === snapshot.editor) {
activeEditor = snapshot.id;
}
});
}
}
}

View File

@@ -25,7 +25,7 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
}
dispose(): void {
this._fileProvider.forEach(value => value.dispose());
dispose(this._fileProvider.values());
this._fileProvider.clear();
}