@@ -2,7 +2,6 @@ import PQueue from 'p-queue';
2
2
import { inject , injectable } from '@theia/core/shared/inversify' ;
3
3
import URI from '@theia/core/lib/common/uri' ;
4
4
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor' ;
5
- import { EditorManager } from '@theia/editor/lib/browser' ;
6
5
import { MenuModelRegistry , MenuPath } from '@theia/core/lib/common/menu' ;
7
6
import {
8
7
Disposable ,
@@ -22,28 +21,25 @@ import { CurrentSketch } from '../sketches-service-client-impl';
22
21
@injectable ( )
23
22
export class IncludeLibrary extends SketchContribution {
24
23
@inject ( CommandRegistry )
25
- protected readonly commandRegistry : CommandRegistry ;
24
+ private readonly commandRegistry : CommandRegistry ;
26
25
27
26
@inject ( MenuModelRegistry )
28
- protected readonly menuRegistry : MenuModelRegistry ;
27
+ private readonly menuRegistry : MenuModelRegistry ;
29
28
30
29
@inject ( MainMenuManager )
31
- protected readonly mainMenuManager : MainMenuManager ;
32
-
33
- @inject ( EditorManager )
34
- protected override readonly editorManager : EditorManager ;
30
+ private readonly mainMenuManager : MainMenuManager ;
35
31
36
32
@inject ( NotificationCenter )
37
- protected readonly notificationCenter : NotificationCenter ;
33
+ private readonly notificationCenter : NotificationCenter ;
38
34
39
35
@inject ( BoardsServiceProvider )
40
- protected readonly boardsServiceProvider : BoardsServiceProvider ;
36
+ private readonly boardsServiceProvider : BoardsServiceProvider ;
41
37
42
38
@inject ( LibraryService )
43
- protected readonly libraryService : LibraryService ;
39
+ private readonly libraryService : LibraryService ;
44
40
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 ( ) ;
47
43
48
44
override onStart ( ) : void {
49
45
this . boardsServiceProvider . onBoardsConfigDidChange ( ( ) =>
@@ -56,8 +52,8 @@ export class IncludeLibrary extends SketchContribution {
56
52
this . notificationCenter . onDidReinitialize ( ( ) => this . updateMenuActions ( ) ) ;
57
53
}
58
54
59
- override async onReady ( ) : Promise < void > {
60
- this . updateMenuActions ( ) ;
55
+ override onReady ( ) : void {
56
+ this . boardsServiceProvider . ready . then ( ( ) => this . updateMenuActions ( ) ) ;
61
57
}
62
58
63
59
override registerMenus ( registry : MenuModelRegistry ) : void {
@@ -93,7 +89,7 @@ export class IncludeLibrary extends SketchContribution {
93
89
} ) ;
94
90
}
95
91
96
- protected async updateMenuActions ( ) : Promise < void > {
92
+ private async updateMenuActions ( ) : Promise < void > {
97
93
return this . queue . add ( async ( ) => {
98
94
this . toDispose . dispose ( ) ;
99
95
this . mainMenuManager . update ( ) ;
@@ -139,7 +135,7 @@ export class IncludeLibrary extends SketchContribution {
139
135
} ) ;
140
136
}
141
137
142
- protected registerLibrary (
138
+ private registerLibrary (
143
139
libraryOrPlaceholder : LibraryPackage | string ,
144
140
menuPath : MenuPath
145
141
) : Disposable {
@@ -172,7 +168,7 @@ export class IncludeLibrary extends SketchContribution {
172
168
) ;
173
169
}
174
170
175
- protected async includeLibrary ( library : LibraryPackage ) : Promise < void > {
171
+ private async includeLibrary ( library : LibraryPackage ) : Promise < void > {
176
172
const sketch = await this . sketchServiceClient . currentSketch ( ) ;
177
173
if ( ! CurrentSketch . isValid ( sketch ) ) {
178
174
return ;
0 commit comments