Skip to content

Commit

Permalink
Bump version number, rename config hhClientPath var
Browse files Browse the repository at this point in the history
  • Loading branch information
PranayAgarwal committed Nov 21, 2017
1 parent aa155bd commit 57432ff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-hack",
"version": "0.6.1",
"version": "0.6.2",
"publisher": "pranayagarwal",
"engines": {
"vscode": "^1.15.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const hackConfig = vscode.workspace.getConfiguration('hack');

export const clientPath: string = hackConfig.get('clientPath') || 'hh_client';
export const hhClientArgs: string[] = clientPath.split(' ');
export const hhClientPath: string = String(hhClientArgs.shift());
export const hhClientCommand: string = String(hhClientArgs.shift());

export const workspace: string = hackConfig.get('workspaceRootPath') || vscode.workspace.rootPath || '';
export const enableCoverageCheck: boolean = hackConfig.get('enableCoverageCheck') || false;
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function activate(context: vscode.ExtensionContext) {
if (version.api_version >= 5 && config.useLanguageServer) {
const languageClient = new LanguageClient(
'Hack Language Server',
{ command: config.hhClientPath, args: [...config.hhClientArgs, 'lsp'] },
{ command: config.hhClientCommand, args: [...config.hhClientArgs, 'lsp'] },
{ documentSelector: ['hack'], uriConverters: { code2Protocol: utils.mapFromWorkspaceUri, protocol2Code: utils.mapToWorkspaceUri } });
context.subscriptions.push(languageClient.start());
return;
Expand Down
3 changes: 2 additions & 1 deletion src/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export async function format(text: string, startPos: number, endPos: number): Pr

async function run(extraArgs: string[], stdin?: string): Promise<any> {
return new Promise<any>((resolve, _) => {
const p = ps.execFile(config.hhClientPath, [...config.hhClientArgs, ...extraArgs, '--json', config.workspace], { maxBuffer: 1024 * 1024 }, (err: any, stdout, stderr) => {
const args: string[] = [...config.hhClientArgs, ...extraArgs, '--json', config.workspace];
const p = ps.execFile(config.hhClientCommand, args, { maxBuffer: 1024 * 1024 }, (err: any, stdout, stderr) => {
if (err !== null && err.code !== 0 && err.code !== 2) {
// any hh_client failure other than typecheck errors
console.error(`Hack: hh_client execution error: ${err}`);
Expand Down

0 comments on commit 57432ff

Please sign in to comment.