Merge from vscode 10492ba146318412cbee8b76a8c630f226914734

This commit is contained in:
ADS Merger
2020-04-08 06:33:38 +00:00
parent fca2344c2e
commit 1868a7d370
339 changed files with 3795 additions and 3146 deletions

View File

@@ -5,7 +5,6 @@
import { memoize } from 'vs/base/common/decorators';
import * as paths from 'vs/base/common/path';
import { Iterator } from 'vs/base/common/iterator';
import { relativePath, joinPath } from 'vs/base/common/resources';
import { URI } from 'vs/base/common/uri';
import { PathIterator, values } from 'vs/base/common/map';
@@ -15,7 +14,7 @@ export interface IResourceNode<T, C = void> {
readonly relativePath: string;
readonly name: string;
readonly element: T | undefined;
readonly children: Iterator<IResourceNode<T, C>>;
readonly children: Iterable<IResourceNode<T, C>>;
readonly childrenCount: number;
readonly parent: IResourceNode<T, C> | undefined;
readonly context: C;
@@ -30,8 +29,8 @@ class Node<T, C> implements IResourceNode<T, C> {
return this._children.size;
}
get children(): Iterator<Node<T, C>> {
return Iterator.fromArray(values(this._children));
get children(): Iterable<Node<T, C>> {
return [...values(this._children)];
}
@memoize
@@ -69,7 +68,9 @@ function collect<T, C>(node: IResourceNode<T, C>, result: T[]): T[] {
result.push(node.element);
}
Iterator.forEach(node.children, child => collect(child, result));
for (const child of node.children) {
collect(child, result);
}
return result;
}