Get tools service install location from extensions (#16796)

* Get STS install location from extensions

* Update error
This commit is contained in:
Charles Gagnon
2021-08-17 13:48:22 -07:00
committed by GitHub
parent f2499fb01b
commit 6b1cc85c9a
7 changed files with 26 additions and 38 deletions

View File

@@ -35,13 +35,15 @@ export class SqlToolsServer {
private client: SqlOpsDataClient;
private config: IConfig;
private disposables = new Array<{ dispose: () => void }>();
public installDirectory: string | undefined = undefined;
public async start(context: AppContext): Promise<SqlOpsDataClient> {
try {
const installationStart = Date.now();
const path = await this.download(context);
const serverPath = await this.download(context);
this.installDirectory = path.dirname(serverPath);
const installationComplete = Date.now();
let serverOptions = generateServerOptions(context.extensionContext.logPath, path);
let serverOptions = generateServerOptions(context.extensionContext.logPath, serverPath);
let clientOptions = getClientOptions(context);
this.client = new SqlOpsDataClient(Constants.serviceName, serverOptions, clientOptions);
const processStart = Date.now();