Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Commit ba4d17a

Browse files
fix tslint errors
1 parent 8bfbbf3 commit ba4d17a

File tree

3 files changed

+27
-19
lines changed

3 files changed

+27
-19
lines changed

src/serialmonitor/outputBuffer.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

4-
import * as vscode from "vscode";
54
import { performance } from "perf_hooks";
5+
import * as vscode from "vscode";
66

77
export class BufferedOutputChannel implements vscode.Disposable {
88
private _buffer: string[];
9-
private timer: NodeJS.Timer;
9+
private timer: NodeJS.Timer;
1010
private _lastFlushTime: number;
1111

1212
public constructor(private outputCallback: (value: string) => void, private flushIntervalMs: number) {
@@ -15,29 +15,29 @@ export class BufferedOutputChannel implements vscode.Disposable {
1515
this._lastFlushTime = Number.NEGATIVE_INFINITY;
1616
}
1717

18+
public append(value: string) {
19+
this.add(value);
20+
}
21+
22+
public appendLine(value: string) {
23+
this.add(value + "\n");
24+
}
25+
26+
public dispose() {
27+
clearInterval(this.timer);
28+
}
29+
1830
private add(value: string) {
1931
this._buffer.push(value);
2032
this.tryFlush();
2133
}
2234

2335
private tryFlush() {
2436
const currentTime = performance.now();
25-
if (this._buffer.length > 0 && currentTime-this._lastFlushTime > this.flushIntervalMs) {
26-
this.outputCallback(this._buffer.join(''));
37+
if (this._buffer.length > 0 && currentTime - this._lastFlushTime > this.flushIntervalMs) {
38+
this.outputCallback(this._buffer.join(""));
2739
this._lastFlushTime = currentTime;
2840
this._buffer = [];
2941
}
3042
}
31-
32-
public append(value: string) {
33-
this.add(value);
34-
}
35-
36-
public appendLine(value: string) {
37-
this.add(value + '\n');
38-
}
39-
40-
dispose() {
41-
clearInterval(this.timer);
42-
}
43-
}
43+
}

src/serialmonitor/serialMonitor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ export class SerialMonitor implements vscode.Disposable {
151151
return;
152152
}
153153
} else {
154-
this._serialPortCtrl = new SerialPortCtrl(this._currentPort, this._currentBaudRate, this._bufferedOutputChannel, this._outputChannel.show);
154+
this._serialPortCtrl = new SerialPortCtrl(
155+
this._currentPort,
156+
this._currentBaudRate,
157+
this._bufferedOutputChannel,
158+
this._outputChannel.show);
155159
}
156160

157161
if (!this._serialPortCtrl.currentPort) {

src/serialmonitor/serialportctrl.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ export class SerialPortCtrl {
6363
private _currentBaudRate: number;
6464
private _currentSerialPort = null;
6565

66-
public constructor(port: string, baudRate: number, private _bufferedOutputChannel: BufferedOutputChannel, private showOutputChannel: (preserveFocus?: boolean) => void) {
66+
public constructor(
67+
port: string,
68+
baudRate: number,
69+
private _bufferedOutputChannel: BufferedOutputChannel,
70+
private showOutputChannel: (preserveFocus?: boolean) => void) {
6771
this._currentBaudRate = baudRate;
6872
this._currentPort = port;
6973
}

0 commit comments

Comments
 (0)