Skip to content

Commit b3b731a

Browse files
author
Akos Kitta
committed
fix(regression): restore the Unknown board label
Signed-off-by: Akos Kitta <[email protected]>
1 parent 530cddb commit b3b731a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

arduino-ide-extension/src/common/protocol/board-list.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Mutable } from '@theia/core/lib/common/types';
2+
import { Unknown } from '../nls';
23
import type { Defined } from '../types';
34
import { naturalCompare } from '../utils';
45
import {
@@ -18,7 +19,6 @@ import {
1819
portProtocolComparator,
1920
selectBoard,
2021
unconfirmedBoard,
21-
unknownBoard,
2222
notConnected,
2323
boardIdentifierLabel,
2424
} from './boards-service';
@@ -326,7 +326,7 @@ function createBoardListItemLabels(item: BoardListItem): BoardListItemLabels {
326326
unconfirmedBoard;
327327
board = { name, fqbn: undefined };
328328
}
329-
const boardLabel = board?.name ?? unknownBoard;
329+
const boardLabel = board?.name ?? Unknown;
330330
let boardLabelWithFqbn = boardLabel;
331331
if (board?.fqbn) {
332332
boardLabelWithFqbn += ` (${board.fqbn})`;

arduino-ide-extension/src/test/common/board-list.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect } from 'chai';
2+
import { Unknown } from '../../common/nls';
23
import {
34
BoardListLabels,
45
createBoardList,
@@ -322,6 +323,11 @@ describe('board-list', () => {
322323
expect(inferredBoard?.board).to.be.deep.equal(uno);
323324
});
324325

326+
it(`should use the '${Unknown}' as the board label when no boards were discovered on a detected port`, () => {
327+
const { items } = createBoardList({ ...detectedPort(unoSerialPort) });
328+
expect(items[0].labels.boardLabel).to.be.equal(Unknown);
329+
});
330+
325331
describe('defaultAction', () => {
326332
it("'select' should be the default action for identifier boards", () => {
327333
const { items } = createBoardList({

0 commit comments

Comments
 (0)