@@ -32,6 +32,7 @@ import { posix, splitSketchPath } from '../../create/create-paths';
3232import { Create } from '../../create/typings' ;
3333import { nls } from '@theia/core/lib/common' ;
3434import { ApplicationConnectionStatusContribution } from '../../theia/core/connection-status-service' ;
35+ import { ExecuteWithProgress } from '../../../common/protocol/progressible' ;
3536
3637const MESSAGE_TIMEOUT = 5 * 1000 ;
3738const deepmerge = require ( 'deepmerge' ) . default ;
@@ -144,7 +145,7 @@ export class CloudSketchbookTree extends SketchbookTree {
144145 this . messageService . info (
145146 nls . localize (
146147 'arduino/cloud/donePulling' ,
147- ' Done pulling ‘ {0}’.' ,
148+ " Done pulling ' {0}'." ,
148149 node . fileStat . name
149150 ) ,
150151 {
@@ -212,7 +213,7 @@ export class CloudSketchbookTree extends SketchbookTree {
212213 this . messageService . info (
213214 nls . localize (
214215 'arduino/cloud/donePushing' ,
215- ' Done pushing ‘ {0}’.' ,
216+ " Done pushing ' {0}'." ,
216217 node . fileStat . name
217218 ) ,
218219 {
@@ -324,29 +325,15 @@ export class CloudSketchbookTree extends SketchbookTree {
324325 state : CloudSketchbookTree . CloudSketchDirNode . State ,
325326 task : ( node : CloudSketchbookTree . CloudSketchDirNode ) => MaybePromise < T >
326327 ) : 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 ) ;
347335 }
348- await this . refresh ( node ) ;
349- }
336+ ) ;
350337 }
351338
352339 private async sync ( source : URI , dest : URI ) : Promise < void > {
0 commit comments