@@ -32,6 +32,7 @@ import { posix, splitSketchPath } from '../../create/create-paths';
32
32
import { Create } from '../../create/typings' ;
33
33
import { nls } from '@theia/core/lib/common' ;
34
34
import { ApplicationConnectionStatusContribution } from '../../theia/core/connection-status-service' ;
35
+ import { ExecuteWithProgress } from '../../../common/protocol/progressible' ;
35
36
36
37
const MESSAGE_TIMEOUT = 5 * 1000 ;
37
38
const deepmerge = require ( 'deepmerge' ) . default ;
@@ -144,7 +145,7 @@ export class CloudSketchbookTree extends SketchbookTree {
144
145
this . messageService . info (
145
146
nls . localize (
146
147
'arduino/cloud/donePulling' ,
147
- ' Done pulling ‘ {0}’.' ,
148
+ " Done pulling ' {0}'." ,
148
149
node . fileStat . name
149
150
) ,
150
151
{
@@ -212,7 +213,7 @@ export class CloudSketchbookTree extends SketchbookTree {
212
213
this . messageService . info (
213
214
nls . localize (
214
215
'arduino/cloud/donePushing' ,
215
- ' Done pushing ‘ {0}’.' ,
216
+ " Done pushing ' {0}'." ,
216
217
node . fileStat . name
217
218
) ,
218
219
{
@@ -324,29 +325,15 @@ export class CloudSketchbookTree extends SketchbookTree {
324
325
state : CloudSketchbookTree . CloudSketchDirNode . State ,
325
326
task : ( node : CloudSketchbookTree . CloudSketchDirNode ) => MaybePromise < T >
326
327
) : Promise < T > {
327
- const decoration : WidgetDecoration . TailDecoration = {
328
- data : `${ firstToUpperCase ( state ) } ...` ,
329
- fontData : {
330
- color : 'var(--theia-list-highlightForeground)' ,
331
- } ,
332
- } ;
333
- try {
334
- node . state = state ;
335
- this . mergeDecoration ( node , { tailDecorations : [ decoration ] } ) ;
336
- await this . refresh ( node ) ;
337
- const result = await task ( node ) ;
338
- return result ;
339
- } finally {
340
- delete node . state ;
341
- // TODO: find a better way to attach and detach decorators. Do we need a proper `TreeDecorator` instead?
342
- const index = node . decorationData ?. tailDecorations ?. findIndex (
343
- ( candidate ) => JSON . stringify ( decoration ) === JSON . stringify ( candidate )
344
- ) ;
345
- if ( typeof index === 'number' && index !== - 1 ) {
346
- node . decorationData ?. tailDecorations ?. splice ( index , 1 ) ;
328
+ const name = node . uri . path . name ;
329
+ return ExecuteWithProgress . withProgress (
330
+ `${ firstToUpperCase ( state ) } '${ name } '` ,
331
+ this . messageService ,
332
+ async ( progress ) => {
333
+ progress . report ( { work : { done : 0 , total : NaN } } ) ;
334
+ return task ( node ) ;
347
335
}
348
- await this . refresh ( node ) ;
349
- }
336
+ ) ;
350
337
}
351
338
352
339
private async sync ( source : URI , dest : URI ) : Promise < void > {
0 commit comments