@@ -5,11 +5,7 @@ import {
55 postConstruct ,
66} from '@theia/core/shared/inversify' ;
77import * as React from '@theia/core/shared/react' ;
8- import {
9- BoardsService ,
10- LibraryService ,
11- SketchesService ,
12- } from '../common/protocol' ;
8+ import { SketchesService } from '../common/protocol' ;
139import {
1410 MAIN_MENU_BAR ,
1511 MenuContribution ,
@@ -19,7 +15,6 @@ import {
1915 Dialog ,
2016 FrontendApplication ,
2117 FrontendApplicationContribution ,
22- LocalStorageService ,
2318 OnWillStopAction ,
2419} from '@theia/core/lib/browser' ;
2520import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution' ;
@@ -52,8 +47,6 @@ import { MonitorViewContribution } from './serial/monitor/monitor-view-contribut
5247import { ArduinoToolbar } from './toolbar/arduino-toolbar' ;
5348import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state' ;
5449
55- const INIT_LIBS_AND_PACKAGES = 'initializedLibsAndPackages' ;
56-
5750@injectable ( )
5851export class ArduinoFrontendContribution
5952 implements
@@ -66,12 +59,6 @@ export class ArduinoFrontendContribution
6659 @inject ( MessageService )
6760 private readonly messageService : MessageService ;
6861
69- @inject ( BoardsService )
70- private readonly boardsService : BoardsService ;
71-
72- @inject ( LibraryService )
73- private readonly libraryService : LibraryService ;
74-
7562 @inject ( BoardsServiceProvider )
7663 private readonly boardsServiceProvider : BoardsServiceProvider ;
7764
@@ -87,35 +74,11 @@ export class ArduinoFrontendContribution
8774 @inject ( SketchesServiceClientImpl )
8875 private readonly sketchServiceClient : SketchesServiceClientImpl ;
8976
90- @inject ( LocalStorageService )
91- private readonly localStorageService : LocalStorageService ;
92-
9377 @inject ( FrontendApplicationStateService )
9478 private readonly appStateService : FrontendApplicationStateService ;
9579
9680 @postConstruct ( )
9781 protected async init ( ) : Promise < void > {
98- const isFirstStartup = ! ( await this . localStorageService . getData (
99- INIT_LIBS_AND_PACKAGES
100- ) ) ;
101- if ( isFirstStartup ) {
102- await this . localStorageService . setData ( INIT_LIBS_AND_PACKAGES , true ) ;
103- const avrPackage = await this . boardsService . getBoardPackage ( {
104- id : 'arduino:avr' ,
105- } ) ;
106- const builtInLibrary = (
107- await this . libraryService . search ( {
108- query : 'Arduino_BuiltIn' ,
109- } )
110- ) [ 0 ] ;
111-
112- ! ! avrPackage && ( await this . boardsService . install ( { item : avrPackage } ) ) ;
113- ! ! builtInLibrary &&
114- ( await this . libraryService . install ( {
115- item : builtInLibrary ,
116- installDependencies : true ,
117- } ) ) ;
118- }
11982 if ( ! window . navigator . onLine ) {
12083 // tslint:disable-next-line:max-line-length
12184 this . messageService . warn (
0 commit comments