mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Breakpoint span in the debugger statement
This commit is contained in:
parent
a047d205ef
commit
71e96bea9b
@ -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) {
|
||||
|
||||
5
tests/baselines/reference/bpSpan_debugger.baseline
Normal file
5
tests/baselines/reference/bpSpan_debugger.baseline
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user