@@ -33,6 +33,7 @@ export class InitPacket {
3333 }
3434}
3535
36+ /** Error class for errors returned from XDebug */
3637export class XDebugError extends Error {
3738 code : number ;
3839 constructor ( message : string , code : number ) {
@@ -339,6 +340,7 @@ export class PropertyGetResponse extends Response {
339340 }
340341}
341342
343+ /** class for properties returned from eval commands. These don't have a full name or an ID, but have all children already inlined. */
342344export class EvalResultProperty extends BaseProperty {
343345 children : EvalResultProperty [ ] ;
344346 constructor ( propertyNode : Element ) {
@@ -349,7 +351,9 @@ export class EvalResultProperty extends BaseProperty {
349351 }
350352}
351353
354+ /** The response to an eval command */
352355export class EvalResponse extends Response {
356+ /** the result of the expression, if there was any */
353357 result : EvalResultProperty ;
354358 constructor ( document : XMLDocument , connection : Connection ) {
355359 super ( document , connection ) ;
@@ -359,7 +363,9 @@ export class EvalResponse extends Response {
359363 }
360364}
361365
366+ /** The response to an feature_set command */
362367export class FeatureSetResponse extends Response {
368+ /** the feature that was set */
363369 feature : string ;
364370 constructor ( document : XMLDocument , connection : Connection ) {
365371 super ( document , connection ) ;
@@ -538,12 +544,18 @@ export class Connection extends DbgpConnection {
538544 // ---------------------------- breakpoints ------------------------------------
539545
540546 /**
541- * Sends a breakpoint_set command that sets a line breakpoint.
547+ * Sends a breakpoint_set command that sets a breakpoint.
548+ * @param {object } breakpoint
549+ * @param {string } breakpoint.type - the type of breakpoint. Can be 'line' or 'exception'
550+ * @param {string } [breakpoint.fileUri] - the file URI to break on if type is 'line'
551+ * @param {number } [breakpoint.line] - the line to break on if type is 'line'
552+ * @param {string } [breakpoint.exception] - the exception class name to break on if type is 'exception'
553+ * @returns Promise.<BreakpointSetResponse>
542554 */
543- public sendBreakpointSetCommand ( breakpoint : { type : string , file ?: string , line ?: number , exception ?: string } ) : Promise < BreakpointSetResponse > {
555+ public sendBreakpointSetCommand ( breakpoint : { type : string , fileUri ?: string , line ?: number , exception ?: string } ) : Promise < BreakpointSetResponse > {
544556 let args = `-t ${ breakpoint . type } ` ;
545557 if ( breakpoint . type === 'line' ) {
546- args += `-f ${ breakpoint . file } -n ${ breakpoint . line } ` ;
558+ args += `-f ${ breakpoint . fileUri } -n ${ breakpoint . line } ` ;
547559 } else if ( breakpoint . type === 'exception' ) {
548560 args += `-x ${ breakpoint . exception } ` ;
549561 } else {
@@ -552,39 +564,46 @@ export class Connection extends DbgpConnection {
552564 return this . _enqueueCommand ( 'breakpoint_set' , args ) . then ( document => new BreakpointSetResponse ( document , this ) ) ;
553565 }
554566
567+ /** sends a breakpoint_list command */
555568 public sendBreakpointListCommand ( ) : Promise < BreakpointListResponse > {
556569 return this . _enqueueCommand ( 'breakpoint_list' ) . then ( document => new BreakpointListResponse ( document , this ) ) ;
557570 }
558571
572+ /** sends a breakpoint_remove command */
559573 public sendBreakpointRemoveCommand ( breakpoint : Breakpoint ) : Promise < Response > {
560574 return this . _enqueueCommand ( 'breakpoint_remove' , `-d ${ breakpoint . id } ` ) . then ( document => new Response ( document , this ) ) ;
561575 }
562576
563577 // ----------------------------- continuation ---------------------------------
564578
579+ /** sends a run command */
565580 public sendRunCommand ( ) : Promise < StatusResponse > {
566581 return this . _enqueueCommand ( 'run' ) . then ( document => new StatusResponse ( document , this ) ) ;
567582 }
568583
584+ /** sends a step_into command */
569585 public sendStepIntoCommand ( ) : Promise < StatusResponse > {
570586 return this . _enqueueCommand ( 'step_into' ) . then ( document => new StatusResponse ( document , this ) ) ;
571587 }
572588
589+ /** sends a step_over command */
573590 public sendStepOverCommand ( ) : Promise < StatusResponse > {
574591 return this . _enqueueCommand ( 'step_over' ) . then ( document => new StatusResponse ( document , this ) ) ;
575592 }
576593
594+ /** sends a step_out command */
577595 public sendStepOutCommand ( ) : Promise < StatusResponse > {
578596 return this . _enqueueCommand ( 'step_out' ) . then ( document => new StatusResponse ( document , this ) ) ;
579597 }
580598
599+ /** sends a stop command */
581600 public sendStopCommand ( ) : Promise < StatusResponse > {
582601 return this . _enqueueCommand ( 'stop' ) . then ( document => new StatusResponse ( document , this ) ) ;
583602 }
584603
585604 // ------------------------------ stack ----------------------------------------
586605
587- /** Sends a stack_get request */
606+ /** Sends a stack_get command */
588607 public sendStackGetCommand ( ) : Promise < StackGetResponse > {
589608 return this . _enqueueCommand ( 'stack_get' ) . then ( document => new StackGetResponse ( document , this ) ) ;
590609 }
@@ -608,6 +627,7 @@ export class Connection extends DbgpConnection {
608627
609628 // ------------------------------- eval -----------------------------------------
610629
630+ /** sends an eval command */
611631 public sendEvalCommand ( expression : string ) : Promise < EvalResponse > {
612632 return this . _enqueueCommand ( 'eval' , null , expression ) . then ( document => new EvalResponse ( document , this ) ) ;
613633 }
0 commit comments