diff --git a/src/services/breakpoints.ts b/src/services/breakpoints.ts index a7527d92614..1bb1fafeb35 100644 --- a/src/services/breakpoints.ts +++ b/src/services/breakpoints.ts @@ -179,6 +179,10 @@ module ts.BreakpointResolver { case SyntaxKind.WithStatement: return spanInWithStatement(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 diff --git a/tests/baselines/reference/bpSpan_interface.baseline b/tests/baselines/reference/bpSpan_interface.baseline new file mode 100644 index 00000000000..81d2bac4867 --- /dev/null +++ b/tests/baselines/reference/bpSpan_interface.baseline @@ -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) \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationInterface.ts b/tests/cases/fourslash/breakpointValidationInterface.ts new file mode 100644 index 00000000000..07c34190fa8 --- /dev/null +++ b/tests/cases/fourslash/breakpointValidationInterface.ts @@ -0,0 +1,29 @@ +/// + +// @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(); \ No newline at end of file