Skip to content

Commit 3c7bb77

Browse files
Fixes for strict mode. (#4867)
(for #611)
1 parent b692f0a commit 3c7bb77

126 files changed

Lines changed: 485 additions & 519 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/client/activation/jedi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class JediExtensionActivator implements ILanguageServerActivator {
3333
this.documentSelector = PYTHON;
3434
}
3535

36-
public async activate(resource: Resource): Promise<void> {
36+
public async activate(_resource: Resource): Promise<void> {
3737
if (this.jediFactory) {
3838
throw new Error('Jedi already started');
3939
}

src/client/common/application/webPanel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class WebPanel implements IWebPanel {
9292
this.listener.onMessage(message.type, message.payload);
9393
}));
9494

95-
this.disposableRegistry.push(this.panel.onDidChangeViewState((e) => {
95+
this.disposableRegistry.push(this.panel.onDidChangeViewState((_e) => {
9696
// Pass the state change onto our listener
9797
this.listener.onChangeViewState(this);
9898
}));

src/client/common/utils/decorators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function debounce(wait?: number) {
2424
// If running tests, lets not debounce (so tests run fast).
2525
wait = wait && isTestExecution() ? undefined : wait;
2626
// tslint:disable-next-line:no-invalid-this no-any
27-
(descriptor as any).value = _debounce(function () { return originalMethod.apply(this, arguments as any); }, wait);
27+
(descriptor as any).value = _debounce(function (this: any) { return originalMethod.apply(this, arguments as any); }, wait);
2828
};
2929
}
3030

src/client/common/variables/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function parseEnvFile(
6969
): EnvironmentVariables {
7070
const globalVars = baseVars ? baseVars : {};
7171
const vars : EnvironmentVariables = {};
72-
lines.toString().split('\n').forEach((line, idx) => {
72+
lines.toString().split('\n').forEach((line, _idx) => {
7373
const [name, value] = parseEnvLine(line);
7474
if (name === '') {
7575
return;

src/client/datascience/cellFactory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function generateCells(settings: IDataScienceSettings | undefined, code:
5454
// We have at least one markdown. We might have to split it if there any lines that don't begin
5555
// with # or are inside a multiline comment
5656
let firstNonMarkdown = -1;
57-
parseForComments(split, (s, i) => noop(), (s, i) => {
57+
parseForComments(split, (_s, _i) => noop(), (s, i) => {
5858
// Make sure there's actually some code.
5959
if (s && s.length > 0) {
6060
firstNonMarkdown = splitMarkdown ? i : -1;

src/client/datascience/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export function parseForComments(
109109

110110
function extractComments(lines: string[]): string[] {
111111
const result: string[] = [];
112-
parseForComments(lines, (s) => result.push(s), (s) => noop());
112+
parseForComments(lines, (s) => result.push(s), (_s) => noop());
113113
return result;
114114
}
115115

116116
function extractNonComments(lines: string[]): string[] {
117117
const result: string[] = [];
118-
parseForComments(lines, (s) => noop, (s) => result.push(s));
118+
parseForComments(lines, (_s) => noop, (s) => result.push(s));
119119
return result;
120120
}

src/client/datascience/data-viewing/dataExplorer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class DataExplorer implements IDataExplorer, IAsyncDisposable {
5353
return this.loadPromise;
5454
}
5555

56-
public async show(rows: IDataExplorerRow[]): Promise<void> {
56+
public async show(_rows: IDataExplorerRow[]): Promise<void> {
5757
if (!this.disposed) {
5858
// Make sure we're loaded first
5959
await this.loadPromise;
@@ -93,7 +93,7 @@ export class DataExplorer implements IDataExplorer, IAsyncDisposable {
9393
}
9494

9595
// tslint:disable-next-line: no-any no-empty
96-
private onMessage = (message: string, payload: any) => {
96+
private onMessage = (message: string, _payload: any) => {
9797
switch (message) {
9898
case DataExplorerMessages.Started:
9999
this.webPanelRendered();

src/client/datascience/history/history.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ import * as localize from '../../common/utils/localize';
3030
import { IInterpreterService, PythonInterpreter } from '../../interpreter/contracts';
3131
import { captureTelemetry, sendTelemetryEvent } from '../../telemetry';
3232
import { EditorContexts, Identifiers, Telemetry } from '../constants';
33-
import { HistoryMessageListener } from './historyMessageListener';
34-
import { HistoryMessages, IAddedSysInfo, IGotoCode, IHistoryMapping, IRemoteAddCode, ISubmitNewCell } from './historyTypes';
3533
import { JupyterInstallError } from '../jupyter/jupyterInstallError';
3634
import {
3735
CellState,
3836
ICell,
3937
ICodeCssGenerator,
4038
IConnection,
39+
IDataExplorerProvider,
4140
IDataScienceExtraSettings,
4241
IHistory,
4342
IHistoryInfo,
@@ -46,9 +45,10 @@ import {
4645
INotebookExporter,
4746
INotebookServer,
4847
InterruptResult,
49-
IStatusProvider,
50-
IDataExplorerProvider
48+
IStatusProvider
5149
} from '../types';
50+
import { HistoryMessageListener } from './historyMessageListener';
51+
import { HistoryMessages, IAddedSysInfo, IGotoCode, IHistoryMapping, IRemoteAddCode, ISubmitNewCell } from './historyTypes';
5252

5353
export enum SysInfoReason {
5454
Start,
@@ -238,7 +238,8 @@ export class History implements IHistory {
238238
break;
239239

240240
case HistoryMessages.ShowDataExplorer:
241-
this.showDataExplorer();
241+
this.showDataExplorer()
242+
.ignoreErrors();
242243
break;
243244

244245
default:
@@ -394,7 +395,7 @@ export class History implements IHistory {
394395
}
395396

396397
// tslint:disable-next-line:no-any
397-
private dispatchMessage<M extends IHistoryMapping, T extends keyof M>(message: T, payload: any, handler: (args : M[T]) => void) {
398+
private dispatchMessage<M extends IHistoryMapping, T extends keyof M>(_message: T, payload: any, handler: (args : M[T]) => void) {
398399
const args = payload as M[T];
399400
handler.bind(this)(args);
400401
}
@@ -492,7 +493,7 @@ export class History implements IHistory {
492493
}
493494
}
494495

495-
private async submitCode(code: string, file: string, line: number, id?: string, editor?: TextEditor) : Promise<void> {
496+
private async submitCode(code: string, file: string, line: number, id?: string, _editor?: TextEditor) : Promise<void> {
496497
this.logger.logInformation(`Submitting code for ${this.id}`);
497498

498499
// Start a status item
@@ -763,7 +764,7 @@ export class History implements IHistory {
763764
}
764765
}
765766

766-
private async loadJupyterServer(restart?: boolean): Promise<void> {
767+
private async loadJupyterServer(_restart?: boolean): Promise<void> {
767768
this.logger.logInformation('Getting jupyter server options ...');
768769

769770
// Extract our options

src/client/datascience/history/historyMessageListener.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import * as vsls from 'vsls/vscode';
88

99
import { ILiveShareApi, IWebPanel, IWebPanelMessageListener } from '../../common/application/types';
1010
import { Identifiers, LiveShare } from '../constants';
11-
import { HistoryMessages, HistoryRemoteMessages } from './historyTypes';
1211
import { PostOffice } from '../liveshare/postOffice';
12+
import { HistoryMessages, HistoryRemoteMessages } from './historyTypes';
1313

1414
// tslint:disable:no-any
1515

@@ -22,7 +22,7 @@ export class HistoryMessageListener implements IWebPanelMessageListener {
2222
private historyMessages : string[] = [];
2323

2424
constructor(liveShare: ILiveShareApi, callback: (message: string, payload: any) => void, viewChanged: (panel: IWebPanel) => void, disposed: () => void) {
25-
this.postOffice = new PostOffice(LiveShare.WebPanelMessageService, liveShare, (api, command, role, args) => this.translateHostArgs(api, role, args));
25+
this.postOffice = new PostOffice(LiveShare.WebPanelMessageService, liveShare, (api, _command, role, args) => this.translateHostArgs(api, role, args));
2626

2727
// Save our dispose callback so we remove our history window
2828
this.disposedCallback = disposed;

src/client/datascience/history/historycommandlistener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class HistoryCommandListener implements IDataScienceCommandListener {
7676
});
7777
});
7878
this.disposableRegistry.push(disposable);
79-
disposable = commandManager.registerCommand(Commands.ExportFileAndOutputAsNotebook, (file: Uri, cmdSource: CommandSource = CommandSource.commandPalette) => {
79+
disposable = commandManager.registerCommand(Commands.ExportFileAndOutputAsNotebook, (file: Uri, _cmdSource: CommandSource = CommandSource.commandPalette) => {
8080
return this.listenForErrors(() => {
8181
if (file && file.fsPath) {
8282
return this.exportFileAndOutput(file.fsPath);

0 commit comments

Comments
 (0)