Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b3b731a

Browse filesBrowse files
author
Akos Kitta
committed
fix(regression): restore the Unknown board label
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent 530cddb commit b3b731a
Copy full SHA for b3b731a

File tree

Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-2
lines changed

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

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/common/protocol/board-list.ts
+2-2Lines changed: 2 additions & 2 deletions
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

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/test/common/board-list.test.ts
+6Lines changed: 6 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.