Breakpoint span in the debugger statement

This commit is contained in:
Sheetal Nandi 2014-10-17 15:43:40 -07:00
parent a047d205ef
commit 71e96bea9b
3 changed files with 13 additions and 0 deletions

View File

@ -80,6 +80,9 @@ module ts.BreakpointResolver {
case SyntaxKind.DoStatement:
return spanInDoStatement(<DoStatement>node);
case SyntaxKind.DebuggerStatement:
return spanInDebuggerStatement(node);
// Tokens:
case SyntaxKind.SemicolonToken:
case SyntaxKind.EndOfFileToken:
@ -235,6 +238,11 @@ module ts.BreakpointResolver {
return spanInNode(doStatement.statement);
}
function spanInDebuggerStatement(node: Node): TypeScript.TextSpan {
// Set breakpoint on debugger keyword
return textSpan(node.getChildAt(0, sourceFile));
}
// Tokens:
function spanInCommaToken(node: Node): TypeScript.TextSpan {
switch (node.parent.kind) {

View File

@ -0,0 +1,5 @@
1 >debugger;
~~~~~~~~~ => Pos: (0 to 8) SpanInfo: {"start":0,"length":8}
>debugger
>:=> (line 1, col 0) to (line 1, col 8)