Skip to content

Commit ee6549b

Browse files
committed
better logging and fixed linter issues
1 parent 703621b commit ee6549b

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

src/client/providers/jediProxy.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
import * as fs from 'fs';
4-
import * as os from 'os';
53
import * as child_process from 'child_process';
64
import * as vscode from 'vscode';
75
import * as path from 'path';
@@ -214,7 +212,7 @@ function spawnProcess(dir: string) {
214212
proc.stdout.on("data", (data: string) => {
215213
//Possible there was an exception in parsing the data returned
216214
//So append the data then parse it
217-
var dataStr = previousData = previousData + data + ""
215+
var dataStr = previousData = previousData + data + "";
218216
var responses: any[];
219217
try {
220218
responses = dataStr.split(/\r?\n/g).filter(line => line.length > 0).map(resp => JSON.parse(resp));
@@ -272,7 +270,7 @@ function spawnProcess(dir: string) {
272270
let completionResult: ICompletionResult = {
273271
items: results,
274272
requestId: cmd.id
275-
}
273+
};
276274
cmd.resolve(completionResult);
277275
break;
278276
}
@@ -304,7 +302,7 @@ function spawnProcess(dir: string) {
304302
var defResults: ISymbolResult = {
305303
requestId: cmd.id,
306304
definitions: []
307-
}
305+
};
308306
defResults.definitions = defs.map(def => {
309307
const originalType = def.type as string;
310308
return <IDefinition>{
@@ -321,7 +319,7 @@ function spawnProcess(dir: string) {
321319
break;
322320
}
323321
case CommandType.Usages: {
324-
var defs = <any[]>response['results'];
322+
let defs = <any[]>response['results'];
325323
defs = Array.isArray(defs) ? defs : [];
326324
var refResult: IReferenceResult = {
327325
requestId: cmd.id,
@@ -358,7 +356,7 @@ function spawnProcess(dir: string) {
358356
if (commands.has(id)) {
359357
commands.delete(id);
360358
}
361-
})
359+
});
362360
}
363361
});
364362
});
@@ -386,6 +384,7 @@ function sendCommand<T extends ICommandResult>(cmd: ICommand<T>): Promise<T> {
386384
}
387385
else {
388386
handleError("sendCommand", ex.message);
387+
console.error(ex);
389388
}
390389
reject(ex.message);
391390
}
@@ -497,18 +496,18 @@ export interface ICommand<T extends ICommandResult> {
497496

498497
interface IExecutionCommand<T extends ICommandResult> extends ICommand<T> {
499498
id?: number;
500-
resolve: (value?: T) => void
499+
resolve: (value?: T) => void;
501500
reject: (ICommandError) => void;
502501
token: vscode.CancellationToken;
503502
delays: telemetryHelper.Delays;
504503
}
505504

506505
export interface ICommandError {
507-
message: string
506+
message: string;
508507
}
509508

510509
export interface ICommandResult {
511-
requestId: number
510+
requestId: number;
512511
}
513512
export interface ICompletionResult extends ICommandResult {
514513
items: IAutoCompleteItem[];
@@ -541,11 +540,11 @@ export interface IArgument {
541540
}
542541

543542
export interface IReference {
544-
name: string,
545-
fileName: string,
546-
columnIndex: number,
547-
lineIndex: number,
548-
moduleName: string
543+
name: string;
544+
fileName: string;
545+
columnIndex: number;
546+
lineIndex: number;
547+
moduleName: string;
549548
}
550549

551550
export interface IAutoCompleteItem {

0 commit comments

Comments
 (0)