1
1
import { inject , injectable } from '@theia/core/shared/inversify' ;
2
- import { Event , Emitter } from '@theia/core/lib/common/event' ;
3
- import { HostedPluginSupport } from '@theia/plugin-ext/lib/hosted/browser/hosted-plugin' ;
4
- import { ArduinoToolbar } from '../toolbar/arduino-toolbar' ;
5
- import { NotificationCenter } from '../notification-center' ;
6
2
import {
7
3
Board ,
8
4
BoardIdentifier ,
@@ -12,6 +8,11 @@ import {
12
8
Sketch ,
13
9
} from '../../common/protocol' ;
14
10
import { BoardsServiceProvider } from '../boards/boards-service-provider' ;
11
+ import { HostedPluginSupport } from '../hosted/hosted-plugin-support' ;
12
+ import { ArduinoMenus } from '../menu/arduino-menus' ;
13
+ import { NotificationCenter } from '../notification-center' ;
14
+ import { CurrentSketch } from '../sketches-service-client-impl' ;
15
+ import { ArduinoToolbar } from '../toolbar/arduino-toolbar' ;
15
16
import {
16
17
URI ,
17
18
Command ,
@@ -97,6 +98,22 @@ export class Debug extends SketchContribution {
97
98
} ) ;
98
99
this . notificationCenter . onPlatformDidInstall ( ( ) => this . refreshState ( ) ) ;
99
100
this . notificationCenter . onPlatformDidUninstall ( ( ) => this . refreshState ( ) ) ;
101
+ this . boardsDataStore . onDidChange ( ( event ) => {
102
+ const selectedFqbn =
103
+ this . boardsServiceProvider . boardsConfig . selectedBoard ?. fqbn ;
104
+ if ( event . changes . find ( ( change ) => change . fqbn === selectedFqbn ) ) {
105
+ this . refreshState ( ) ;
106
+ }
107
+ } ) ;
108
+ this . commandService . onDidExecuteCommand ( ( event ) => {
109
+ const { commandId, args } = event ;
110
+ if (
111
+ commandId === 'arduino.languageserver.notifyBuildDidComplete' &&
112
+ isCompileSummary ( args [ 0 ] )
113
+ ) {
114
+ this . refreshState ( ) ;
115
+ }
116
+ } ) ;
100
117
}
101
118
102
119
override onReady ( ) : void {
0 commit comments