mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Breakpoints in labeled statements
This commit is contained in:
parent
7425aedd59
commit
6fbf0d672c
@ -90,6 +90,9 @@ module ts.BreakpointResolver {
|
||||
case SyntaxKind.IfStatement:
|
||||
return spanInIfStatement(<IfStatement>node);
|
||||
|
||||
case SyntaxKind.LabeledStatement:
|
||||
return spanInLabeledStatement(<LabeledStatement>node);
|
||||
|
||||
// Tokens:
|
||||
case SyntaxKind.SemicolonToken:
|
||||
case SyntaxKind.EndOfFileToken:
|
||||
@ -258,6 +261,10 @@ module ts.BreakpointResolver {
|
||||
// set on if(..) span
|
||||
return textSpan(ifStatement, findNextToken(ifStatement.expression, ifStatement));
|
||||
}
|
||||
|
||||
function spanInLabeledStatement(labeledStatement: LabeledStatement): TypeScript.TextSpan {
|
||||
return spanInNode(labeledStatement.statement);
|
||||
}
|
||||
|
||||
// Tokens:
|
||||
function spanInCommaToken(node: Node): TypeScript.TextSpan {
|
||||
|
||||
11
tests/baselines/reference/bpSpan_labeled.baseline
Normal file
11
tests/baselines/reference/bpSpan_labeled.baseline
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
1 >x:
|
||||
|
||||
~~~ => Pos: (0 to 2) SpanInfo: {"start":3,"length":10}
|
||||
>var b = 10
|
||||
>:=> (line 2, col 0) to (line 2, col 10)
|
||||
--------------------------------
|
||||
2 >var b = 10;
|
||||
~~~~~~~~~~~ => Pos: (3 to 13) SpanInfo: {"start":3,"length":10}
|
||||
>var b = 10
|
||||
>:=> (line 2, col 0) to (line 2, col 10)
|
||||
Loading…
x
Reference in New Issue
Block a user