Skip to content

Commit c487e75

Browse files
committed
cleanup ES6 iterables utils in Comments.
1 parent 205b0e3 commit c487e75

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/vs/workbench/api/browser/mainThreadComments.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { CancellationToken } from 'vs/base/common/cancellation';
77
import { Emitter, Event } from 'vs/base/common/event';
88
import { Disposable, DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';
9-
import { keys } from 'vs/base/common/map';
109
import { URI, UriComponents } from 'vs/base/common/uri';
1110
import { generateUuid } from 'vs/base/common/uuid';
1211
import { IRange } from 'vs/editor/common/core/range';
@@ -284,7 +283,7 @@ export class MainThreadCommentController {
284283

285284
async getDocumentComments(resource: URI, token: CancellationToken) {
286285
let ret: modes.CommentThread[] = [];
287-
for (let thread of keys(this._threads)) {
286+
for (let thread of [...this._threads.keys()]) {
288287
const commentThread = this._threads.get(thread)!;
289288
if (commentThread.resource === resource.toString()) {
290289
ret.push(commentThread);
@@ -315,7 +314,7 @@ export class MainThreadCommentController {
315314

316315
getAllComments(): MainThreadCommentThread[] {
317316
let ret: MainThreadCommentThread[] = [];
318-
for (let thread of keys(this._threads)) {
317+
for (let thread of [...this._threads.keys()]) {
319318
ret.push(this._threads.get(thread)!);
320319
}
321320

@@ -486,7 +485,7 @@ export class MainThreadComments extends Disposable implements MainThreadComments
486485
if (!commentsPanelAlreadyConstructed && !this._openViewListener) {
487486
this._openViewListener = this._viewsService.onDidChangeViewVisibility(e => {
488487
if (e.id === COMMENTS_VIEW_ID && e.visible) {
489-
keys(this._commentControllers).forEach(handle => {
488+
[...this._commentControllers.keys()].forEach(handle => {
490489
let threads = this._commentControllers.get(handle)!.getAllComments();
491490

492491
if (threads.length) {

0 commit comments

Comments
 (0)