@@ -208,7 +208,8 @@ class DecorationProviderWrapper {
208208 constructor (
209209 readonly provider : IDecorationsProvider ,
210210 private readonly _uriEmitter : Emitter < URI | URI [ ] > ,
211- private readonly _flushEmitter : Emitter < IResourceDecorationChangeEvent >
211+ private readonly _flushEmitter : Emitter < IResourceDecorationChangeEvent > ,
212+ @ILogService private readonly _logService : ILogService ,
212213 ) {
213214 this . _dispoable = this . provider . onDidChange ( uris => {
214215 if ( ! uris ) {
@@ -238,16 +239,17 @@ class DecorationProviderWrapper {
238239 }
239240
240241 getOrRetrieve ( uri : URI , includeChildren : boolean , callback : ( data : IDecorationData , isChild : boolean ) => void ) : void {
241-
242242 let item = this . data . get ( uri ) ;
243243
244244 if ( item === undefined ) {
245245 // unknown -> trigger request
246+ this . _logService . trace ( '[Decorations] getOrRetrieve -> FETCH' , this . provider . label , uri ) ;
246247 item = this . _fetchData ( uri ) ;
247248 }
248249
249250 if ( item && ! ( item instanceof DecorationDataRequest ) ) {
250251 // found something (which isn't pending anymore)
252+ this . _logService . trace ( '[Decorations] getOrRetrieve -> RESULT' , this . provider . label , uri ) ;
251253 callback ( item , false ) ;
252254 }
253255
@@ -257,6 +259,7 @@ class DecorationProviderWrapper {
257259 if ( iter ) {
258260 for ( let item = iter . next ( ) ; ! item . done ; item = iter . next ( ) ) {
259261 if ( item . value && ! ( item . value instanceof DecorationDataRequest ) ) {
262+ this . _logService . trace ( '[Decorations] getOrRetrieve -> RESULT (children)' , this . provider . label , uri ) ;
260263 callback ( item . value , true ) ;
261264 }
262265 }
@@ -269,6 +272,7 @@ class DecorationProviderWrapper {
269272 // check for pending request and cancel it
270273 const pendingRequest = this . data . get ( uri ) ;
271274 if ( pendingRequest instanceof DecorationDataRequest ) {
275+ this . _logService . trace ( '[Decorations] fetchData -> CANCEL previous' , this . provider . label , uri ) ;
272276 pendingRequest . source . cancel ( ) ;
273277 this . data . delete ( uri ) ;
274278 }
@@ -297,6 +301,7 @@ class DecorationProviderWrapper {
297301 }
298302
299303 private _keepItem ( uri : URI , data : IDecorationData | undefined ) : IDecorationData | null {
304+ this . _logService . trace ( '[Decorations] keepItem -> CANCEL previous' , this . provider . label , uri , data ) ;
300305 const deco = data ? data : null ;
301306 const old = this . data . set ( uri , deco ) ;
302307 if ( deco || old ) {
@@ -343,7 +348,8 @@ export class DecorationsService implements IDecorationsService {
343348 const wrapper = new DecorationProviderWrapper (
344349 provider ,
345350 this . _onDidChangeDecorationsDelayed ,
346- this . _onDidChangeDecorations
351+ this . _onDidChangeDecorations ,
352+ this . _logService
347353 ) ;
348354 const remove = this . _data . push ( wrapper ) ;
349355
0 commit comments