diff --git a/src/commands/workspaceCommand.ts b/src/commands/workspaceCommand.ts index 58f1c290..cda26751 100644 --- a/src/commands/workspaceCommand.ts +++ b/src/commands/workspaceCommand.ts @@ -96,7 +96,7 @@ function getServers() { } /* istanbul ignore next */ -async function getConnectionForServer(server: string) { +export async function getConnectionForServer(server: string) { if (server) { const servers = await ext.serverProvider.getChildren(); return servers.find((item) => { diff --git a/src/services/dataSourceEditorProvider.ts b/src/services/dataSourceEditorProvider.ts index a98b86ae..b4337c1f 100644 --- a/src/services/dataSourceEditorProvider.ts +++ b/src/services/dataSourceEditorProvider.ts @@ -27,6 +27,7 @@ import { import { getUri } from "../utils/getUri"; import { getNonce } from "../utils/getNonce"; import { + getConnectionForServer, getInsightsServers, getServerForUri, setServerForUri, @@ -107,6 +108,7 @@ export class DataSourceEditorProvider implements CustomTextEditorProvider { const updateWebview = async () => { const selectedServer = getServerForUri(document.uri) || ""; + await getConnectionForServer(selectedServer); webview.postMessage({ command: DataSourceCommand.Update, selectedServer,