mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 10492ba146318412cbee8b76a8c630f226914734
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user