@theia/core 1.75.0 → 1.76.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/catalog.json +587 -21
- package/lib/browser/decorations-service.d.ts +29 -1
- package/lib/browser/decorations-service.d.ts.map +1 -1
- package/lib/browser/decorations-service.js +124 -36
- package/lib/browser/decorations-service.js.map +1 -1
- package/lib/browser/decorations-service.spec.d.ts +2 -0
- package/lib/browser/decorations-service.spec.d.ts.map +1 -0
- package/lib/browser/decorations-service.spec.js +177 -0
- package/lib/browser/decorations-service.spec.js.map +1 -0
- package/lib/browser/hover-service.d.ts +31 -0
- package/lib/browser/hover-service.d.ts.map +1 -1
- package/lib/browser/hover-service.js +141 -16
- package/lib/browser/hover-service.js.map +1 -1
- package/lib/browser/hover-service.spec.d.ts +2 -0
- package/lib/browser/hover-service.spec.d.ts.map +1 -0
- package/lib/browser/hover-service.spec.js +326 -0
- package/lib/browser/hover-service.spec.js.map +1 -0
- package/package.json +4 -4
- package/src/browser/decorations-service.spec.ts +213 -0
- package/src/browser/decorations-service.ts +159 -38
- package/src/browser/hover-service.spec.ts +367 -0
- package/src/browser/hover-service.ts +143 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-service.spec.js","sourceRoot":"","sources":["../../src/browser/hover-service.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yDAAyD;AACzD,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,wCAA2C;AAC3C,IAAI,YAAY,GAAG,IAAA,mBAAW,GAAE,CAAC;AAEjC,yCAAsC;AACtC,+BAA8B;AAC9B,mDAA+C;AAC/C,sCAA8C;AAC9C,8EAA8E;AAC9E,qDAAiD;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@theia/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.0-next.4+21b9b5342",
|
|
4
4
|
"description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
|
|
5
5
|
"main": "lib/common/index.js",
|
|
6
6
|
"typings": "lib/common/index.d.ts",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@lumino/virtualdom": "^2.0.5",
|
|
18
18
|
"@lumino/widgets": "2.7.5",
|
|
19
19
|
"@parcel/watcher": "^2.6.0",
|
|
20
|
-
"@theia/application-package": "1.
|
|
21
|
-
"@theia/request": "1.
|
|
20
|
+
"@theia/application-package": "1.76.0-next.4+21b9b5342",
|
|
21
|
+
"@theia/request": "1.76.0-next.4+21b9b5342",
|
|
22
22
|
"@types/body-parser": "^1.19.6",
|
|
23
23
|
"@types/express": "^4.17.25",
|
|
24
24
|
"@types/fs-extra": "^4.0.15",
|
|
@@ -233,5 +233,5 @@
|
|
|
233
233
|
"nyc": {
|
|
234
234
|
"extends": "../../configs/nyc.json"
|
|
235
235
|
},
|
|
236
|
-
"gitHead": "
|
|
236
|
+
"gitHead": "21b9b534224c55152fca0b67af7f8a8283dad2bd"
|
|
237
237
|
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Safi Seid-Ahmad, K2view and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import { CancellationToken, Emitter, Event } from '../common';
|
|
19
|
+
import URI from '../common/uri';
|
|
20
|
+
import { Decoration, DecorationsProvider, DecorationsServiceImpl } from './decorations-service';
|
|
21
|
+
|
|
22
|
+
class TestDecorationsProvider implements DecorationsProvider {
|
|
23
|
+
|
|
24
|
+
protected readonly onDidChangeEmitter = new Emitter<URI[] | undefined>();
|
|
25
|
+
readonly decorations = new Map<string, Decoration>();
|
|
26
|
+
readonly queried: string[] = [];
|
|
27
|
+
asynchronous = true;
|
|
28
|
+
|
|
29
|
+
get onDidChange(): Event<URI[] | undefined> {
|
|
30
|
+
return this.onDidChangeEmitter.event;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fireDidChange(uris?: URI[]): void {
|
|
34
|
+
this.onDidChangeEmitter.fire(uris);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
provideDecorations(uri: URI, token: CancellationToken): Decoration | Promise<Decoration | undefined> | undefined {
|
|
38
|
+
this.queried.push(uri.toString());
|
|
39
|
+
const decoration = this.decorations.get(uri.toString());
|
|
40
|
+
return this.asynchronous ? Promise.resolve(decoration) : decoration;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const sleep = (ms: number): Promise<void> => new Promise(resolve => setTimeout(resolve, ms));
|
|
45
|
+
|
|
46
|
+
describe('DecorationsServiceImpl', () => {
|
|
47
|
+
|
|
48
|
+
const uriA = new URI('file:///project/a.ts');
|
|
49
|
+
const uriB = new URI('file:///project/b.ts');
|
|
50
|
+
|
|
51
|
+
let service: DecorationsServiceImpl;
|
|
52
|
+
let provider: TestDecorationsProvider;
|
|
53
|
+
let events: Map<string, Decoration>[];
|
|
54
|
+
|
|
55
|
+
beforeEach(() => {
|
|
56
|
+
service = new DecorationsServiceImpl();
|
|
57
|
+
provider = new TestDecorationsProvider();
|
|
58
|
+
service.registerDecorationsProvider(provider);
|
|
59
|
+
events = [];
|
|
60
|
+
service.onDidChangeDecorations(event => events.push(event));
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
afterEach(() => {
|
|
64
|
+
service.dispose();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('resolves decorations of synchronous providers on first query', () => {
|
|
68
|
+
provider.asynchronous = false;
|
|
69
|
+
provider.decorations.set(uriA.toString(), { letter: 'M' });
|
|
70
|
+
const result = service.getDecoration(uriA, false);
|
|
71
|
+
expect(result).to.have.lengthOf(1);
|
|
72
|
+
expect(result[0].letter).to.equal('M');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('caches "no decoration" results and does not query the provider again', async () => {
|
|
76
|
+
expect(service.getDecoration(uriA, false)).to.have.lengthOf(0);
|
|
77
|
+
await sleep(20);
|
|
78
|
+
expect(provider.queried).to.have.lengthOf(1);
|
|
79
|
+
|
|
80
|
+
expect(service.getDecoration(uriA, false)).to.have.lengthOf(0);
|
|
81
|
+
await sleep(20);
|
|
82
|
+
expect(provider.queried).to.have.lengthOf(1);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('does not fire an event when an unknown resource resolves to no decoration', async () => {
|
|
86
|
+
service.getDecoration(uriA, false);
|
|
87
|
+
await sleep(20);
|
|
88
|
+
expect(events).to.have.lengthOf(0);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('fires a single batched event for resolutions of the same tick', async () => {
|
|
92
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
93
|
+
provider.decorations.set(uriB.toString(), { letter: 'B' });
|
|
94
|
+
|
|
95
|
+
service.getDecoration(uriA, false);
|
|
96
|
+
service.getDecoration(uriB, false);
|
|
97
|
+
await sleep(20);
|
|
98
|
+
|
|
99
|
+
expect(events).to.have.lengthOf(1);
|
|
100
|
+
expect(events[0].get(uriA.toString())?.letter).to.equal('A');
|
|
101
|
+
expect(events[0].get(uriB.toString())?.letter).to.equal('B');
|
|
102
|
+
|
|
103
|
+
const cached = service.getDecoration(uriA, false);
|
|
104
|
+
expect(cached).to.have.lengthOf(1);
|
|
105
|
+
expect(cached[0].letter).to.equal('A');
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('re-fetches a resource when the provider signals a change for it', async () => {
|
|
109
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
110
|
+
service.getDecoration(uriA, false);
|
|
111
|
+
await sleep(20);
|
|
112
|
+
events.length = 0;
|
|
113
|
+
const queriesAfterWarmUp = provider.queried.length;
|
|
114
|
+
|
|
115
|
+
provider.decorations.set(uriA.toString(), { letter: 'D' });
|
|
116
|
+
provider.fireDidChange([uriA]);
|
|
117
|
+
await sleep(20);
|
|
118
|
+
|
|
119
|
+
expect(provider.queried.length).to.be.greaterThan(queriesAfterWarmUp);
|
|
120
|
+
expect(events).to.have.lengthOf(1);
|
|
121
|
+
expect(events[0].get(uriA.toString())?.letter).to.equal('D');
|
|
122
|
+
expect(service.getDecoration(uriA, false)[0].letter).to.equal('D');
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('fires an event when a decoration is removed', async () => {
|
|
126
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
127
|
+
service.getDecoration(uriA, false);
|
|
128
|
+
await sleep(20);
|
|
129
|
+
events.length = 0;
|
|
130
|
+
|
|
131
|
+
provider.decorations.delete(uriA.toString());
|
|
132
|
+
provider.fireDidChange([uriA]);
|
|
133
|
+
await sleep(20);
|
|
134
|
+
|
|
135
|
+
expect(events).to.have.lengthOf(1);
|
|
136
|
+
expect(events[0].has(uriA.toString())).to.equal(false);
|
|
137
|
+
expect(service.getDecoration(uriA, false)).to.have.lengthOf(0);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('announces a removal that settles synchronously after a cancelled in-flight request', async () => {
|
|
141
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
142
|
+
service.getDecoration(uriA, false);
|
|
143
|
+
await sleep(20);
|
|
144
|
+
events.length = 0;
|
|
145
|
+
|
|
146
|
+
// an async re-fetch is superseded by a synchronous one that removes the decoration
|
|
147
|
+
provider.fireDidChange([uriA]);
|
|
148
|
+
provider.asynchronous = false;
|
|
149
|
+
provider.decorations.delete(uriA.toString());
|
|
150
|
+
provider.fireDidChange([uriA]);
|
|
151
|
+
await sleep(20);
|
|
152
|
+
|
|
153
|
+
expect(events).to.have.lengthOf(1);
|
|
154
|
+
expect(events[0].has(uriA.toString())).to.equal(false);
|
|
155
|
+
expect(service.getDecoration(uriA, false)).to.have.lengthOf(0);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('keeps serving the previous decoration while a selective re-fetch is in flight', async () => {
|
|
159
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
160
|
+
service.getDecoration(uriA, false);
|
|
161
|
+
await sleep(20);
|
|
162
|
+
|
|
163
|
+
provider.decorations.set(uriA.toString(), { letter: 'D' });
|
|
164
|
+
provider.fireDidChange([uriA]);
|
|
165
|
+
|
|
166
|
+
const whileInFlight = service.getDecoration(uriA, false);
|
|
167
|
+
expect(whileInFlight).to.have.lengthOf(1);
|
|
168
|
+
expect(whileInFlight[0].letter).to.equal('A');
|
|
169
|
+
|
|
170
|
+
await sleep(20);
|
|
171
|
+
expect(service.getDecoration(uriA, false)[0].letter).to.equal('D');
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
it('keeps serving the last known decoration while a flush re-fetch is in flight', async () => {
|
|
175
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
176
|
+
service.getDecoration(uriA, false);
|
|
177
|
+
await sleep(20);
|
|
178
|
+
|
|
179
|
+
provider.decorations.set(uriA.toString(), { letter: 'D' });
|
|
180
|
+
provider.fireDidChange(undefined);
|
|
181
|
+
await sleep(20);
|
|
182
|
+
|
|
183
|
+
// the first query after the flush triggers the re-fetch but serves the stale value
|
|
184
|
+
const whileInFlight = service.getDecoration(uriA, false);
|
|
185
|
+
expect(whileInFlight).to.have.lengthOf(1);
|
|
186
|
+
expect(whileInFlight[0].letter).to.equal('A');
|
|
187
|
+
|
|
188
|
+
await sleep(20);
|
|
189
|
+
expect(service.getDecoration(uriA, false)[0].letter).to.equal('D');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('drops all cached data on a flush event and re-fetches on demand', async () => {
|
|
193
|
+
provider.decorations.set(uriA.toString(), { letter: 'A' });
|
|
194
|
+
service.getDecoration(uriA, false);
|
|
195
|
+
service.getDecoration(uriB, false);
|
|
196
|
+
await sleep(20);
|
|
197
|
+
events.length = 0;
|
|
198
|
+
const queriesAfterWarmUp = provider.queried.length;
|
|
199
|
+
|
|
200
|
+
provider.fireDidChange(undefined);
|
|
201
|
+
await sleep(20);
|
|
202
|
+
// the flush itself announces an unspecified change with an empty payload
|
|
203
|
+
expect(events).to.have.lengthOf(1);
|
|
204
|
+
expect(events[0].size).to.equal(0);
|
|
205
|
+
|
|
206
|
+
service.getDecoration(uriA, false);
|
|
207
|
+
service.getDecoration(uriB, false);
|
|
208
|
+
await sleep(20);
|
|
209
|
+
expect(provider.queried.length).to.equal(queriesAfterWarmUp + 2);
|
|
210
|
+
expect(service.getDecoration(uriA, false)[0].letter).to.equal('A');
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
});
|
|
@@ -19,6 +19,7 @@ import { isThenable } from '../common/promise-util';
|
|
|
19
19
|
import { CancellationToken, CancellationTokenSource, Disposable, Emitter, Event } from '../common';
|
|
20
20
|
import { TernarySearchTree } from '../common/ternary-search-tree';
|
|
21
21
|
import URI from '../common/uri';
|
|
22
|
+
import debounce = require('lodash.debounce');
|
|
22
23
|
|
|
23
24
|
/*---------------------------------------------------------------------------------------------
|
|
24
25
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -27,7 +28,14 @@ import URI from '../common/uri';
|
|
|
27
28
|
// some code copied and modified from https://github.com/microsoft/vscode/blob/1.52.1/src/vs/workbench/services/decorations/browser/decorationsService.ts#L24-L23
|
|
28
29
|
|
|
29
30
|
export interface DecorationsProvider {
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Signals that decorations changed for the given resources. Firing `undefined` is a
|
|
33
|
+
* flush event: all previously provided decorations may have changed, cached data is
|
|
34
|
+
* dropped and re-fetched on demand. The last known decorations keep being served
|
|
35
|
+
* until the re-fetch of their resource settles, so that displayed decorations do
|
|
36
|
+
* not blink out while the round trip is in flight.
|
|
37
|
+
*/
|
|
38
|
+
readonly onDidChange: Event<URI[] | undefined>;
|
|
31
39
|
provideDecorations(uri: URI, token: CancellationToken): Decoration | Promise<Decoration | undefined> | undefined;
|
|
32
40
|
}
|
|
33
41
|
|
|
@@ -45,6 +53,16 @@ export interface ResourceDecorationChangeEvent {
|
|
|
45
53
|
export const DecorationsService = Symbol('DecorationsService');
|
|
46
54
|
export interface DecorationsService {
|
|
47
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Fired when decorations changed. The payload maps the string representation of the
|
|
58
|
+
* affected resource URIs to their new decoration. Removals are never part of the
|
|
59
|
+
* payload: resources whose decoration was removed are simply absent, and an empty
|
|
60
|
+
* map signals that an unspecified set of decorations changed (e.g. a provider fired
|
|
61
|
+
* a flush event). Clients must therefore track the resources they display and
|
|
62
|
+
* re-query them on every event rather than react to the payload keys alone. Change
|
|
63
|
+
* notifications caused by asynchronously resolving decoration requests are batched:
|
|
64
|
+
* many resolutions result in a single event.
|
|
65
|
+
*/
|
|
48
66
|
readonly onDidChangeDecorations: Event<Map<string, Decoration>>;
|
|
49
67
|
|
|
50
68
|
registerDecorationsProvider(provider: DecorationsProvider): Disposable;
|
|
@@ -56,36 +74,70 @@ class DecorationDataRequest {
|
|
|
56
74
|
constructor(
|
|
57
75
|
readonly source: CancellationTokenSource,
|
|
58
76
|
readonly thenable: Promise<void>,
|
|
77
|
+
/**
|
|
78
|
+
* Last settled decoration from before this request started. It is served while
|
|
79
|
+
* the request is in flight and used to detect removals when it resolves.
|
|
80
|
+
*/
|
|
81
|
+
readonly previous: Decoration | undefined,
|
|
59
82
|
) { }
|
|
60
83
|
}
|
|
61
84
|
|
|
85
|
+
/**
|
|
86
|
+
* A decoration that a flush event marked as possibly outdated. It is served until its
|
|
87
|
+
* resource is queried again, which triggers the re-fetch.
|
|
88
|
+
*/
|
|
89
|
+
class StaleDecoration {
|
|
90
|
+
constructor(readonly value: Decoration) { }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type DecorationEntry = DecorationDataRequest | StaleDecoration | Decoration | null;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The decoration an entry last settled on: the resolved decoration itself, the
|
|
97
|
+
* pre-request value of an in-flight request, or the flushed value of a stale entry.
|
|
98
|
+
*/
|
|
99
|
+
function lastKnownDecoration(entry: DecorationEntry | undefined): Decoration | undefined {
|
|
100
|
+
if (entry instanceof DecorationDataRequest) {
|
|
101
|
+
return entry.previous;
|
|
102
|
+
}
|
|
103
|
+
if (entry instanceof StaleDecoration) {
|
|
104
|
+
return entry.value;
|
|
105
|
+
}
|
|
106
|
+
return entry ?? undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
62
109
|
class DecorationProviderWrapper {
|
|
63
110
|
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Cached provider results. Four states per resource: no entry means the resource was
|
|
113
|
+
* never fetched, a `null` entry means it was fetched and has no decoration, a
|
|
114
|
+
* {@link DecorationDataRequest} entry means a fetch is in flight and a
|
|
115
|
+
* {@link StaleDecoration} entry means a flush marked the last fetched decoration as
|
|
116
|
+
* possibly outdated. Distinguishing "known to be undecorated" from "unknown" is what
|
|
117
|
+
* keeps on-demand queries from re-fetching undecorated resources over and over.
|
|
118
|
+
*/
|
|
119
|
+
readonly data: TernarySearchTree<URI, DecorationEntry>;
|
|
66
120
|
private readonly disposable: Disposable;
|
|
67
121
|
|
|
68
122
|
constructor(
|
|
69
123
|
readonly provider: DecorationsProvider,
|
|
70
|
-
|
|
124
|
+
/** Reports a changed decoration, or `undefined` when the decoration was removed. */
|
|
125
|
+
private readonly notifyDecorationChange: (uri: URI, decoration: Decoration | undefined) => void,
|
|
126
|
+
/** Reports that all decorations of this provider may have changed. */
|
|
127
|
+
private readonly notifyFlush: () => void
|
|
71
128
|
) {
|
|
72
129
|
|
|
73
|
-
this.data = TernarySearchTree.forUris<
|
|
130
|
+
this.data = TernarySearchTree.forUris<DecorationEntry>(true);
|
|
74
131
|
|
|
75
|
-
this.disposable = this.provider.onDidChange(
|
|
76
|
-
this.decorations.clear();
|
|
132
|
+
this.disposable = this.provider.onDidChange(uris => {
|
|
77
133
|
if (!uris) {
|
|
78
|
-
this.
|
|
134
|
+
this.flush();
|
|
79
135
|
} else {
|
|
136
|
+
// selective changes -> re-fetch the given resources
|
|
80
137
|
for (const uri of uris) {
|
|
81
138
|
this.fetchData(uri);
|
|
82
|
-
const decoration = await provider.provideDecorations(uri, CancellationToken.None);
|
|
83
|
-
if (decoration) {
|
|
84
|
-
this.decorations.set(uri.toString(), decoration);
|
|
85
|
-
}
|
|
86
139
|
}
|
|
87
140
|
}
|
|
88
|
-
this.onDidChangeDecorationsEmitter.fire(this.decorations);
|
|
89
141
|
});
|
|
90
142
|
}
|
|
91
143
|
|
|
@@ -94,32 +146,53 @@ class DecorationProviderWrapper {
|
|
|
94
146
|
this.data.clear();
|
|
95
147
|
}
|
|
96
148
|
|
|
97
|
-
|
|
98
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Handles a flush event: all cached data is dropped to be re-fetched on demand.
|
|
151
|
+
* Previously fetched decorations are kept as {@link StaleDecoration stale} values
|
|
152
|
+
* that are served until the re-fetch of their resource settles, so that displayed
|
|
153
|
+
* decorations do not blink out while the round trip is in flight.
|
|
154
|
+
*/
|
|
155
|
+
private flush(): void {
|
|
156
|
+
const stale: [URI, StaleDecoration][] = [];
|
|
157
|
+
this.data.forEach((value, key) => {
|
|
158
|
+
if (value instanceof DecorationDataRequest) {
|
|
159
|
+
value.source.cancel();
|
|
160
|
+
}
|
|
161
|
+
const decoration = lastKnownDecoration(value);
|
|
162
|
+
if (decoration) {
|
|
163
|
+
stale.push([key, new StaleDecoration(decoration)]);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
this.data.clear();
|
|
167
|
+
for (const [key, value] of stale) {
|
|
168
|
+
this.data.set(key, value);
|
|
169
|
+
}
|
|
170
|
+
this.notifyFlush();
|
|
99
171
|
}
|
|
100
172
|
|
|
101
173
|
getOrRetrieve(uri: URI, includeChildren: boolean, callback: (data: Decoration, isChild: boolean) => void): void {
|
|
102
174
|
|
|
103
175
|
let item = this.data.get(uri);
|
|
104
176
|
|
|
105
|
-
if (item === undefined) {
|
|
106
|
-
// unknown -> trigger request
|
|
177
|
+
if (item === undefined || item instanceof StaleDecoration) {
|
|
178
|
+
// unknown or stale -> trigger request
|
|
107
179
|
item = this.fetchData(uri);
|
|
108
180
|
}
|
|
109
181
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
182
|
+
// the result, or the last known decoration while a request is in flight
|
|
183
|
+
const decoration = lastKnownDecoration(item);
|
|
184
|
+
if (decoration) {
|
|
185
|
+
callback(decoration, false);
|
|
113
186
|
}
|
|
114
187
|
|
|
115
188
|
if (includeChildren) {
|
|
116
|
-
// (
|
|
189
|
+
// (last known decorations of) children
|
|
117
190
|
const iter = this.data.findSuperstr(uri);
|
|
118
191
|
if (iter) {
|
|
119
192
|
let next = iter.next();
|
|
120
193
|
while (!next.done) {
|
|
121
|
-
const value = next.value;
|
|
122
|
-
if (value
|
|
194
|
+
const value = lastKnownDecoration(next.value);
|
|
195
|
+
if (value) {
|
|
123
196
|
callback(value, true);
|
|
124
197
|
}
|
|
125
198
|
next = iter.next();
|
|
@@ -128,12 +201,13 @@ class DecorationProviderWrapper {
|
|
|
128
201
|
}
|
|
129
202
|
}
|
|
130
203
|
|
|
131
|
-
private fetchData(uri: URI): Decoration |
|
|
204
|
+
private fetchData(uri: URI): DecorationDataRequest | Decoration | null {
|
|
132
205
|
|
|
133
|
-
// check for pending request and cancel it
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
206
|
+
// check for pending request and cancel it, keeping the last settled value
|
|
207
|
+
const existing = this.data.get(uri);
|
|
208
|
+
const previous = lastKnownDecoration(existing);
|
|
209
|
+
if (existing instanceof DecorationDataRequest) {
|
|
210
|
+
existing.source.cancel();
|
|
137
211
|
this.data.delete(uri);
|
|
138
212
|
}
|
|
139
213
|
|
|
@@ -141,28 +215,36 @@ class DecorationProviderWrapper {
|
|
|
141
215
|
const dataOrThenable = this.provider.provideDecorations(uri, source.token);
|
|
142
216
|
if (!isThenable<Decoration | Promise<Decoration | undefined> | undefined>(dataOrThenable)) {
|
|
143
217
|
// sync -> we have a result now
|
|
144
|
-
return this.keepItem(uri, dataOrThenable);
|
|
218
|
+
return this.keepItem(uri, dataOrThenable, previous);
|
|
145
219
|
|
|
146
220
|
} else {
|
|
147
221
|
// async -> we have a result soon
|
|
148
222
|
const request = new DecorationDataRequest(source, Promise.resolve(dataOrThenable).then(data => {
|
|
149
223
|
if (this.data.get(uri) === request) {
|
|
150
|
-
this.keepItem(uri, data);
|
|
224
|
+
this.keepItem(uri, data, request.previous);
|
|
151
225
|
}
|
|
152
226
|
}).catch(err => {
|
|
153
227
|
if (!(err instanceof Error && err.name === 'Canceled' && err.message === 'Canceled') && this.data.get(uri) === request) {
|
|
154
228
|
this.data.delete(uri);
|
|
155
229
|
}
|
|
156
|
-
}));
|
|
230
|
+
}), previous);
|
|
157
231
|
|
|
158
232
|
this.data.set(uri, request);
|
|
159
|
-
return
|
|
233
|
+
return request;
|
|
160
234
|
}
|
|
161
235
|
}
|
|
162
236
|
|
|
163
|
-
private keepItem(uri: URI, data: Decoration | undefined
|
|
164
|
-
|
|
237
|
+
private keepItem(uri: URI, data: Decoration | undefined, previous: Decoration | undefined): Decoration | null {
|
|
238
|
+
// eslint-disable-next-line no-null/no-null
|
|
239
|
+
const deco = data ? data : null;
|
|
165
240
|
this.data.set(uri, deco);
|
|
241
|
+
if (deco || previous) {
|
|
242
|
+
// only notify when something actually changed: a decoration appeared or
|
|
243
|
+
// changed, or a previously known decoration was removed. Resources resolving
|
|
244
|
+
// to "no decoration" from an unknown or pending state stay silent so that
|
|
245
|
+
// on-demand queries of undecorated resources cause no render churn.
|
|
246
|
+
this.notifyDecorationChange(uri, deco ?? undefined);
|
|
247
|
+
}
|
|
166
248
|
return deco;
|
|
167
249
|
}
|
|
168
250
|
}
|
|
@@ -173,23 +255,38 @@ export class DecorationsServiceImpl implements DecorationsService {
|
|
|
173
255
|
private readonly data: DecorationProviderWrapper[] = [];
|
|
174
256
|
private readonly onDidChangeDecorationsEmitter = new Emitter<Map<string, Decoration>>();
|
|
175
257
|
|
|
258
|
+
/**
|
|
259
|
+
* Accumulates decoration changes until the batched {@link onDidChangeDecorations}
|
|
260
|
+
* event fires. `undefined` values mark removed decorations.
|
|
261
|
+
*/
|
|
262
|
+
private readonly pendingChanges = new Map<string, Decoration | undefined>();
|
|
263
|
+
private pendingFlush = false;
|
|
264
|
+
|
|
176
265
|
readonly onDidChangeDecorations = this.onDidChangeDecorationsEmitter.event;
|
|
177
266
|
|
|
267
|
+
/** Coalesces all changes of the same tick into a single event. */
|
|
268
|
+
protected readonly fireSoon = debounce(() => this.fireChangeEvent(), 0);
|
|
269
|
+
|
|
178
270
|
dispose(): void {
|
|
271
|
+
this.fireSoon.cancel();
|
|
179
272
|
this.onDidChangeDecorationsEmitter.dispose();
|
|
180
273
|
}
|
|
181
274
|
|
|
182
275
|
registerDecorationsProvider(provider: DecorationsProvider): Disposable {
|
|
183
276
|
|
|
184
|
-
const wrapper = new DecorationProviderWrapper(
|
|
277
|
+
const wrapper = new DecorationProviderWrapper(
|
|
278
|
+
provider,
|
|
279
|
+
(uri, decoration) => this.notifyDecorationChange(uri, decoration),
|
|
280
|
+
() => this.notifyFlush()
|
|
281
|
+
);
|
|
185
282
|
this.data.push(wrapper);
|
|
186
283
|
|
|
187
284
|
return Disposable.create(() => {
|
|
188
|
-
//
|
|
189
|
-
//
|
|
285
|
+
// dispose and remove the provider, then signal that
|
|
286
|
+
// any of its previously provided decorations may be gone.
|
|
190
287
|
this.data.splice(this.data.indexOf(wrapper), 1);
|
|
191
|
-
this.onDidChangeDecorationsEmitter.fire(new Map<string, Decoration>());
|
|
192
288
|
wrapper.dispose();
|
|
289
|
+
this.notifyFlush();
|
|
193
290
|
});
|
|
194
291
|
}
|
|
195
292
|
|
|
@@ -206,4 +303,28 @@ export class DecorationsServiceImpl implements DecorationsService {
|
|
|
206
303
|
}
|
|
207
304
|
return data;
|
|
208
305
|
}
|
|
306
|
+
|
|
307
|
+
protected notifyDecorationChange(uri: URI, decoration: Decoration | undefined): void {
|
|
308
|
+
this.pendingChanges.set(uri.toString(), decoration);
|
|
309
|
+
this.fireSoon();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
protected notifyFlush(): void {
|
|
313
|
+
this.pendingFlush = true;
|
|
314
|
+
this.fireSoon();
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
protected fireChangeEvent(): void {
|
|
318
|
+
const event = new Map<string, Decoration>();
|
|
319
|
+
if (!this.pendingFlush) {
|
|
320
|
+
for (const [uri, decoration] of this.pendingChanges) {
|
|
321
|
+
if (decoration) {
|
|
322
|
+
event.set(uri, decoration);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
this.pendingFlush = false;
|
|
327
|
+
this.pendingChanges.clear();
|
|
328
|
+
this.onDidChangeDecorationsEmitter.fire(event);
|
|
329
|
+
}
|
|
209
330
|
}
|