提交 3292b99d 编写于 作者: S Sandeep Somavarapu

Deps viewer: Do not render cycles

上级 d3ffa37b
......@@ -41,7 +41,7 @@ export class DataSource implements IDataSource {
}
public hasChildren(tree: ITree, element: IExtensionDependencies): boolean {
return element.hasDependencies;
return element.hasDependencies && !this.isSelfAncestor(element);
}
public getChildren(tree: ITree, element: IExtensionDependencies): Promise {
......@@ -51,6 +51,17 @@ export class DataSource implements IDataSource {
public getParent(tree: ITree, element: IExtensionDependencies): Promise {
return TPromise.as(element.dependent);
}
private isSelfAncestor(element: IExtensionDependencies): boolean {
let ancestor = element.dependent;
while (ancestor !== null) {
if (ancestor.extension.identifier === element.extension.identifier) {
return true;
}
ancestor = ancestor.dependent;
}
return false;
}
}
export class Renderer implements IRenderer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册