Skip to content

Commit d7f5810

Browse files
committed
fixed linter errors
1 parent a07cb3c commit d7f5810

7 files changed

Lines changed: 20 additions & 28 deletions

File tree

src/client/debugger/DebugServers/BaseDebugServer.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use strict";
22

3-
import {DebugSession, OutputEvent} from "vscode-debugadapter";
3+
import {DebugSession} from "vscode-debugadapter";
44
import {IPythonProcess, IDebugServer} from "../Common/Contracts";
5-
import * as net from "net";
65
import {EventEmitter} from "events";
76
import {Deferred, createDeferred} from '../../common/helpers';
87

@@ -14,15 +13,15 @@ export abstract class BaseDebugServer extends EventEmitter {
1413
public get IsRunning(): boolean {
1514
return this.isRunning;
1615
}
17-
protected debugClientConnected: Deferred<Boolean>;
16+
protected debugClientConnected: Deferred<boolean>;
1817
public get DebugClientConnected(): Promise<boolean> {
1918
return this.debugClientConnected.promise;
2019
}
2120
constructor(debugSession: DebugSession, pythonProcess: IPythonProcess) {
2221
super();
2322
this.debugSession = debugSession;
2423
this.pythonProcess = pythonProcess;
25-
this.debugClientConnected = createDeferred<Boolean>();
24+
this.debugClientConnected = createDeferred<boolean>();
2625
}
2726

2827
public abstract Start(): Promise<IDebugServer>;

src/client/debugger/Main.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
"use strict";
22

3-
import { Variable, DebugSession, InitializedEvent, TerminatedEvent, StoppedEvent, OutputEvent, Thread, StackFrame, Scope, Source, Handles } from "vscode-debugadapter";
3+
import { DebugSession, InitializedEvent, TerminatedEvent, StoppedEvent, OutputEvent, Thread, StackFrame, Scope, Source, Handles } from "vscode-debugadapter";
44
import { ThreadEvent } from "vscode-debugadapter";
55
import { DebugProtocol } from "vscode-debugprotocol";
6-
import { readFileSync } from "fs";
7-
import { basename } from "path";
86
import * as path from "path";
9-
import * as os from "os";
107
import * as fs from "fs";
11-
import * as child_process from "child_process";
12-
import * as StringDecoder from "string_decoder";
13-
import * as net from "net";
148
import { PythonProcess } from "./PythonProcess";
15-
import { FrameKind, IPythonProcess, IPythonThread, IPythonModule, IPythonEvaluationResult, IPythonStackFrame, IDebugServer } from "./Common/Contracts";
9+
import { IPythonThread, IPythonModule, IPythonEvaluationResult, IPythonStackFrame, IDebugServer } from "./Common/Contracts";
1610
import { IPythonBreakpoint, PythonBreakpointConditionKind, PythonBreakpointPassCountKind, IPythonException, PythonEvaluationResultReprKind, enum_EXCEPTION_STATE } from "./Common/Contracts";
1711
import { BaseDebugServer } from "./DebugServers/BaseDebugServer";
18-
import { DebugClient, DebugType } from "./DebugClients/DebugClient";
12+
import { DebugClient } from "./DebugClients/DebugClient";
1913
import { CreateAttachDebugClient, CreateLaunchDebugClient } from "./DebugClients/DebugFactory";
20-
import { DjangoApp, LaunchRequestArguments, AttachRequestArguments, DebugFlags, DebugOptions, TelemetryEvent, PythonEvaluationResultFlags } from "./Common/Contracts";
14+
import { LaunchRequestArguments, AttachRequestArguments, DebugOptions, TelemetryEvent, PythonEvaluationResultFlags } from "./Common/Contracts";
2115
import * as telemetryContracts from "../common/telemetryContracts";
22-
import { validatePath, validatePathSync, getPythonExecutable } from './Common/Utils';
16+
import { validatePath, getPythonExecutable } from './Common/Utils';
2317
import { isNotInstalledError } from '../common/helpers';
2418

2519
const CHILD_ENUMEARATION_TIMEOUT = 5000;
@@ -347,11 +341,10 @@ export class PythonDebugger extends DebugSession {
347341
}
348342

349343
let breakpoints: { verified: boolean, line: number }[] = [];
350-
let breakpointsToRemove = [];
351344
let linesToAdd = args.breakpoints.map(b => b.line);
352345
let registeredBks = this.registeredBreakpointsByFileName.get(args.source.path);
353346
let linesToRemove = registeredBks.map(b => b.LineNo).filter(oldLine => linesToAdd.indexOf(oldLine) === -1);
354-
let linesToUpdate = registeredBks.map(b => b.LineNo).filter(oldLine => linesToAdd.indexOf(oldLine) >= 0);
347+
// let linesToUpdate = registeredBks.map(b => b.LineNo).filter(oldLine => linesToAdd.indexOf(oldLine) >= 0);
355348

356349
// Always add new breakpoints, don't re-enable previous breakpoints
357350
// Cuz sometimes some breakpoints get added too early (e.g. in django) and don't get registeredBks

src/client/providers/jediProxy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function spawnProcess(dir: string) {
340340
break;
341341
}
342342
case CommandType.Hover: {
343-
var defs = <any[]>response['results'];
343+
let defs = <any[]>response['results'];
344344
var defResult: IHoverResult = {
345345
requestId: cmd.id,
346346
items: defs.map(def => {
@@ -358,7 +358,7 @@ function spawnProcess(dir: string) {
358358
break;
359359
}
360360
case CommandType.Symbols: {
361-
var defs = <any[]>response['results'];
361+
let defs = <any[]>response['results'];
362362
defs = Array.isArray(defs) ? defs : [];
363363
var defResults: ISymbolResult = {
364364
requestId: cmd.id,
@@ -441,7 +441,7 @@ function sendCommand<T extends ICommandResult>(cmd: ICommand<T>): Promise<T> {
441441
}
442442
var executionCmd = <IExecutionCommand<T>>cmd;
443443
var payload = createPayload(executionCmd);
444-
executionCmd.deferred = createDeferred<ICommandResult>();
444+
executionCmd.deferred = createDeferred<T>();
445445
// if (typeof executionCmd.telemetryEvent === 'string') {
446446
// executionCmd.delays = new telemetryHelper.Delays();
447447
// }

src/client/providers/renameProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class PythonRenameProvider implements vscode.RenameProvider {
4646
}).catch(reason => {
4747
vscode.window.showErrorMessage(reason);
4848
this.outputChannel.appendLine(reason);
49-
return;
49+
return Promise.reject(reason);
5050
});
5151
}
5252
}

src/client/unittests/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { TestResultDisplay } from './display/main';
1111
import { TestDisplay } from './display/picker';
1212
import * as constants from '../common/constants';
1313
import { activateCodeLenses } from './codeLenses/main';
14-
import { displayTestFrameworkError, displayPromptToEnableTests } from './configuration';
14+
import { displayTestFrameworkError } from './configuration';
1515

1616
const settings = PythonSettings.getInstance();
1717
let testManager: BaseTestManager;
@@ -155,7 +155,7 @@ function runCurrentTestFile() {
155155
testManager.discoverTests(true, true).then(() => {
156156
const tests = getDiscoveredTests();
157157
const testFiles = tests.testFiles.filter(testFile => {
158-
return testFile.fullPath == currentFilePath;
158+
return testFile.fullPath === currentFilePath;
159159
});
160160
if (testFiles.length < 1) {
161161
return;
@@ -270,7 +270,7 @@ function isFlattenedTestFunction(arg: any): arg is FlattenedTestFunction {
270270
return arg && arg.testFunction && typeof arg.xmlClassName === 'string' &&
271271
arg.parentTestFile && typeof arg.testFunction.name === 'string';
272272
}
273-
function identifyTestType(rootDirectory: string, arg?: vscode.Uri | TestsToRun | boolean | FlattenedTestFunction): TestsToRun | Boolean {
273+
function identifyTestType(rootDirectory: string, arg?: vscode.Uri | TestsToRun | boolean | FlattenedTestFunction): TestsToRun | boolean {
274274
if (typeof arg === 'boolean') {
275275
return arg === true;
276276
}

src/test/extension.refactor.extract.method.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as assert from 'assert';
55
// You can import and use all API from the \'vscode\' module
66
// as well as import your extension to test it
77
import * as vscode from 'vscode';
8-
import { TextDocument, TextLine, Position, Range } from 'vscode';
8+
import { TextLine, Position, Range } from 'vscode';
99
import * as path from 'path';
1010
import * as settings from '../client/common/configSettings';
1111
import * as fs from 'fs-extra';
@@ -110,7 +110,7 @@ suite('Method Extraction', () => {
110110
}
111111
fs.copySync(refactorSourceFile, refactorTargetFile, { clobber: true });
112112
closeActiveWindows().then(() => {
113-
vscode.commands.executeCommand = (cmd) => Promise.resolve();
113+
(<any>vscode).commands.executeCommand = (cmd) => Promise.resolve();
114114
done();
115115
}).catch(done);
116116
});

src/test/extension.refactor.extract.var.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as assert from 'assert';
66
// You can import and use all API from the \'vscode\' module
77
// as well as import your extension to test it
88
import * as vscode from 'vscode';
9-
import { TextDocument, TextLine, Position, Range } from 'vscode';
9+
import { TextLine, Position, Range } from 'vscode';
1010
import * as path from 'path';
1111
import * as settings from '../client/common/configSettings';
1212
import * as fs from 'fs-extra';
@@ -110,7 +110,7 @@ suite('Variable Extraction', () => {
110110
}
111111
fs.copySync(refactorSourceFile, refactorTargetFile, { clobber: true });
112112
closeActiveWindows().then(() => {
113-
vscode.commands.executeCommand = (cmd) => Promise.resolve();
113+
(<any>vscode).commands.executeCommand = (cmd) => Promise.resolve();
114114
done();
115115
}).catch(done);
116116
});

0 commit comments

Comments
 (0)