@@ -20,6 +20,7 @@ import {
20
20
} from '../../common/protocol' ;
21
21
import type { BoardList } from '../../common/protocol/board-list' ;
22
22
import { BoardsListWidget } from '../boards/boards-list-widget' ;
23
+ import { BoardsDataStore } from '../boards/boards-data-store' ;
23
24
import { BoardsServiceProvider } from '../boards/boards-service-provider' ;
24
25
import {
25
26
ArduinoMenus ,
@@ -39,6 +40,8 @@ export class BoardSelection extends SketchContribution {
39
40
private readonly menuModelRegistry : MenuModelRegistry ;
40
41
@inject ( NotificationCenter )
41
42
private readonly notificationCenter : NotificationCenter ;
43
+ @inject ( BoardsDataStore )
44
+ private readonly boardsDataStore : BoardsDataStore ;
42
45
@inject ( BoardsService )
43
46
private readonly boardsService : BoardsService ;
44
47
@inject ( BoardsServiceProvider )
@@ -74,6 +77,14 @@ SN: ${SN}
74
77
} ) ;
75
78
} ,
76
79
} ) ;
80
+
81
+ registry . registerCommand ( BoardSelection . Commands . RELOAD_BOARD_DATA , {
82
+ execute : async ( ) => {
83
+ await this . boardsDataStore . reloadBoardData (
84
+ this . boardsServiceProvider . boardList . boardsConfig . selectedBoard ?. fqbn
85
+ ) ;
86
+ // TODO: show a notification
87
+ } ) ;
77
88
}
78
89
79
90
override onStart ( ) : void {
@@ -151,6 +162,21 @@ SN: ${SN}
151
162
)
152
163
) ;
153
164
165
+ const reloadBoardData = {
166
+ commandId : BoardSelection . Commands . RELOAD_BOARD_DATA . id ,
167
+ label : nls . localize ( 'arduino/board/reloadBoardData' , 'Reload board data' ) ,
168
+ order : '102' ,
169
+ } ;
170
+ this . menuModelRegistry . registerMenuAction (
171
+ ArduinoMenus . TOOLS__BOARD_SELECTION_GROUP ,
172
+ reloadBoardData
173
+ ) ;
174
+ this . toDisposeBeforeMenuRebuild . push (
175
+ Disposable . create ( ( ) =>
176
+ this . menuModelRegistry . unregisterMenuAction ( reloadBoardData )
177
+ )
178
+ ) ;
179
+
154
180
const getBoardInfo = {
155
181
commandId : BoardSelection . Commands . GET_BOARD_INFO . id ,
156
182
label : nls . localize ( 'arduino/board/getBoardInfo' , 'Get Board Info' ) ,
@@ -361,5 +387,8 @@ SN: ${SN}
361
387
export namespace BoardSelection {
362
388
export namespace Commands {
363
389
export const GET_BOARD_INFO : Command = { id : 'arduino-get-board-info' } ;
390
+ export const RELOAD_BOARD_DATA : Command = {
391
+ id : 'arduino-reload-board-data' ,
392
+ } ;
364
393
}
365
394
}
0 commit comments