1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.DispatchingProgressClient = void 0;
|
19 | const tslib_1 = require("tslib");
|
20 | const inversify_1 = require("inversify");
|
21 | const progress_status_bar_item_1 = require("./progress-status-bar-item");
|
22 | const progress_location_service_1 = require("./progress-location-service");
|
23 | let DispatchingProgressClient = class DispatchingProgressClient {
|
24 | showProgress(progressId, message, cancellationToken) {
|
25 | const locationId = this.getLocationId(message);
|
26 | if (locationId === 'window') {
|
27 | return this.statusBarItem.showProgress(progressId, message, cancellationToken);
|
28 | }
|
29 | return this.locationService.showProgress(progressId, message, cancellationToken);
|
30 | }
|
31 | reportProgress(progressId, update, message, cancellationToken) {
|
32 | const locationId = this.getLocationId(message);
|
33 | if (locationId === 'window') {
|
34 | return this.statusBarItem.reportProgress(progressId, update, message, cancellationToken);
|
35 | }
|
36 | return this.locationService.reportProgress(progressId, update, message, cancellationToken);
|
37 | }
|
38 | getLocationId(message) {
|
39 | return message.options && message.options.location || 'unknownLocation';
|
40 | }
|
41 | };
|
42 | (0, tslib_1.__decorate)([
|
43 | (0, inversify_1.inject)(progress_status_bar_item_1.ProgressStatusBarItem),
|
44 | (0, tslib_1.__metadata)("design:type", progress_status_bar_item_1.ProgressStatusBarItem)
|
45 | ], DispatchingProgressClient.prototype, "statusBarItem", void 0);
|
46 | (0, tslib_1.__decorate)([
|
47 | (0, inversify_1.inject)(progress_location_service_1.ProgressLocationService),
|
48 | (0, tslib_1.__metadata)("design:type", progress_location_service_1.ProgressLocationService)
|
49 | ], DispatchingProgressClient.prototype, "locationService", void 0);
|
50 | DispatchingProgressClient = (0, tslib_1.__decorate)([
|
51 | (0, inversify_1.injectable)()
|
52 | ], DispatchingProgressClient);
|
53 | exports.DispatchingProgressClient = DispatchingProgressClient;
|
54 |
|
\ | No newline at end of file |