mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
Breakpoint validation in interfaces
This commit is contained in:
parent
308670c9ce
commit
933680b242
@ -179,6 +179,10 @@ module ts.BreakpointResolver {
|
||||
case SyntaxKind.WithStatement:
|
||||
return spanInWithStatement(<WithStatement>node);
|
||||
|
||||
// No breakpoint in interface
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
return undefined;
|
||||
|
||||
// Tokens:
|
||||
case SyntaxKind.SemicolonToken:
|
||||
case SyntaxKind.EndOfFileToken:
|
||||
@ -560,7 +564,6 @@ module ts.BreakpointResolver {
|
||||
return spanInNode(node.parent);
|
||||
}
|
||||
|
||||
|
||||
function spanInWhileKeyword(node: Node): TypeScript.TextSpan {
|
||||
if (node.parent.kind === SyntaxKind.DoStatement) {
|
||||
// Set span on while expression
|
||||
|
||||
93
tests/baselines/reference/bpSpan_interface.baseline
Normal file
93
tests/baselines/reference/bpSpan_interface.baseline
Normal file
@ -0,0 +1,93 @@
|
||||
|
||||
1 >interface I {
|
||||
|
||||
~~~~~~~~~~~~~~ => Pos: (0 to 13) SpanInfo: undefined
|
||||
--------------------------------
|
||||
2 > property: string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~ => Pos: (14 to 35) SpanInfo: undefined
|
||||
--------------------------------
|
||||
3 > method(): number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~ => Pos: (36 to 57) SpanInfo: undefined
|
||||
--------------------------------
|
||||
4 > (a: string): string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (58 to 82) SpanInfo: undefined
|
||||
--------------------------------
|
||||
5 > new (a: string): I;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (83 to 106) SpanInfo: undefined
|
||||
--------------------------------
|
||||
6 > [a: number]: number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (107 to 131) SpanInfo: undefined
|
||||
--------------------------------
|
||||
7 >}
|
||||
|
||||
~~ => Pos: (132 to 133) SpanInfo: undefined
|
||||
--------------------------------
|
||||
8 >module m {
|
||||
|
||||
~~~~~~~~~~~ => Pos: (134 to 144) SpanInfo: undefined
|
||||
--------------------------------
|
||||
9 > interface I1 {
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~ => Pos: (145 to 163) SpanInfo: undefined
|
||||
--------------------------------
|
||||
10 > property: string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (164 to 189) SpanInfo: undefined
|
||||
--------------------------------
|
||||
11 > method(): number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (190 to 215) SpanInfo: undefined
|
||||
--------------------------------
|
||||
12 > (a: string): string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (216 to 244) SpanInfo: undefined
|
||||
--------------------------------
|
||||
13 > new (a: string): I;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (245 to 272) SpanInfo: undefined
|
||||
--------------------------------
|
||||
14 > [a: number]: number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (273 to 301) SpanInfo: undefined
|
||||
--------------------------------
|
||||
15 > }
|
||||
|
||||
~~~~~~ => Pos: (302 to 307) SpanInfo: undefined
|
||||
--------------------------------
|
||||
16 > export interface I2 {
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (308 to 333) SpanInfo: undefined
|
||||
--------------------------------
|
||||
17 > property: string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (334 to 359) SpanInfo: undefined
|
||||
--------------------------------
|
||||
18 > method(): number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (360 to 385) SpanInfo: undefined
|
||||
--------------------------------
|
||||
19 > (a: string): string;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (386 to 414) SpanInfo: undefined
|
||||
--------------------------------
|
||||
20 > new (a: string): I;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (415 to 442) SpanInfo: undefined
|
||||
--------------------------------
|
||||
21 > [a: number]: number;
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ => Pos: (443 to 471) SpanInfo: undefined
|
||||
--------------------------------
|
||||
22 > }
|
||||
|
||||
~~~~~~ => Pos: (472 to 477) SpanInfo: undefined
|
||||
--------------------------------
|
||||
23 >}
|
||||
~ => Pos: (478 to 478) SpanInfo: {"start":478,"length":1}
|
||||
>}
|
||||
>:=> (line 23, col 0) to (line 23, col 1)
|
||||
29
tests/cases/fourslash/breakpointValidationInterface.ts
Normal file
29
tests/cases/fourslash/breakpointValidationInterface.ts
Normal file
@ -0,0 +1,29 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @BaselineFile: bpSpan_interface.baseline
|
||||
// @Filename: bpSpan_interface.ts
|
||||
////interface I {
|
||||
//// property: string;
|
||||
//// method(): number;
|
||||
//// (a: string): string;
|
||||
//// new (a: string): I;
|
||||
//// [a: number]: number;
|
||||
////}
|
||||
////module m {
|
||||
//// interface I1 {
|
||||
//// property: string;
|
||||
//// method(): number;
|
||||
//// (a: string): string;
|
||||
//// new (a: string): I;
|
||||
//// [a: number]: number;
|
||||
//// }
|
||||
//// export interface I2 {
|
||||
//// property: string;
|
||||
//// method(): number;
|
||||
//// (a: string): string;
|
||||
//// new (a: string): I;
|
||||
//// [a: number]: number;
|
||||
//// }
|
||||
////}
|
||||
|
||||
verify.baselineCurrentFileBreakpointLocations();
|
||||
Loading…
x
Reference in New Issue
Block a user