@@ -22,14 +22,14 @@ const DEBUG_STATUS_BAR = `.statusbar.debugging`;
2222const NOT_DEBUG_STATUS_BAR = `.statusbar:not(debugging)` ;
2323const TOOLBAR_HIDDEN = `.debug-actions-widget.monaco-builder-hidden` ;
2424const STACK_FRAME = `${ VIEWLET } .monaco-tree-row .stack-frame` ;
25+ const SPECIFIC_STACK_FRAME = filename => `${ STACK_FRAME } .file[title$="${ filename } "]` ;
2526const VARIABLE = `${ VIEWLET } .debug-variables .monaco-tree-row .expression` ;
2627const CONSOLE_OUTPUT = `.repl .output.expression` ;
2728const CONSOLE_INPUT_OUTPUT = `.repl .input-output-pair .output.expression .value` ;
2829
2930const REPL_FOCUSED = '.repl-input-wrapper .monaco-editor textarea' ;
3031
3132export interface IStackFrame {
32- id : string ;
3333 name : string ;
3434 lineNumber : number ;
3535}
@@ -102,12 +102,11 @@ export class Debug extends Viewlet {
102102 }
103103
104104 async waitForStackFrameLength ( length : number ) : Promise < any > {
105- return await this . spectron . client . waitFor ( ( ) => this . getStackFrames ( ) , stackFrames => stackFrames . length === length ) ;
105+ await this . spectron . client . waitForElements ( STACK_FRAME , result => result . length === length ) ;
106106 }
107107
108108 async focusStackFrame ( name : string , message : string ) : Promise < any > {
109- const stackFrame = await this . waitForStackFrame ( sf => sf . name === name , message ) ;
110- await this . spectron . client . spectron . client . elementIdClick ( stackFrame . id ) ;
109+ await this . spectron . client . waitAndClick ( SPECIFIC_STACK_FRAME ( name ) ) ;
111110 await this . spectron . workbench . waitForTab ( name ) ;
112111 }
113112
@@ -130,11 +129,6 @@ export class Debug extends Viewlet {
130129 return await this . spectron . webclient . selectorExecute ( VARIABLE , div => ( Array . isArray ( div ) ? div : [ div ] ) . length ) ;
131130 }
132131
133- async getStackFramesLength ( ) : Promise < number > {
134- const stackFrames = await this . getStackFrames ( ) ;
135- return stackFrames . length ;
136- }
137-
138132 private async getStackFrames ( ) : Promise < IStackFrame [ ] > {
139133 const result = await this . spectron . webclient . selectorExecute ( STACK_FRAME ,
140134 div => ( Array . isArray ( div ) ? div : [ div ] ) . map ( element => {
0 commit comments