mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
fix issue with finding required node handles (#118091)
This PR fixes #microsoft/azuredatastudio#14229
This commit is contained in:
@@ -497,12 +497,12 @@ class ExtHostTreeView<T> extends Disposable {
|
||||
|
||||
private getHandlesToRefresh(elements: T[]): TreeItemHandle[] {
|
||||
const elementsToUpdate = new Set<TreeItemHandle>();
|
||||
for (const element of elements) {
|
||||
const elementNode = this.nodes.get(element);
|
||||
const elementNodes = elements.map(element => this.nodes.get(element));
|
||||
for (const elementNode of elementNodes) {
|
||||
if (elementNode && !elementsToUpdate.has(elementNode.item.handle)) {
|
||||
// check if an ancestor of extElement is already in the elements to update list
|
||||
// check if an ancestor of extElement is already in the elements list
|
||||
let currentNode: TreeNode | undefined = elementNode;
|
||||
while (currentNode && currentNode.parent && !elementsToUpdate.has(currentNode.parent.item.handle)) {
|
||||
while (currentNode && currentNode.parent && elementNodes.findIndex(node => currentNode && currentNode.parent && node && node.item.handle === currentNode.parent.item.handle) === -1) {
|
||||
const parentElement: T | undefined = this.elements.get(currentNode.parent.item.handle);
|
||||
currentNode = parentElement ? this.nodes.get(parentElement) : undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user