-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy pathcore-service-client-impl.ts
36 lines (27 loc) · 1.09 KB
/
core-service-client-impl.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { injectable, inject } from 'inversify';
import { Emitter, Event } from '@theia/core/lib/common/event';
import { ILogger } from '@theia/core/lib/common/logger';
import { MessageService } from '@theia/core/lib/common/message-service';
import { LocalStorageService } from '@theia/core/lib/browser/storage-service';
import { CoreServiceClient } from '../common/protocol';
@injectable()
export class CoreServiceClientImpl implements CoreServiceClient {
@inject(ILogger)
protected logger: ILogger;
@inject(MessageService)
protected messageService: MessageService;
@inject(LocalStorageService)
protected storageService: LocalStorageService;
protected readonly onIndexUpdatedEmitter = new Emitter<void>();
notifyIndexUpdated(): void {
this.info('Index has been updated.');
this.onIndexUpdatedEmitter.fire();
}
get onIndexUpdated(): Event<void> {
return this.onIndexUpdatedEmitter.event;
}
protected info(message: string): void {
this.messageService.info(message, { timeout: 3000 });
this.logger.info(message);
}
}