@@ -11,6 +11,7 @@ import {
11
11
ContextMenuRenderer ,
12
12
FrontendApplication ,
13
13
FrontendApplicationContribution ,
14
+ LocalStorageService ,
14
15
OpenerService ,
15
16
StatusBar ,
16
17
StatusBarAlignment ,
@@ -79,6 +80,8 @@ import { FileChangeType } from '@theia/filesystem/lib/browser';
79
80
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
80
81
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution' ;
81
82
83
+ const INIT_AVR_PACKAGES = 'initializedAvrPackages' ;
84
+
82
85
@injectable ( )
83
86
export class ArduinoFrontendContribution
84
87
implements
@@ -199,13 +202,26 @@ export class ArduinoFrontendContribution
199
202
@inject ( FrontendApplicationStateService )
200
203
protected readonly appStateService : FrontendApplicationStateService ;
201
204
205
+ @inject ( LocalStorageService )
206
+ protected readonly localStorageService : LocalStorageService ;
207
+
202
208
protected invalidConfigPopup :
203
209
| Promise < void | 'No' | 'Yes' | undefined >
204
210
| undefined ;
205
211
protected toDisposeOnStop = new DisposableCollection ( ) ;
206
212
207
213
@postConstruct ( )
208
214
protected async init ( ) : Promise < void > {
215
+ const notFirstStartup = await this . localStorageService . getData (
216
+ INIT_AVR_PACKAGES
217
+ ) ;
218
+ if ( ! notFirstStartup ) {
219
+ await this . localStorageService . setData ( INIT_AVR_PACKAGES , true ) ;
220
+ const avrPackage = await this . boardsService . getBoardPackage ( {
221
+ id : 'arduino:avr' ,
222
+ } ) ;
223
+ avrPackage && ( await this . boardsService . install ( { item : avrPackage } ) ) ;
224
+ }
209
225
if ( ! window . navigator . onLine ) {
210
226
// tslint:disable-next-line:max-line-length
211
227
this . messageService . warn (
0 commit comments