Skip to content

Commit cc293bf

Browse files
committed
tslint
1 parent 6ed87f8 commit cc293bf

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

src/coreclr-debug/activate.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
'use strict';
66

77
import * as vscode from 'vscode';
8-
import * as child_process from 'child_process';
98
import * as fs from 'fs';
10-
import * as path from 'path';
119
import TelemetryReporter from 'vscode-extension-telemetry';
1210
import { CoreClrDebugUtil } from './util';
1311
import * as debugInstall from './install';
@@ -99,7 +97,7 @@ function checkForDotnetTools() : Promise<DotnetInfo>
9997
let dotnetInfo = new DotnetInfo();
10098

10199
return _util.spawnChildProcess('dotnet', ['--info'], _util.coreClrDebugDir(), (data: Buffer) => {
102-
var lines: string[] = data.toString().replace(/\r/mg, '').split('\n');
100+
let lines: string[] = data.toString().replace(/\r/mg, '').split('\n');
103101
lines.forEach(line => {
104102
let match: RegExpMatchArray;
105103
if (match = /^\ Version:\s*([^\s].*)$/.exec(line)) {

src/coreclr-debug/install.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import { CoreClrDebugUtil } from './util';
88
import * as fs from 'fs';
99
import * as path from 'path';
10-
import * as child_process from 'child_process';
1110
import * as fs_extra from 'fs-extra-promise';
1211

1312
export class InstallError extends Error {
@@ -53,22 +52,22 @@ export class DebugInstaller {
5352
}
5453

5554
public install(runtimeId: string): Promise<void> {
56-
var errorBuilder: InstallError = new InstallError();
55+
let errorBuilder: InstallError = new InstallError();
5756
errorBuilder.installStage = 'writeProjectJson';
5857

5958
return this.writeProjectJson(runtimeId).then(() => {
6059
errorBuilder.installStage = 'dotnetRestore';
6160
return this._util.spawnChildProcess('dotnet', ['--verbose', 'restore', '--configfile', 'NuGet.config'], this._util.coreClrDebugDir(),
6261
(data: Buffer) => {
63-
var text: string = data.toString();
62+
let text: string = data.toString();
6463
this._util.logRaw(text);
6564

6665
// Certain errors are only logged to stdout.
6766
// Detect these and make a note of the kind of error.
6867
DebugInstaller.parseRestoreErrors(text, errorBuilder);
6968
},
7069
(data: Buffer) => {
71-
var text: string = data.toString();
70+
let text: string = data.toString();
7271
this._util.logRaw(text);
7372

7473
// Reference errors are sent to stderr at the end of restore.
@@ -78,7 +77,7 @@ export class DebugInstaller {
7877
errorBuilder.installStage = 'dotnetPublish';
7978
return this._util.spawnChildProcess('dotnet', ['--verbose', 'publish', '-r', runtimeId, '-o', this._util.debugAdapterDir()], this._util.coreClrDebugDir(),
8079
(data: Buffer) => {
81-
var text: string = data.toString();
80+
let text: string = data.toString();
8281
this._util.logRaw(text);
8382

8483
DebugInstaller.parsePublishErrors(text, errorBuilder);
@@ -253,7 +252,7 @@ export class DebugInstaller {
253252
}
254253

255254
private static parseRestoreErrors(output: string, errorBuilder: InstallError): void {
256-
var lines: string[] = output.replace(/\r/mg, '').split('\n');
255+
let lines: string[] = output.replace(/\r/mg, '').split('\n');
257256
lines.forEach(line => {
258257
if (line.startsWith('error')) {
259258
const connectionError: string = 'The server name or address could not be resolved';
@@ -271,16 +270,16 @@ export class DebugInstaller {
271270

272271
private static parseReferenceErrors(output: string, errorBuilder: InstallError): void {
273272
// Reference errors are restated at the end of the output. Find this section first.
274-
var errorRegionRegExp: RegExp = /^Errors in .*project\.json$/gm
275-
var beginIndex: number = output.search(errorRegionRegExp);
276-
var errorBlock: string = output.slice(beginIndex);
273+
let errorRegionRegExp: RegExp = /^Errors in .*project\.json$/gm;
274+
let beginIndex: number = output.search(errorRegionRegExp);
275+
let errorBlock: string = output.slice(beginIndex);
277276

278-
var lines: string[] = errorBlock.replace(/\r/mg, '').split('\n');
277+
let lines: string[] = errorBlock.replace(/\r/mg, '').split('\n');
279278
lines.forEach(line => {
280-
var referenceRegExp: RegExp = /^(?:\t|\ \ \ \ )Unable to resolve '([^']+)'/g
281-
var match: RegExpMatchArray;
279+
let referenceRegExp: RegExp = /^(?:\t|\ \ \ \ )Unable to resolve '([^']+)'/g;
280+
let match: RegExpMatchArray;
282281
while (match = referenceRegExp.exec(line)) {
283-
var reference: string = match[1];
282+
let reference: string = match[1];
284283
if (reference.startsWith('Microsoft') ||
285284
reference.startsWith('System') ||
286285
reference.startsWith('NETStandard') ||
@@ -294,15 +293,15 @@ export class DebugInstaller {
294293
}
295294

296295
private static parsePublishErrors(output: string, errorBuilder: InstallError): void {
297-
var lines: string[] = output.replace(/\r/mg, '').split('\n');
296+
let lines: string[] = output.replace(/\r/mg, '').split('\n');
298297
lines.forEach(line => {
299-
var errorTypeRegExp: RegExp = /^([\w\.]+Exception)/g
300-
var typeMatch: RegExpMatchArray;
298+
const errorTypeRegExp: RegExp = /^([\w\.]+Exception)/g;
299+
let typeMatch: RegExpMatchArray;
301300
while (typeMatch = errorTypeRegExp.exec(line)) {
302-
var type: string = typeMatch[1];
301+
let type: string = typeMatch[1];
303302
if (type === 'System.IO.IOException') {
304-
var ioExceptionRegExp: RegExp = /System\.IO\.IOException: The process cannot access the file '(.*)' because it is being used by another process./g
305-
var ioMatch: RegExpMatchArray;
303+
const ioExceptionRegExp: RegExp = /System\.IO\.IOException: The process cannot access the file '(.*)' because it is being used by another process./g;
304+
let ioMatch: RegExpMatchArray;
306305
if (ioMatch = ioExceptionRegExp.exec(line)) {
307306
// Remove path as it may contain user information.
308307
errorBuilder.errorMessage = `System.IO.IOException: unable to access '${path.basename(ioMatch[1])}'`;

src/coreclr-debug/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class CoreClrDebugUtil
149149

150150
child.on('error', (error: Error) => {
151151
reject(error);
152-
})
152+
});
153153
});
154154

155155
return promise;

0 commit comments

Comments
 (0)