diff --git a/src/sql/workbench/contrib/objectExplorer/browser/serverTreeView.ts b/src/sql/workbench/contrib/objectExplorer/browser/serverTreeView.ts index 55817b2f8e..bccc873c08 100644 --- a/src/sql/workbench/contrib/objectExplorer/browser/serverTreeView.ts +++ b/src/sql/workbench/contrib/objectExplorer/browser/serverTreeView.ts @@ -294,7 +294,7 @@ export class ServerTreeView extends Disposable implements IServerTreeView { await this.refreshTree(); if (newProfile && !newProfileIsSelected) { await this._tree!.reveal(newProfile); - this._tree!.select(newProfile); + this._tree.setFocus(newProfile); } } diff --git a/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts b/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts index 25f9b571d1..9d75c8592d 100644 --- a/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts +++ b/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts @@ -122,17 +122,17 @@ suite('ServerTreeView onAddConnectionProfile handler tests', () => { - test('onAddConnectionProfile handler selects the new profile when no profile is already selected', async () => { + test('onAddConnectionProfile handler focuses the new profile when no profile is already selected', async () => { let newProfile = { id: 'test_connection' }; await runAddConnectionProfileHandler(undefined, newProfile); mockRefreshTreeMethod.verify(x => x(), TypeMoq.Times.once()); mockTree.verify(x => x.clearSelection(), TypeMoq.Times.never()); - mockTree.verify(x => x.select(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once()); + mockTree.verify(x => x.setFocus(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once()); }); - test('onAddConnectionProfile handler selects the new profile when a different profile is already selected', async () => { + test('onAddConnectionProfile handler focuses the new profile when a different profile is already selected', async () => { let oldProfile = { id: 'old_connection' }; @@ -142,7 +142,7 @@ suite('ServerTreeView onAddConnectionProfile handler tests', () => { await runAddConnectionProfileHandler(oldProfile, newProfile); mockRefreshTreeMethod.verify(x => x(), TypeMoq.Times.once()); mockTree.verify(x => x.clearSelection(), TypeMoq.Times.once()); - mockTree.verify(x => x.select(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once()); + mockTree.verify(x => x.setFocus(TypeMoq.It.is(profile => profile === newProfile)), TypeMoq.Times.once()); }); test('onAddConnectionProfile handler does not clear the selection when the new profile is already selected', async () => {