Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(explorer): auto-open connection when done connecting, fix auto open on delete VSCODE-325 VSCODE-398 #619

Merged
merged 2 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/explorer/explorerTreeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,12 @@ export default class ExplorerTreeController
this._connectionTreeItems[connection.id] = new ConnectionTreeItem({
connectionId: connection.id,
collapsibleState: connectionExpandedState,
isExpanded: isActiveConnection,
// Set expanded when we're connecting to a connection so that it
// expands when it's connected.
isExpanded:
isBeingConnectedTo ||
connectionExpandedState ===
vscode.TreeItemCollapsibleState.Expanded,
connectionController: this._connectionController,
cacheIsUpToDate: pastConnectionTreeItems[connection.id]
? pastConnectionTreeItems[connection.id].cacheIsUpToDate
Expand Down
9 changes: 5 additions & 4 deletions src/test/suite/explorer/explorerController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ suite('Explorer Controller Test Suite', function () {
const connectionName =
testConnectionController._connections[connectionId].name;

assert(
connectionName === 'localhost:27088',
`Expected active connection name to be 'localhost:27088' found ${connectionName}`
);
const connectionsItemsFirstConnect = await treeController.getChildren();

assert.strictEqual(connectionName, 'localhost:27088');
// Ensure we auto expand when it's successfully connected to.
assert(connectionsItemsFirstConnect[0].isExpanded);

try {
await testConnectionController.addNewConnectionStringAndConnect(
Expand Down
Loading