mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 17:22:55 -05:00
Remove disposable from connection (#22687)
* Remove disposable from connection * Remove from group
This commit is contained in:
@@ -8,7 +8,7 @@ import { IListService, IWorkbenchAsyncDataTreeOptions, WorkbenchAsyncDataTree }
|
||||
import { FuzzyScore } from 'vs/base/common/filters';
|
||||
import { TreeNode } from 'sql/workbench/services/objectExplorer/common/treeNode';
|
||||
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
|
||||
import { IAsyncDataTreeNode, IAsyncDataTreeUpdateChildrenOptions, IAsyncDataTreeViewState } from 'vs/base/browser/ui/tree/asyncDataTree';
|
||||
import { IAsyncDataTreeNode, IAsyncDataTreeUpdateChildrenOptions } from 'vs/base/browser/ui/tree/asyncDataTree';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
@@ -57,13 +57,6 @@ export class AsyncServerTree extends WorkbenchAsyncDataTree<ConnectionProfileGro
|
||||
})
|
||||
}
|
||||
|
||||
// Overriding the setInput method to dispose the original input when a new input is set
|
||||
override async setInput(input: ConnectionProfileGroup, viewState?: IAsyncDataTreeViewState): Promise<void> {
|
||||
const originalInput = this.getInput();
|
||||
await super.setInput(input, viewState);
|
||||
originalInput?.dispose();
|
||||
}
|
||||
|
||||
/**
|
||||
* The original implementation of getDataNode compares refrences of the elements to find the node.
|
||||
* This is not working for our case as we are creating new elements everytime we refresh the tree.
|
||||
|
||||
@@ -151,10 +151,7 @@ export class TreeUpdateUtils {
|
||||
|
||||
public static getTreeInput(connectionManagementService: IConnectionManagementService, providers?: string[]): ConnectionProfileGroup | undefined {
|
||||
const groups = connectionManagementService.getConnectionGroups(providers);
|
||||
const input = groups.find(group => group.isRoot);
|
||||
// Dispose of the unused groups to clean up their handlers
|
||||
groups.filter(g => g !== input).forEach(g => g.dispose());
|
||||
return input;
|
||||
return groups.find(group => group.isRoot);
|
||||
}
|
||||
|
||||
public static hasObjectExplorerNode(connection: ConnectionProfile, connectionManagementService: IConnectionManagementService): boolean {
|
||||
|
||||
Reference in New Issue
Block a user