in src/server/server-manager.ts [91:121]
private async connectionDetailsWithInstallCheck(
rootDir: string
): Promise<BspConnectionDetails | undefined> {
// Return existing connection details if available.
let connDetails =
await this.connectionDetailsParser.getServerConnectionDetails(
SERVER_NAME,
rootDir
)
const configuredVersion = getExtensionSetting(
SettingName.BSP_SERVER_VERSION
)
if (connDetails && connDetails?.version === configuredVersion) {
return connDetails
}
// If unable to acquire connection details, prompt the user to install.
const installSuccess: boolean =
await vscode.commands.executeCommand(INSTALL_BSP_COMMAND)
if (installSuccess) {
// Retry connection details parsing after successful installation.
// If this still fails, output channel can be used to investigate further.
return this.connectionDetailsParser.getServerConnectionDetails(
SERVER_NAME,
rootDir
)
}
// Installation was declined or failed.
return undefined
}