@@ -2,7 +2,6 @@ import PQueue from 'p-queue';
22import { inject , injectable } from '@theia/core/shared/inversify' ;
33import URI from '@theia/core/lib/common/uri' ;
44import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor' ;
5- import { EditorManager } from '@theia/editor/lib/browser' ;
65import { MenuModelRegistry , MenuPath } from '@theia/core/lib/common/menu' ;
76import {
87 Disposable ,
@@ -22,28 +21,25 @@ import { CurrentSketch } from '../sketches-service-client-impl';
2221@injectable ( )
2322export class IncludeLibrary extends SketchContribution {
2423 @inject ( CommandRegistry )
25- protected readonly commandRegistry : CommandRegistry ;
24+ private readonly commandRegistry : CommandRegistry ;
2625
2726 @inject ( MenuModelRegistry )
28- protected readonly menuRegistry : MenuModelRegistry ;
27+ private readonly menuRegistry : MenuModelRegistry ;
2928
3029 @inject ( MainMenuManager )
31- protected readonly mainMenuManager : MainMenuManager ;
32-
33- @inject ( EditorManager )
34- protected override readonly editorManager : EditorManager ;
30+ private readonly mainMenuManager : MainMenuManager ;
3531
3632 @inject ( NotificationCenter )
37- protected readonly notificationCenter : NotificationCenter ;
33+ private readonly notificationCenter : NotificationCenter ;
3834
3935 @inject ( BoardsServiceProvider )
40- protected readonly boardsServiceProvider : BoardsServiceProvider ;
36+ private readonly boardsServiceProvider : BoardsServiceProvider ;
4137
4238 @inject ( LibraryService )
43- protected readonly libraryService : LibraryService ;
39+ private readonly libraryService : LibraryService ;
4440
45- protected readonly queue = new PQueue ( { autoStart : true , concurrency : 1 } ) ;
46- protected readonly toDispose = new DisposableCollection ( ) ;
41+ private readonly queue = new PQueue ( { autoStart : true , concurrency : 1 } ) ;
42+ private readonly toDispose = new DisposableCollection ( ) ;
4743
4844 override onStart ( ) : void {
4945 this . boardsServiceProvider . onBoardsConfigDidChange ( ( ) =>
@@ -56,8 +52,8 @@ export class IncludeLibrary extends SketchContribution {
5652 this . notificationCenter . onDidReinitialize ( ( ) => this . updateMenuActions ( ) ) ;
5753 }
5854
59- override async onReady ( ) : Promise < void > {
60- this . updateMenuActions ( ) ;
55+ override onReady ( ) : void {
56+ this . boardsServiceProvider . ready . then ( ( ) => this . updateMenuActions ( ) ) ;
6157 }
6258
6359 override registerMenus ( registry : MenuModelRegistry ) : void {
@@ -93,7 +89,7 @@ export class IncludeLibrary extends SketchContribution {
9389 } ) ;
9490 }
9591
96- protected async updateMenuActions ( ) : Promise < void > {
92+ private async updateMenuActions ( ) : Promise < void > {
9793 return this . queue . add ( async ( ) => {
9894 this . toDispose . dispose ( ) ;
9995 this . mainMenuManager . update ( ) ;
@@ -139,7 +135,7 @@ export class IncludeLibrary extends SketchContribution {
139135 } ) ;
140136 }
141137
142- protected registerLibrary (
138+ private registerLibrary (
143139 libraryOrPlaceholder : LibraryPackage | string ,
144140 menuPath : MenuPath
145141 ) : Disposable {
@@ -172,7 +168,7 @@ export class IncludeLibrary extends SketchContribution {
172168 ) ;
173169 }
174170
175- protected async includeLibrary ( library : LibraryPackage ) : Promise < void > {
171+ private async includeLibrary ( library : LibraryPackage ) : Promise < void > {
176172 const sketch = await this . sketchServiceClient . currentSketch ( ) ;
177173 if ( ! CurrentSketch . isValid ( sketch ) ) {
178174 return ;
0 commit comments