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

Commit 2b4ee8e

Browse files
Changed Serial.updatePortListStatus to make use of optional argument to eliminate updatePortListStatus(null) calls
1 parent ec9769c commit 2b4ee8e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/serialmonitor/serialMonitor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class SerialMonitor implements vscode.Disposable {
7373
this._baudRateStatusBar.command = "arduino.changeBaudRate";
7474
this._baudRateStatusBar.tooltip = "Baud Rate";
7575
this._baudRateStatusBar.text = defaultBaudRate.toString();
76-
this.updatePortListStatus(null);
76+
this.updatePortListStatus();
7777

7878
this._endingStatusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, constants.statusBarPriority.ENDING);
7979
this._ending = SerialMonitor.DEFAULT_ENDING;
@@ -83,7 +83,7 @@ export class SerialMonitor implements vscode.Disposable {
8383

8484
const dc = DeviceContext.getInstance();
8585
dc.onChangePort(() => {
86-
this.updatePortListStatus(null);
86+
this.updatePortListStatus();
8787
});
8888
}
8989
public get initialized(): boolean {
@@ -230,8 +230,7 @@ export class SerialMonitor implements vscode.Disposable {
230230
}
231231
}
232232

233-
// TODO EW: use default value for port function parameter and change all updatePortListStatus(null) calls accordingly
234-
private updatePortListStatus(port: string) {
233+
private updatePortListStatus(port?: string) {
235234
const dc = DeviceContext.getInstance();
236235
if (port) {
237236
dc.port = port;

0 commit comments

Comments
 (0)