Skip to content

Commit

Permalink
Merge c47ab8d into 0c701f4
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Bist committed Dec 9, 2019
2 parents 0c701f4 + c47ab8d commit c3fb16d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/constants/constants.ts
Expand Up @@ -130,4 +130,6 @@ export const sqlToolsServiceConfigKey = 'service';
export const v1SqlToolsServiceConfigKey = 'v1Service';
export const scriptSelectText = 'SELECT TOP (1000) * FROM ';
export const tenantDisplayName = 'Microsoft';
export const firewallErrorMessage = 'To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.';
export const firewallErrorMessage = 'To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range.';
export const windowsResourceClientPath = 'SqlToolsResourceProviderService.exe';
export const unixResourceClientPath = 'SqlToolsResourceProviderService';
10 changes: 5 additions & 5 deletions src/languageservice/serviceclient.ts
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';

import { ExtensionContext, workspace, window, OutputChannel, languages } from 'vscode';
import {
LanguageClient, LanguageClientOptions, ServerOptions,
Expand Down Expand Up @@ -190,11 +189,11 @@ export default class SqlToolsServiceClient {
_channel.show();
}
let installedServerPath = await this._server.downloadServerFiles(platformInfo.runtimeId);
this.initializeLanguageClient(installedServerPath, context);
this.initializeLanguageClient(installedServerPath, context, platformInfo.isWindows());
await this._client.onReady();
resolve(new ServerInitializationResult(true, true, installedServerPath));
} else {
this.initializeLanguageClient(serverPath, context);
this.initializeLanguageClient(serverPath, context, platformInfo.isWindows());
await this._client.onReady();
resolve(new ServerInitializationResult(false, true, serverPath));
}
Expand Down Expand Up @@ -256,7 +255,7 @@ export default class SqlToolsServiceClient {
});
}

private initializeLanguageClient(serverPath: string, context: ExtensionContext): void {
private initializeLanguageClient(serverPath: string, context: ExtensionContext, isWindows: boolean): void {
if (serverPath === undefined) {
Utils.logDebug(Constants.invalidServiceFilePath);
throw new Error(Constants.invalidServiceFilePath);
Expand All @@ -265,7 +264,8 @@ export default class SqlToolsServiceClient {
self.initializeLanguageConfiguration();
let serverOptions: ServerOptions = this.createServerOptions(serverPath);
this.client = this.createLanguageClient(serverOptions);
let resourcePath = path.join(path.dirname(serverPath), 'SqlToolsResourceProviderService.exe');
let executablePath = isWindows ? Constants.windowsResourceClientPath : Constants.unixResourceClientPath;
let resourcePath = path.join(path.dirname(serverPath), executablePath);
this._resourceClient = this.createResourceClient(resourcePath);

if (context !== undefined) {
Expand Down

0 comments on commit c3fb16d

Please sign in to comment.