Breakpoints in import declaration
This commit is contained in:
parent
2905217d4e
commit
d235caf990
3 changed files with 46 additions and 0 deletions
|
@ -122,6 +122,9 @@ module ts.BreakpointResolver {
|
||||||
case SyntaxKind.ExportAssignment:
|
case SyntaxKind.ExportAssignment:
|
||||||
return spanInExportAssignment(<ExportAssignment>node);
|
return spanInExportAssignment(<ExportAssignment>node);
|
||||||
|
|
||||||
|
case SyntaxKind.ImportDeclaration:
|
||||||
|
return spanInImportDeclaration(<ImportDeclaration>node);
|
||||||
|
|
||||||
case SyntaxKind.BinaryExpression:
|
case SyntaxKind.BinaryExpression:
|
||||||
case SyntaxKind.PostfixOperator:
|
case SyntaxKind.PostfixOperator:
|
||||||
case SyntaxKind.PrefixOperator:
|
case SyntaxKind.PrefixOperator:
|
||||||
|
@ -358,6 +361,10 @@ module ts.BreakpointResolver {
|
||||||
return textSpan(exportAssignment, exportAssignment.exportName);
|
return textSpan(exportAssignment, exportAssignment.exportName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function spanInImportDeclaration(importDeclaration: ImportDeclaration): TypeScript.TextSpan {
|
||||||
|
return textSpan(importDeclaration, importDeclaration.entityName || importDeclaration.externalModuleName);
|
||||||
|
}
|
||||||
|
|
||||||
function spanInExpression(expression: Expression): TypeScript.TextSpan {
|
function spanInExpression(expression: Expression): TypeScript.TextSpan {
|
||||||
//TODO (pick this up later) for now lets fix do-while baseline
if (node.parent.kind === SyntaxKind.DoStatement) {
|
//TODO (pick this up later) for now lets fix do-while baseline
if (node.parent.kind === SyntaxKind.DoStatement) {
|
||||||
// Set span as if on while keyword
|
// Set span as if on while keyword
|
||||||
|
|
39
tests/baselines/reference/bpSpan_import.baseline
Normal file
39
tests/baselines/reference/bpSpan_import.baseline
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
|
||||||
|
1 >module m {
|
||||||
|
|
||||||
|
~~~~~~~~~~~ => Pos: (0 to 10) SpanInfo: undefined
|
||||||
|
--------------------------------
|
||||||
|
2 > class c {
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~ => Pos: (11 to 24) SpanInfo: undefined
|
||||||
|
--------------------------------
|
||||||
|
3 > }
|
||||||
|
|
||||||
|
~~~~~~ => Pos: (25 to 30) SpanInfo: undefined
|
||||||
|
--------------------------------
|
||||||
|
4 >}
|
||||||
|
|
||||||
|
~~ => Pos: (31 to 32) SpanInfo: undefined
|
||||||
|
--------------------------------
|
||||||
|
5 >import a = m.c;
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~ => Pos: (33 to 48) SpanInfo: {"start":33,"length":14}
|
||||||
|
>import a = m.c
|
||||||
|
>:=> (line 5, col 0) to (line 5, col 14)
|
||||||
|
--------------------------------
|
||||||
|
6 >export import b = m.c;
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (49 to 71) SpanInfo: {"start":49,"length":21}
|
||||||
|
>export import b = m.c
|
||||||
|
>:=> (line 6, col 0) to (line 6, col 21)
|
||||||
|
--------------------------------
|
||||||
|
7 >var x = new a();
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~ => Pos: (72 to 88) SpanInfo: {"start":72,"length":15}
|
||||||
|
>var x = new a()
|
||||||
|
>:=> (line 7, col 0) to (line 7, col 15)
|
||||||
|
--------------------------------
|
||||||
|
8 >var y = new b();
|
||||||
|
~~~~~~~~~~~~~~~~ => Pos: (89 to 104) SpanInfo: {"start":89,"length":15}
|
||||||
|
>var y = new b()
|
||||||
|
>:=> (line 8, col 0) to (line 8, col 15)
|
Loading…
Reference in a new issue