diff --git a/tests/cases/fourslash/addDeclareToModule.ts b/tests/cases/fourslash/addDeclareToModule.ts index 428ee468411..3be95a03eea 100644 --- a/tests/cases/fourslash/addDeclareToModule.ts +++ b/tests/cases/fourslash/addDeclareToModule.ts @@ -1,8 +1,8 @@ -/// - -//// /**/module mAmbient { -//// module m3 { } -//// } - -goTo.marker(''); -edit.insert("declare "); +/// + +//// /**/module mAmbient { +//// module m3 { } +//// } + +goTo.marker(''); +edit.insert("declare "); diff --git a/tests/cases/fourslash/addDuplicateSetter.ts b/tests/cases/fourslash/addDuplicateSetter.ts index 0f3ed110f3b..339c30d68a1 100644 --- a/tests/cases/fourslash/addDuplicateSetter.ts +++ b/tests/cases/fourslash/addDuplicateSetter.ts @@ -1,10 +1,10 @@ -/// - -//// class C { -//// set foo(value) { } -//// /**/ -//// } - -goTo.marker(); -edit.insert("set foo(value) { }"); - +/// + +//// class C { +//// set foo(value) { } +//// /**/ +//// } + +goTo.marker(); +edit.insert("set foo(value) { }"); + diff --git a/tests/cases/fourslash/addFunctionInDuplicatedConstructorClassBody.ts b/tests/cases/fourslash/addFunctionInDuplicatedConstructorClassBody.ts index adbdd4820a0..383f96b4f28 100644 --- a/tests/cases/fourslash/addFunctionInDuplicatedConstructorClassBody.ts +++ b/tests/cases/fourslash/addFunctionInDuplicatedConstructorClassBody.ts @@ -1,12 +1,12 @@ -/// - -//// class Foo { -//// constructor() { } -//// constructor() { } -//// /**/ -//// } - -goTo.marker(); -var func = 'fn() { }'; -edit.insert(func); -verify.numberOfErrorsInCurrentFile(2); +/// + +//// class Foo { +//// constructor() { } +//// constructor() { } +//// /**/ +//// } + +goTo.marker(); +var func = 'fn() { }'; +edit.insert(func); +verify.numberOfErrorsInCurrentFile(2); diff --git a/tests/cases/fourslash/addInterfaceMemberAboveClass.ts b/tests/cases/fourslash/addInterfaceMemberAboveClass.ts index 7da128c02be..0f131d0c925 100644 --- a/tests/cases/fourslash/addInterfaceMemberAboveClass.ts +++ b/tests/cases/fourslash/addInterfaceMemberAboveClass.ts @@ -1,21 +1,21 @@ -/// - -//// -//// interface Intersection { -//// /*insertHere*/ -//// } -//// interface Scene { } -//// class /*className*/Sphere { -//// constructor() { -//// } -//// } - -goTo.marker('className'); -verify.quickInfoIs('class Sphere'); - -goTo.marker('insertHere'); -edit.insert("ray: Ray;"); - -goTo.marker('className'); - +/// + +//// +//// interface Intersection { +//// /*insertHere*/ +//// } +//// interface Scene { } +//// class /*className*/Sphere { +//// constructor() { +//// } +//// } + +goTo.marker('className'); +verify.quickInfoIs('class Sphere'); + +goTo.marker('insertHere'); +edit.insert("ray: Ray;"); + +goTo.marker('className'); + verify.quickInfoIs('class Sphere'); \ No newline at end of file diff --git a/tests/cases/fourslash/addInterfaceToNotSatisfyConstraint.ts b/tests/cases/fourslash/addInterfaceToNotSatisfyConstraint.ts index bafc8cf3049..a04ba99b654 100644 --- a/tests/cases/fourslash/addInterfaceToNotSatisfyConstraint.ts +++ b/tests/cases/fourslash/addInterfaceToNotSatisfyConstraint.ts @@ -1,14 +1,14 @@ -/// - -//// interface A { -//// a: number; -//// } -//// /**/ -//// interface C { -//// x: T; -//// } -//// -//// var v2: C; // should not work - -goTo.marker(); -edit.insert("interface B { b: string; }"); +/// + +//// interface A { +//// a: number; +//// } +//// /**/ +//// interface C { +//// x: T; +//// } +//// +//// var v2: C; // should not work + +goTo.marker(); +edit.insert("interface B { b: string; }"); diff --git a/tests/cases/fourslash/addMemberToInterface.ts b/tests/cases/fourslash/addMemberToInterface.ts index cc0ecbdb361..ab0f99e4683 100644 --- a/tests/cases/fourslash/addMemberToInterface.ts +++ b/tests/cases/fourslash/addMemberToInterface.ts @@ -1,20 +1,20 @@ -/// - -//// -//// module /*check*/Mod{ -//// } -//// -//// interface MyInterface { -//// /*insert*/ -//// } - -edit.disableFormatting(); - -goTo.marker('check'); -verify.quickInfoIs('module Mod'); - -goTo.marker('insert'); -edit.insert("x: number;\n"); - -goTo.marker('check'); -verify.quickInfoIs('module Mod'); +/// + +//// +//// module /*check*/Mod{ +//// } +//// +//// interface MyInterface { +//// /*insert*/ +//// } + +edit.disableFormatting(); + +goTo.marker('check'); +verify.quickInfoIs('module Mod'); + +goTo.marker('insert'); +edit.insert("x: number;\n"); + +goTo.marker('check'); +verify.quickInfoIs('module Mod'); diff --git a/tests/cases/fourslash/addMethodToInterface1.ts b/tests/cases/fourslash/addMethodToInterface1.ts index 07cd4700583..0bedbe634fb 100644 --- a/tests/cases/fourslash/addMethodToInterface1.ts +++ b/tests/cases/fourslash/addMethodToInterface1.ts @@ -1,14 +1,14 @@ -/// - -//// interface Comparable { -//// /*1*/} -//// interface Comparer { -//// } -//// var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; -//// var maxResult = max2(1); - -edit.disableFormatting(); - -goTo.marker('1'); - -edit.insert(" compareTo(): number;\n"); +/// + +//// interface Comparable { +//// /*1*/} +//// interface Comparer { +//// } +//// var max2: Comparer = (x, y) => { return (x.compareTo(y) > 0) ? x : y }; +//// var maxResult = max2(1); + +edit.disableFormatting(); + +goTo.marker('1'); + +edit.insert(" compareTo(): number;\n"); diff --git a/tests/cases/fourslash/addVarToConstructor1.ts b/tests/cases/fourslash/addVarToConstructor1.ts index 986de53f009..31eedf88be5 100644 --- a/tests/cases/fourslash/addVarToConstructor1.ts +++ b/tests/cases/fourslash/addVarToConstructor1.ts @@ -1,24 +1,24 @@ -/// - -//// -//// //_modes. // produces an internal error - please implement in derived class -//// -//// module editor { -//// import modes = _modes; -//// -//// var i : modes.IMode; -//// -//// // If you just use p1:modes, the compiler accepts it - should be an error -//// class Bg { -//// constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported -//// /*1*/} -//// -//// } -//// } -//// - -edit.disableFormatting(); - -goTo.marker('1'); - -edit.insert(" var x:modes.Mode;\n"); +/// + +//// +//// //_modes. // produces an internal error - please implement in derived class +//// +//// module editor { +//// import modes = _modes; +//// +//// var i : modes.IMode; +//// +//// // If you just use p1:modes, the compiler accepts it - should be an error +//// class Bg { +//// constructor(p1: modes, p2: modes.Mode) {// should be an error on p2 - it's not exported +//// /*1*/} +//// +//// } +//// } +//// + +edit.disableFormatting(); + +goTo.marker('1'); + +edit.insert(" var x:modes.Mode;\n"); diff --git a/tests/cases/fourslash/alignmentAfterFormattingOnMultilineExpressionAndParametersList.ts b/tests/cases/fourslash/alignmentAfterFormattingOnMultilineExpressionAndParametersList.ts index 0b50612d454..c202aa00a53 100644 --- a/tests/cases/fourslash/alignmentAfterFormattingOnMultilineExpressionAndParametersList.ts +++ b/tests/cases/fourslash/alignmentAfterFormattingOnMultilineExpressionAndParametersList.ts @@ -1,25 +1,25 @@ -/// - -////class TestClass { -//// private testMethod1(param1: boolean, -//// param2/*1*/: boolean) { -//// } -//// -//// public testMethod2(a: number, b: number, c: number) { -//// if (a === b) { -//// } -//// else if (a != c && -//// a/*2*/ > b && -//// b/*3*/ < c) { -//// } -//// -//// } -////} - -format.document(); -goTo.marker("1"); -verify.indentationIs(8); -goTo.marker("2"); -verify.indentationIs(12); -goTo.marker("3"); -verify.indentationIs(12); +/// + +////class TestClass { +//// private testMethod1(param1: boolean, +//// param2/*1*/: boolean) { +//// } +//// +//// public testMethod2(a: number, b: number, c: number) { +//// if (a === b) { +//// } +//// else if (a != c && +//// a/*2*/ > b && +//// b/*3*/ < c) { +//// } +//// +//// } +////} + +format.document(); +goTo.marker("1"); +verify.indentationIs(8); +goTo.marker("2"); +verify.indentationIs(12); +goTo.marker("3"); +verify.indentationIs(12); diff --git a/tests/cases/fourslash/argumentsAreAvailableAfterEditsAtEndOfFunction.ts b/tests/cases/fourslash/argumentsAreAvailableAfterEditsAtEndOfFunction.ts index e3ab1388514..8a1efef397e 100644 --- a/tests/cases/fourslash/argumentsAreAvailableAfterEditsAtEndOfFunction.ts +++ b/tests/cases/fourslash/argumentsAreAvailableAfterEditsAtEndOfFunction.ts @@ -1,15 +1,15 @@ -/// - -////module Test1 { -//// class Person { -//// children: string[]; -//// constructor(public name: string, children: string[]) { -//// /**/ -//// } -//// } -////} - -goTo.marker(); -var text = "this.children = ch"; -edit.insert(text); +/// + +////module Test1 { +//// class Person { +//// children: string[]; +//// constructor(public name: string, children: string[]) { +//// /**/ +//// } +//// } +////} + +goTo.marker(); +var text = "this.children = ch"; +edit.insert(text); verify.completionListContains("children", "(parameter) children: string[]"); \ No newline at end of file diff --git a/tests/cases/fourslash/argumentsIndexExpression.ts b/tests/cases/fourslash/argumentsIndexExpression.ts index 6f54a766764..bda0c23e488 100644 --- a/tests/cases/fourslash/argumentsIndexExpression.ts +++ b/tests/cases/fourslash/argumentsIndexExpression.ts @@ -1,8 +1,8 @@ -/// - -//// function f() { -//// var x = /**/arguments[0]; -//// } - -goTo.marker(); -verify.quickInfoExists(); +/// + +//// function f() { +//// var x = /**/arguments[0]; +//// } + +goTo.marker(); +verify.quickInfoExists(); diff --git a/tests/cases/fourslash/arrayConcatTypeCheck0.ts b/tests/cases/fourslash/arrayConcatTypeCheck0.ts index 9250eb5b6fd..7361f3c9e84 100644 --- a/tests/cases/fourslash/arrayConcatTypeCheck0.ts +++ b/tests/cases/fourslash/arrayConcatTypeCheck0.ts @@ -1,16 +1,16 @@ -/// - -//// var a = []; -//// a.concat("hello"/*1*/); -//// -//// a.concat('Hello'); -//// -//// var b = new Array(); -//// b.concat('hello'); -//// - -edit.disableFormatting(); - -goTo.marker('1'); - -edit.insert(", 'world'"); +/// + +//// var a = []; +//// a.concat("hello"/*1*/); +//// +//// a.concat('Hello'); +//// +//// var b = new Array(); +//// b.concat('hello'); +//// + +edit.disableFormatting(); + +goTo.marker('1'); + +edit.insert(", 'world'"); diff --git a/tests/cases/fourslash/arrayConcatTypeCheck1.ts b/tests/cases/fourslash/arrayConcatTypeCheck1.ts index c62bd5b7f14..9d7de1704ab 100644 --- a/tests/cases/fourslash/arrayConcatTypeCheck1.ts +++ b/tests/cases/fourslash/arrayConcatTypeCheck1.ts @@ -1,26 +1,26 @@ -/// - -//// a.concat(/*2*/"hello"/*1*/, 'world'); -//// -//// a.concat(/*3*/'Hello'); -//// -//// var b = new Array/*4*/<>(); -//// b.concat('hello'); -//// - -edit.disableFormatting(); - -goTo.marker('1'); - -edit.deleteAtCaret(9); - -goTo.marker('3'); - -edit.deleteAtCaret(7); - -goTo.marker('2'); - -edit.deleteAtCaret(7); - -goTo.marker('4'); - +/// + +//// a.concat(/*2*/"hello"/*1*/, 'world'); +//// +//// a.concat(/*3*/'Hello'); +//// +//// var b = new Array/*4*/<>(); +//// b.concat('hello'); +//// + +edit.disableFormatting(); + +goTo.marker('1'); + +edit.deleteAtCaret(9); + +goTo.marker('3'); + +edit.deleteAtCaret(7); + +goTo.marker('2'); + +edit.deleteAtCaret(7); + +goTo.marker('4'); + diff --git a/tests/cases/fourslash/autoFormattingOnPasting.ts b/tests/cases/fourslash/autoFormattingOnPasting.ts index cee2be4bec8..0c7f471d43d 100644 --- a/tests/cases/fourslash/autoFormattingOnPasting.ts +++ b/tests/cases/fourslash/autoFormattingOnPasting.ts @@ -1,28 +1,28 @@ -/// - -////module TestModule { -/////**/ -////} -goTo.marker(""); -edit.paste(" class TestClass{\r\n\ -private foo;\r\n\ -public testMethod( )\r\n\ -{}\r\n\ -}"); -// We're missing scenarios of formatting option settings due to bug 693273 - [TypeScript] Need to improve fourslash support for formatting options. -// Missing scenario ** Uncheck Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** -//verify.currentFileContentIs("module TestModule {\r\n\ -// class TestClass{\r\n\ -//private foo;\r\n\ -//public testMethod( )\r\n\ -//{}\r\n\ -//}\r\n\ -//}"); -// Missing scenario ** Check Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** -verify.currentFileContentIs("module TestModule {\r\n\ - class TestClass {\r\n\ - private foo;\r\n\ - public testMethod()\r\n\ - { }\r\n\ - }\r\n\ +/// + +////module TestModule { +/////**/ +////} +goTo.marker(""); +edit.paste(" class TestClass{\r\n\ +private foo;\r\n\ +public testMethod( )\r\n\ +{}\r\n\ +}"); +// We're missing scenarios of formatting option settings due to bug 693273 - [TypeScript] Need to improve fourslash support for formatting options. +// Missing scenario ** Uncheck Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** +//verify.currentFileContentIs("module TestModule {\r\n\ +// class TestClass{\r\n\ +//private foo;\r\n\ +//public testMethod( )\r\n\ +//{}\r\n\ +//}\r\n\ +//}"); +// Missing scenario ** Check Tools->Options->Text Editor->TypeScript->Formatting->General->Format on paste ** +verify.currentFileContentIs("module TestModule {\r\n\ + class TestClass {\r\n\ + private foo;\r\n\ + public testMethod()\r\n\ + { }\r\n\ + }\r\n\ }"); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationClass.ts b/tests/cases/fourslash/breakpointValidationClass.ts index 99209c465b2..112c89dbb7c 100644 --- a/tests/cases/fourslash/breakpointValidationClass.ts +++ b/tests/cases/fourslash/breakpointValidationClass.ts @@ -19,7 +19,7 @@ //// set greetings(greetings: string) { //// this.greeting = greetings; //// } -////} +////} ////class Greeter2 { ////} ////class Greeter1 @@ -45,9 +45,9 @@ //// { //// this.greeting = greetings; //// } -////} +////} ////class Greeter12 ////{ ////} - + verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationClassAmbient.ts b/tests/cases/fourslash/breakpointValidationClassAmbient.ts index ab0b78003ac..4e6d0bb0afe 100644 --- a/tests/cases/fourslash/breakpointValidationClassAmbient.ts +++ b/tests/cases/fourslash/breakpointValidationClassAmbient.ts @@ -9,6 +9,6 @@ //// private val; //// static x: number; //// static fn(a: number, ...b:string[]); -////} +////} verify.baselineCurrentFileBreakpointLocations(); \ No newline at end of file diff --git a/tests/cases/fourslash/breakpointValidationClasses.ts b/tests/cases/fourslash/breakpointValidationClasses.ts index 286001cfee6..8ffe62e30e7 100644 --- a/tests/cases/fourslash/breakpointValidationClasses.ts +++ b/tests/cases/fourslash/breakpointValidationClasses.ts @@ -3,37 +3,37 @@ // @BaselineFile: bpSpan_classes.baseline // @Filename: bpSpan_classes.ts ////module Foo.Bar { -//// "use strict"; -//// +//// "use strict"; +//// //// class Greeter { //// constructor(public greeting: string) { //// } -//// +//// //// greet() { //// return "

" + this.greeting + "

"; //// } -//// } -//// -//// +//// } +//// +//// //// function foo(greeting: string): Greeter { //// return new Greeter(greeting); -//// } -//// -//// var greeter = new Greeter("Hello, world!"); -//// var str = greeter.greet(); -//// +//// } +//// +//// var greeter = new Greeter("Hello, world!"); +//// var str = greeter.greet(); +//// //// function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { //// var greeters: Greeter[] = []; /* inline block comment */ //// greeters[0] = new Greeter(greeting); //// for (var i = 0; i < restGreetings.length; i++) { //// greeters.push(new Greeter(restGreetings[i])); //// } -//// +//// //// return greeters; -//// } -//// -//// var b = foo2("Hello", "World", "!"); -//// // This is simple signle line comment +//// } +//// +//// var b = foo2("Hello", "World", "!"); +//// // This is simple signle line comment //// for (var j = 0; j < b.length; j++) { //// b[j].greet(); //// } diff --git a/tests/cases/fourslash/brokenClassErrorRecovery.ts b/tests/cases/fourslash/brokenClassErrorRecovery.ts index f5badafaef2..7dafaafeb06 100644 --- a/tests/cases/fourslash/brokenClassErrorRecovery.ts +++ b/tests/cases/fourslash/brokenClassErrorRecovery.ts @@ -1,10 +1,10 @@ -/// - -////class Foo { -//// constructor() { var x = [1, 2, 3 } -////} -/////**/ -////var bar = new Foo(); - -verify.not.errorExistsAfterMarker(); - +/// + +////class Foo { +//// constructor() { var x = [1, 2, 3 } +////} +/////**/ +////var bar = new Foo(); + +verify.not.errorExistsAfterMarker(); + diff --git a/tests/cases/fourslash/classExtendsInterfaceSigHelp1.ts b/tests/cases/fourslash/classExtendsInterfaceSigHelp1.ts index ebdccef485f..c2b4d5e70a0 100644 --- a/tests/cases/fourslash/classExtendsInterfaceSigHelp1.ts +++ b/tests/cases/fourslash/classExtendsInterfaceSigHelp1.ts @@ -11,8 +11,8 @@ ////} ////var i: I; -////i.foo(/**/ - -goTo.marker(); -verify.signatureHelpCountIs(2); +////i.foo(/**/ + +goTo.marker(); +verify.signatureHelpCountIs(2); verify.currentParameterSpanIs('x: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/classRenamingErrorRecovery.ts b/tests/cases/fourslash/classRenamingErrorRecovery.ts index eabc9c748a6..c95d112cdc5 100644 --- a/tests/cases/fourslash/classRenamingErrorRecovery.ts +++ b/tests/cases/fourslash/classRenamingErrorRecovery.ts @@ -1,9 +1,9 @@ -/// - -////class Foo/*1*//*2*/ { public Bar() { } } - -goTo.marker("1"); -edit.backspace(3); -edit.insert("Pizza"); -verify.currentLineContentIs("class Pizza { public Bar() { } }"); +/// + +////class Foo/*1*//*2*/ { public Bar() { } } + +goTo.marker("1"); +edit.backspace(3); +edit.insert("Pizza"); +verify.currentLineContentIs("class Pizza { public Bar() { } }"); verify.not.errorExistsAfterMarker("2"); \ No newline at end of file diff --git a/tests/cases/fourslash/closedCommentsInConstructor.ts b/tests/cases/fourslash/closedCommentsInConstructor.ts index 6ab5c4b9811..8a168a58354 100644 --- a/tests/cases/fourslash/closedCommentsInConstructor.ts +++ b/tests/cases/fourslash/closedCommentsInConstructor.ts @@ -1,8 +1,8 @@ -/// - -////class Foo { -//// constructor(/* /**/ */) { } -////} - -goTo.marker(); +/// + +////class Foo { +//// constructor(/* /**/ */) { } +////} + +goTo.marker(); verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAfterClassExtends.ts b/tests/cases/fourslash/completionListAfterClassExtends.ts index 37eb476eff1..15a3e261768 100644 --- a/tests/cases/fourslash/completionListAfterClassExtends.ts +++ b/tests/cases/fourslash/completionListAfterClassExtends.ts @@ -1,16 +1,16 @@ -/// - -////module Bar { -//// export class Bleah { -//// } -//// export class Foo extends /**/Bleah { -//// } -////} -//// -////function Blah(x: Bar.Bleah) { -////} - -goTo.marker(); -verify.completionListContains("Bar"); -verify.completionListContains("Bleah"); +/// + +////module Bar { +//// export class Bleah { +//// } +//// export class Foo extends /**/Bleah { +//// } +////} +//// +////function Blah(x: Bar.Bleah) { +////} + +goTo.marker(); +verify.completionListContains("Bar"); +verify.completionListContains("Bleah"); verify.completionListContains("Foo"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts index 6c2288afb68..c3ee033bf54 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedDot.ts @@ -1,18 +1,18 @@ -/// - -////module M { -//// export class C { public pub = 0; private priv = 1; } -//// export var V = 0; -////} -//// -//// -////var c = new M.C(); -//// -////c. // test on c. -//// -//////Test for comment -//////c./**/ - -goTo.marker(); -verify.completionListIsEmpty(); +/// + +////module M { +//// export class C { public pub = 0; private priv = 1; } +//// export var V = 0; +////} +//// +//// +////var c = new M.C(); +//// +////c. // test on c. +//// +//////Test for comment +//////c./**/ + +goTo.marker(); +verify.completionListIsEmpty(); verify.memberListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedLine.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedLine.ts index 500f0bc8585..96eac09b6ff 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedLine.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedLine.ts @@ -1,7 +1,7 @@ -/// - -////// /**/ -////var - -goTo.marker(); +/// + +////// /**/ +////var + +goTo.marker(); verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts b/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts index 2e30851ea1f..f0287a0baea 100644 --- a/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts +++ b/tests/cases/fourslash/completionListAndMemberListOnCommentedWhiteSpace.ts @@ -1,18 +1,18 @@ -/// - -////module M { -//// export class C { public pub = 0; private priv = 1; } -//// export var V = 0; -////} -//// -//// -////var c = new M.C(); -//// -////c. // test on c. -//// -//////Test for comment -//////c. /**/ - -goTo.marker(); -verify.completionListIsEmpty(); +/// + +////module M { +//// export class C { public pub = 0; private priv = 1; } +//// export var V = 0; +////} +//// +//// +////var c = new M.C(); +//// +////c. // test on c. +//// +//////Test for comment +//////c. /**/ + +goTo.marker(); +verify.completionListIsEmpty(); verify.memberListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAtDeclarationOfParameterType.ts b/tests/cases/fourslash/completionListAtDeclarationOfParameterType.ts index fcc40d8ee5d..94de51cc9a3 100644 --- a/tests/cases/fourslash/completionListAtDeclarationOfParameterType.ts +++ b/tests/cases/fourslash/completionListAtDeclarationOfParameterType.ts @@ -1,14 +1,14 @@ -/// - -////module Bar { -//// export class Bleah { -//// } -//// export class Foo extends Bleah { -//// } -////} -//// -////function Blah(x: /**/Bar.Bleah) { -////} - -goTo.marker(); +/// + +////module Bar { +//// export class Bleah { +//// } +//// export class Foo extends Bleah { +//// } +////} +//// +////function Blah(x: /**/Bar.Bleah) { +////} + +goTo.marker(); verify.completionListContains("Bar"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_destructuring.ts b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_destructuring.ts index 143c884e177..0812cb138d2 100644 --- a/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_destructuring.ts +++ b/tests/cases/fourslash/completionListAtIdentifierDefinitionLocations_destructuring.ts @@ -1,22 +1,22 @@ -/// - -//// var [x/*variable1*/ - -//// var [x, y/*variable2*/ - -//// var [./*variable3*/ - -//// var [x, ...z/*variable4*/ - -//// var {x/*variable5*/ - -//// var {x, y/*variable6*/ - -//// function func1({ a/*parameter1*/ - -//// function func2({ a, b/*parameter2*/ - -test.markers().forEach((m) => { - goTo.position(m.position, m.fileName); - verify.completionListIsEmpty(); -}); +/// + +//// var [x/*variable1*/ + +//// var [x, y/*variable2*/ + +//// var [./*variable3*/ + +//// var [x, ...z/*variable4*/ + +//// var {x/*variable5*/ + +//// var {x, y/*variable6*/ + +//// function func1({ a/*parameter1*/ + +//// function func2({ a, b/*parameter2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListIsEmpty(); +}); diff --git a/tests/cases/fourslash/completionListBuilderLocations_VariableDeclarations.ts b/tests/cases/fourslash/completionListBuilderLocations_VariableDeclarations.ts index 45f16090fd8..d069b9a722e 100644 --- a/tests/cases/fourslash/completionListBuilderLocations_VariableDeclarations.ts +++ b/tests/cases/fourslash/completionListBuilderLocations_VariableDeclarations.ts @@ -1,34 +1,34 @@ -/// - -////var x = a/*var1*/ - -////var x = (b/*var2*/ - -////var x = (c, d/*var3*/ - -//// var y : any = "", x = a/*var4*/ - -//// var y : any = "", x = (a/*var5*/ - -////class C{} -////var y = new C( - -//// class C{} -//// var y = new C(0, /*var7*/ - -////var y = [/*var8*/ - -////var y = [0, /*var9*/ - -////var y = `${/*var10*/ - -////var y = `${10} dd ${ /*var11*/ - -////var y = 10; y=/*var12*/ - -test.markers().forEach((m) => { - goTo.position(m.position, m.fileName); - verify.completionListAllowsNewIdentifier(); -}); - - +/// + +////var x = a/*var1*/ + +////var x = (b/*var2*/ + +////var x = (c, d/*var3*/ + +//// var y : any = "", x = a/*var4*/ + +//// var y : any = "", x = (a/*var5*/ + +////class C{} +////var y = new C( + +//// class C{} +//// var y = new C(0, /*var7*/ + +////var y = [/*var8*/ + +////var y = [0, /*var9*/ + +////var y = `${/*var10*/ + +////var y = `${10} dd ${ /*var11*/ + +////var y = 10; y=/*var12*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.completionListAllowsNewIdentifier(); +}); + + diff --git a/tests/cases/fourslash/completionListCladule.ts b/tests/cases/fourslash/completionListCladule.ts index 372e5efa219..79c2e8aea6d 100644 --- a/tests/cases/fourslash/completionListCladule.ts +++ b/tests/cases/fourslash/completionListCladule.ts @@ -1,4 +1,4 @@ -/// +/// ////class Foo { //// doStuff(): number { return 0; } diff --git a/tests/cases/fourslash/completionListErrorRecovery.ts b/tests/cases/fourslash/completionListErrorRecovery.ts index b71212061cf..7a7b9f81ca1 100644 --- a/tests/cases/fourslash/completionListErrorRecovery.ts +++ b/tests/cases/fourslash/completionListErrorRecovery.ts @@ -1,13 +1,13 @@ -/// - -////class Foo { static fun() { }; } - -////Foo./**/; -/////*1*/var bar; - +/// + +////class Foo { static fun() { }; } + +////Foo./**/; +/////*1*/var bar; + // this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker(); -verify.memberListContains("fun"); +edit.insert(''); + +goTo.marker(); +verify.memberListContains("fun"); verify.not.errorExistsAfterMarker("1"); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListErrorRecovery2.ts b/tests/cases/fourslash/completionListErrorRecovery2.ts index d2411dfd90c..8a368ba4466 100644 --- a/tests/cases/fourslash/completionListErrorRecovery2.ts +++ b/tests/cases/fourslash/completionListErrorRecovery2.ts @@ -1,12 +1,12 @@ -/// - -////class Foo { static bar() { return "x"; } } -////var baz = Foo/**/; -/////*1*/baz.concat("y"); - +/// + +////class Foo { static bar() { return "x"; } } +////var baz = Foo/**/; +/////*1*/baz.concat("y"); + // this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker(); -edit.insert(".b"); -verify.not.errorExistsAfterMarker("1"); +edit.insert(''); + +goTo.marker(); +edit.insert(".b"); +verify.not.errorExistsAfterMarker("1"); diff --git a/tests/cases/fourslash/completionListFunctionMembers.ts b/tests/cases/fourslash/completionListFunctionMembers.ts index 6f4e2bf6069..c24dff1bee2 100644 --- a/tests/cases/fourslash/completionListFunctionMembers.ts +++ b/tests/cases/fourslash/completionListFunctionMembers.ts @@ -1,11 +1,11 @@ -/// - -////function fnc1() { -//// var bar = 1; -//// function foob(){ } -////} -//// -////fnc1./**/ - -goTo.marker(); +/// + +////function fnc1() { +//// var bar = 1; +//// function foob(){ } +////} +//// +////fnc1./**/ + +goTo.marker(); verify.memberListContains('arguments', '(property) Function.arguments: any'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInstanceProtectedMembers.ts b/tests/cases/fourslash/completionListInstanceProtectedMembers.ts index de09f059680..996bef7077b 100644 --- a/tests/cases/fourslash/completionListInstanceProtectedMembers.ts +++ b/tests/cases/fourslash/completionListInstanceProtectedMembers.ts @@ -1,63 +1,63 @@ -/// - -////class Base { -//// private privateMethod() { } -//// private privateProperty; -//// -//// protected protectedMethod() { } -//// protected protectedProperty; -//// -//// public publicMethod() { } -//// public publicProperty; -//// -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -//// -//// test() { -//// this./*1*/; -//// -//// var b: Base; -//// var c: C1; -//// -//// b./*2*/; -//// c./*3*/; -//// } -////} -//// -////class C1 extends Base { -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -////} - - -// Same class, everything is visible -goTo.marker("1"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -goTo.marker("2"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -// Can not access protected properties overridden in subclass -goTo.marker("3"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); +/// + +////class Base { +//// private privateMethod() { } +//// private privateProperty; +//// +//// protected protectedMethod() { } +//// protected protectedProperty; +//// +//// public publicMethod() { } +//// public publicProperty; +//// +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +//// +//// test() { +//// this./*1*/; +//// +//// var b: Base; +//// var c: C1; +//// +//// b./*2*/; +//// c./*3*/; +//// } +////} +//// +////class C1 extends Base { +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +////} + + +// Same class, everything is visible +goTo.marker("1"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +goTo.marker("2"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +// Can not access protected properties overridden in subclass +goTo.marker("3"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListInstanceProtectedMembers2.ts b/tests/cases/fourslash/completionListInstanceProtectedMembers2.ts index 72b6f3a1f7b..c074bc06314 100644 --- a/tests/cases/fourslash/completionListInstanceProtectedMembers2.ts +++ b/tests/cases/fourslash/completionListInstanceProtectedMembers2.ts @@ -1,76 +1,76 @@ -/// - -////class Base { -//// private privateMethod() { } -//// private privateProperty; -//// -//// protected protectedMethod() { } -//// protected protectedProperty; -//// -//// public publicMethod() { } -//// public publicProperty; -//// -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -////} -//// -////class C1 extends Base { -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -//// -//// test() { -//// this./*1*/; -//// super./*2*/; -//// -//// var b: Base; -//// var c: C1; -//// -//// b./*3*/; -//// c./*4*/; -//// } -////} - - -// Same class, everything is visible -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -// Can not access properties on super -goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.not.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); - -// Can not access protected properties through base class -goTo.marker("3"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); - -// Same class, everything is visible -goTo.marker("4"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +/// + +////class Base { +//// private privateMethod() { } +//// private privateProperty; +//// +//// protected protectedMethod() { } +//// protected protectedProperty; +//// +//// public publicMethod() { } +//// public publicProperty; +//// +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +////} +//// +////class C1 extends Base { +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +//// +//// test() { +//// this./*1*/; +//// super./*2*/; +//// +//// var b: Base; +//// var c: C1; +//// +//// b./*3*/; +//// c./*4*/; +//// } +////} + + +// Same class, everything is visible +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +// Can not access properties on super +goTo.marker("2"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.not.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.not.memberListContains('protectedOverriddenProperty'); + +// Can not access protected properties through base class +goTo.marker("3"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); +verify.not.memberListContains('protectedOverriddenProperty'); + +// Same class, everything is visible +goTo.marker("4"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); diff --git a/tests/cases/fourslash/completionListInstanceProtectedMembers3.ts b/tests/cases/fourslash/completionListInstanceProtectedMembers3.ts index 2b3bf2ac2d9..c2956da8a40 100644 --- a/tests/cases/fourslash/completionListInstanceProtectedMembers3.ts +++ b/tests/cases/fourslash/completionListInstanceProtectedMembers3.ts @@ -1,46 +1,46 @@ -/// - -////class Base { -//// private privateMethod() { } -//// private privateProperty; -//// -//// protected protectedMethod() { } -//// protected protectedProperty; -//// -//// public publicMethod() { } -//// public publicProperty; -//// -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -////} -//// -////class C1 extends Base { -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -////} -//// -//// var b: Base; -//// var c: C1; -//// b./*1*/; -//// c./*2*/; - -// Only public properties are visible outside the class -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); - -goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); +/// + +////class Base { +//// private privateMethod() { } +//// private privateProperty; +//// +//// protected protectedMethod() { } +//// protected protectedProperty; +//// +//// public publicMethod() { } +//// public publicProperty; +//// +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +////} +//// +////class C1 extends Base { +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +////} +//// +//// var b: Base; +//// var c: C1; +//// b./*1*/; +//// c./*2*/; + +// Only public properties are visible outside the class +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); +verify.not.memberListContains('protectedOverriddenProperty'); + +goTo.marker("2"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); +verify.not.memberListContains('protectedOverriddenProperty'); diff --git a/tests/cases/fourslash/completionListInstanceProtectedMembers4.ts b/tests/cases/fourslash/completionListInstanceProtectedMembers4.ts index 27f9bb5a1cf..82593391fa1 100644 --- a/tests/cases/fourslash/completionListInstanceProtectedMembers4.ts +++ b/tests/cases/fourslash/completionListInstanceProtectedMembers4.ts @@ -1,34 +1,34 @@ -/// - -////class Base { -//// private privateMethod() { } -//// private privateProperty; -//// -//// protected protectedMethod() { } -//// protected protectedProperty; -//// -//// public publicMethod() { } -//// public publicProperty; -//// -//// protected protectedOverriddenMethod() { } -//// protected protectedOverriddenProperty; -////} -//// -////class C1 extends Base { -//// public protectedOverriddenMethod() { } -//// public protectedOverriddenProperty; -////} -//// -//// var c: C1; -//// c./*1*/ - - -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +/// + +////class Base { +//// private privateMethod() { } +//// private privateProperty; +//// +//// protected protectedMethod() { } +//// protected protectedProperty; +//// +//// public publicMethod() { } +//// public publicProperty; +//// +//// protected protectedOverriddenMethod() { } +//// protected protectedOverriddenProperty; +////} +//// +////class C1 extends Base { +//// public protectedOverriddenMethod() { } +//// public protectedOverriddenProperty; +////} +//// +//// var c: C1; +//// c./*1*/ + + +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); diff --git a/tests/cases/fourslash/completionListInvalidMemberNames2.ts b/tests/cases/fourslash/completionListInvalidMemberNames2.ts index cd8ff00df4a..b261f718480 100644 --- a/tests/cases/fourslash/completionListInvalidMemberNames2.ts +++ b/tests/cases/fourslash/completionListInvalidMemberNames2.ts @@ -1,4 +1,4 @@ -/// +/// ////enum Foo { //// X, Y, '☆' diff --git a/tests/cases/fourslash/completionListObjectMembers.ts b/tests/cases/fourslash/completionListObjectMembers.ts index cbddba61be5..5d66b31fa5d 100644 --- a/tests/cases/fourslash/completionListObjectMembers.ts +++ b/tests/cases/fourslash/completionListObjectMembers.ts @@ -7,8 +7,8 @@ //// bar: any; //// foo(bar: any): any; //// }; -////object./**/ - -goTo.marker(); -verify.memberListContains("bar", '(property) bar: any'); -verify.memberListContains("foo", '(method) foo(bar: any): any'); +////object./**/ + +goTo.marker(); +verify.memberListContains("bar", '(property) bar: any'); +verify.memberListContains("foo", '(method) foo(bar: any): any'); diff --git a/tests/cases/fourslash/completionListOnPrivateVariableInModule.ts b/tests/cases/fourslash/completionListOnPrivateVariableInModule.ts index 8eeee08767b..eecb5724d10 100644 --- a/tests/cases/fourslash/completionListOnPrivateVariableInModule.ts +++ b/tests/cases/fourslash/completionListOnPrivateVariableInModule.ts @@ -1,6 +1,6 @@ -/// - -//// module Foo { var testing = ""; test/**/ } - -goTo.marker(); +/// + +//// module Foo { var testing = ""; test/**/ } + +goTo.marker(); verify.completionListContains('testing', '(var) testing: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers.ts b/tests/cases/fourslash/completionListStaticProtectedMembers.ts index af56f28ef06..d72859570aa 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers.ts @@ -1,59 +1,59 @@ -/// - -////class Base { -//// private static privateMethod() { } -//// private static privateProperty; -//// -//// protected static protectedMethod() { } -//// protected static protectedProperty; -//// -//// public static publicMethod() { } -//// public static publicProperty; -//// -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -//// -//// static test() { -//// Base./*1*/; -//// this./*2*/; -//// C1./*3*/; -//// } -////} -//// -////class C1 extends Base { -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -////} - - -// Same class, everything is visible -goTo.marker("1"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -goTo.marker("2"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -// Can not access protected properties overridden in subclass -goTo.marker("3"); -verify.memberListContains('privateMethod'); -verify.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); +/// + +////class Base { +//// private static privateMethod() { } +//// private static privateProperty; +//// +//// protected static protectedMethod() { } +//// protected static protectedProperty; +//// +//// public static publicMethod() { } +//// public static publicProperty; +//// +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +//// +//// static test() { +//// Base./*1*/; +//// this./*2*/; +//// C1./*3*/; +//// } +////} +//// +////class C1 extends Base { +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +////} + + +// Same class, everything is visible +goTo.marker("1"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +goTo.marker("2"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +// Can not access protected properties overridden in subclass +goTo.marker("3"); +verify.memberListContains('privateMethod'); +verify.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers2.ts b/tests/cases/fourslash/completionListStaticProtectedMembers2.ts index 9964a91d21b..44cf9f73fd5 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers2.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers2.ts @@ -1,70 +1,70 @@ -/// - -////class Base { -//// private static privateMethod() { } -//// private static privateProperty; -//// -//// protected static protectedMethod() { } -//// protected static protectedProperty; -//// -//// public static publicMethod() { } -//// public static publicProperty; -//// -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -////} -//// -////class C2 extends Base { -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -//// -//// static test() { -//// Base./*1*/; -//// C2./*2*/; -//// this./*3*/; -//// super./*4*/; -//// } -////} - - -// Same class, everything is visible -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -goTo.marker("3"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -// only public and protected methods of the base class are accessible through super -goTo.marker("4"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.not.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); +/// + +////class Base { +//// private static privateMethod() { } +//// private static privateProperty; +//// +//// protected static protectedMethod() { } +//// protected static protectedProperty; +//// +//// public static publicMethod() { } +//// public static publicProperty; +//// +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +////} +//// +////class C2 extends Base { +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +//// +//// static test() { +//// Base./*1*/; +//// C2./*2*/; +//// this./*3*/; +//// super./*4*/; +//// } +////} + + +// Same class, everything is visible +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +goTo.marker("2"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +goTo.marker("3"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +// only public and protected methods of the base class are accessible through super +goTo.marker("4"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.not.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers3.ts b/tests/cases/fourslash/completionListStaticProtectedMembers3.ts index f80186c93c0..c955f23fa32 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers3.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers3.ts @@ -1,45 +1,45 @@ -/// - -////class Base { -//// private static privateMethod() { } -//// private static privateProperty; -//// -//// protected static protectedMethod() { } -//// protected static protectedProperty; -//// -//// public static publicMethod() { } -//// public static publicProperty; -//// -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -////} -//// -////class C3 extends Base { -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -////} -//// -////Base./*1*/; -////C3./*2*/; - - -// Only public properties are visible outside the class -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); -verify.not.memberListContains('protectedOverriddenProperty'); - -goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.not.memberListContains('protectedOverriddenMethod'); +/// + +////class Base { +//// private static privateMethod() { } +//// private static privateProperty; +//// +//// protected static protectedMethod() { } +//// protected static protectedProperty; +//// +//// public static publicMethod() { } +//// public static publicProperty; +//// +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +////} +//// +////class C3 extends Base { +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +////} +//// +////Base./*1*/; +////C3./*2*/; + + +// Only public properties are visible outside the class +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); +verify.not.memberListContains('protectedOverriddenProperty'); + +goTo.marker("2"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.not.memberListContains('protectedOverriddenMethod'); verify.not.memberListContains('protectedOverriddenProperty'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListStaticProtectedMembers4.ts b/tests/cases/fourslash/completionListStaticProtectedMembers4.ts index 72cc081f2fc..817d2c4829c 100644 --- a/tests/cases/fourslash/completionListStaticProtectedMembers4.ts +++ b/tests/cases/fourslash/completionListStaticProtectedMembers4.ts @@ -1,49 +1,49 @@ -/// - -////class Base { -//// private static privateMethod() { } -//// private static privateProperty; -//// -//// protected static protectedMethod() { } -//// protected static protectedProperty; -//// -//// public static publicMethod() { } -//// public static publicProperty; -//// -//// protected static protectedOverriddenMethod() { } -//// protected static protectedOverriddenProperty; -////} -//// -/////// Make the protected members public -////class C4 extends Base { -//// public static protectedOverriddenMethod() { } -//// public static protectedOverriddenProperty; -////} -////class Derived extends C4 { -//// test() { -//// Derived./*1*/ -//// } -////} -//// Derived./*2*/ - -// Sub class, everything but private is visible -goTo.marker("1"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.memberListContains('protectedMethod'); -verify.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); - -// Can see protected methods elevated to public -goTo.marker("2"); -verify.not.memberListContains('privateMethod'); -verify.not.memberListContains('privateProperty'); -verify.not.memberListContains('protectedMethod'); -verify.not.memberListContains('protectedProperty'); -verify.memberListContains('publicMethod'); -verify.memberListContains('publicProperty'); -verify.memberListContains('protectedOverriddenMethod'); -verify.memberListContains('protectedOverriddenProperty'); +/// + +////class Base { +//// private static privateMethod() { } +//// private static privateProperty; +//// +//// protected static protectedMethod() { } +//// protected static protectedProperty; +//// +//// public static publicMethod() { } +//// public static publicProperty; +//// +//// protected static protectedOverriddenMethod() { } +//// protected static protectedOverriddenProperty; +////} +//// +/////// Make the protected members public +////class C4 extends Base { +//// public static protectedOverriddenMethod() { } +//// public static protectedOverriddenProperty; +////} +////class Derived extends C4 { +//// test() { +//// Derived./*1*/ +//// } +////} +//// Derived./*2*/ + +// Sub class, everything but private is visible +goTo.marker("1"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.memberListContains('protectedMethod'); +verify.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); + +// Can see protected methods elevated to public +goTo.marker("2"); +verify.not.memberListContains('privateMethod'); +verify.not.memberListContains('privateProperty'); +verify.not.memberListContains('protectedMethod'); +verify.not.memberListContains('protectedProperty'); +verify.memberListContains('publicMethod'); +verify.memberListContains('publicProperty'); +verify.memberListContains('protectedOverriddenMethod'); +verify.memberListContains('protectedOverriddenProperty'); diff --git a/tests/cases/fourslash/completionListWithAmbientDeclaration.ts b/tests/cases/fourslash/completionListWithAmbientDeclaration.ts index afb5d96fbb7..7cfac28fb24 100644 --- a/tests/cases/fourslash/completionListWithAmbientDeclaration.ts +++ b/tests/cases/fourslash/completionListWithAmbientDeclaration.ts @@ -1,15 +1,15 @@ -/// - -//// declare module "http" { -//// var x; -//// /*1*/ -//// } -//// declare module 'https' { -//// } -//// /*2*/ - -goTo.marker("1"); -verify.not.completionListContains("http"); -goTo.marker("2"); -verify.not.completionListContains("http"); -verify.not.completionListContains("https"); +/// + +//// declare module "http" { +//// var x; +//// /*1*/ +//// } +//// declare module 'https' { +//// } +//// /*2*/ + +goTo.marker("1"); +verify.not.completionListContains("http"); +goTo.marker("2"); +verify.not.completionListContains("http"); +verify.not.completionListContains("https"); diff --git a/tests/cases/fourslash/completionListWithModulesFromModule.ts b/tests/cases/fourslash/completionListWithModulesFromModule.ts index a8d99a47853..96610b203a1 100644 --- a/tests/cases/fourslash/completionListWithModulesFromModule.ts +++ b/tests/cases/fourslash/completionListWithModulesFromModule.ts @@ -1,326 +1,326 @@ -/// - -////module mod1 { -//// var mod1var = 1; -//// function mod1fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod1cls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mod1int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mod1mod { -//// var m1X = 1; -//// function m1Func() { -//// var bar = 1; -//// function foob() { } -//// } -//// class m1Class { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface m1Int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var m1eX = 1; -//// export function m1eFunc() { -//// } -//// export class m1eClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface m1eInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module m1Mod { } -//// export module m1eMod { } -//// } -//// export var mod1evar = 1; -//// export function mod1efn() { -//// var bar = 1; -//// function foob() { } -//// } -//// export class mod1ecls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod1eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod1emod { -//// var mX = 1; -//// function mFunc() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mClass { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var meX = 1; -//// export function meFunc() { -//// } -//// export class meClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface meInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mMod { } -//// export module meMod { } -//// } -////} -//// -////// EXTENDING MODULE 1 -////module mod1 { -//// export var mod1eexvar = 1; -//// var mod1exvar = 2; -////} -//// -////module mod2 { -//// var mod2var = "shadow"; -//// function mod2fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod2cls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// module mod2mod { } -//// interface mod2int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var mod2evar = 1; -//// export function mod2efn() { -//// } -//// export class mod2ecls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod2eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod2emod { } -////} -//// -////module mod2 { -//// export var mod2eexvar = 1; -////} -//// -////module mod3 { -//// var shwvar = "shadow"; -//// function shwfn(shadow: any) { -//// var bar = 1; -//// function foob() { } -//// } -//// class shwcls { -//// constructor(public shadow: any) { } -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: string; -//// sifn(shadow: any): any; -//// } -//// /*shadowModuleWithNoExport*/ -////} -//// -////module mod4 { -//// export var shwvar = "shadow"; -//// export function shwfn(shadow: any) { -//// var bar = 1; -//// function foob(){ } -//// } -//// export class shwcls { -//// constructor(shadow: any) { } -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: string; -//// sifn(shadow: any): any; -//// } -//// /*shadowModuleWithExport*/ -////} -//// -////module mod5 { -//// import Mod1 = mod1; -//// import iMod1 = mod1.mod1emod; -//// /*moduleWithImport*/ -////} -//// -////function shwfn() { -//// var sfvar = 1; -//// function sffn() { } -////} -//// -////class shwcls { -//// private scvar = 1; -//// private scfn() { } -//// public scpfn() { } -//// public scpvar = 1; -//// static scsvar = 1; -//// static scsfn() { } -////} -//// -////interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: any; -//// sifn(bar: any): any; -////} -//// -////var shwvar = 1; - -function sharedNegativeVerify() -{ - verify.not.completionListContains('sfvar'); - verify.not.completionListContains('sffn'); - verify.not.completionListContains('scvar'); - verify.not.completionListContains('scfn'); - verify.not.completionListContains('scpfn'); - verify.not.completionListContains('scpvar'); - verify.not.completionListContains('scsvar'); - verify.not.completionListContains('scsfn'); - verify.not.completionListContains('sivar'); - verify.not.completionListContains('sifn'); - verify.not.completionListContains('mod1exvar'); - verify.not.completionListContains('mod2eexvar'); -} - -function goToMarkAndVerifyShadow() -{ - sharedNegativeVerify(); - verify.not.completionListContains('mod2var'); - verify.not.completionListContains('mod2fn'); - verify.not.completionListContains('mod2cls'); - verify.not.completionListContains('mod2int'); - verify.not.completionListContains('mod2mod'); - verify.not.completionListContains('mod2evar'); - verify.not.completionListContains('mod2efn'); - verify.not.completionListContains('mod2ecls'); - verify.not.completionListContains('mod2eint'); - verify.not.completionListContains('mod2emod'); -} - -// from a shadow module with no export -goTo.marker('shadowModuleWithNoExport'); -verify.completionListContains('shwvar', '(var) shwvar: string'); -verify.completionListContains('shwfn', '(function) shwfn(shadow: any): void'); -verify.completionListContains('shwcls', 'class shwcls'); -verify.completionListContains('shwint', 'interface shwint'); -goToMarkAndVerifyShadow(); - -// from a shadow module with export -goTo.marker('shadowModuleWithExport'); -verify.completionListContains('shwvar', '(var) mod4.shwvar: string'); -verify.completionListContains('shwfn', '(function) mod4.shwfn(shadow: any): void'); -verify.completionListContains('shwcls', 'class mod4.shwcls'); -verify.completionListContains('shwint', 'interface mod4.shwint'); -goToMarkAndVerifyShadow(); - -// from a modlue with import -goTo.marker('moduleWithImport'); -verify.completionListContains('mod1', 'module mod1'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); -verify.completionListContains('shwvar', '(var) shwvar: number'); -verify.completionListContains('shwfn', '(function) shwfn(): void'); -verify.completionListContains('shwcls', 'class shwcls'); -verify.completionListContains('shwint', 'interface shwint'); - -sharedNegativeVerify(); - -verify.not.completionListContains('mod1var'); -verify.not.completionListContains('mod1fn'); -verify.not.completionListContains('mod1cls'); -verify.not.completionListContains('mod1int'); -verify.not.completionListContains('mod1mod'); -verify.not.completionListContains('mod1evar'); -verify.not.completionListContains('mod1efn'); -verify.not.completionListContains('mod1ecls'); -verify.not.completionListContains('mod1eint'); -verify.not.completionListContains('mod1emod'); -verify.not.completionListContains('mX'); -verify.not.completionListContains('mFunc'); -verify.not.completionListContains('mClass'); -verify.not.completionListContains('mInt'); -verify.not.completionListContains('mMod'); -verify.not.completionListContains('meX'); -verify.not.completionListContains('meFunc'); -verify.not.completionListContains('meClass'); -verify.not.completionListContains('meInt'); +/// + +////module mod1 { +//// var mod1var = 1; +//// function mod1fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod1cls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mod1int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mod1mod { +//// var m1X = 1; +//// function m1Func() { +//// var bar = 1; +//// function foob() { } +//// } +//// class m1Class { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface m1Int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var m1eX = 1; +//// export function m1eFunc() { +//// } +//// export class m1eClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface m1eInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module m1Mod { } +//// export module m1eMod { } +//// } +//// export var mod1evar = 1; +//// export function mod1efn() { +//// var bar = 1; +//// function foob() { } +//// } +//// export class mod1ecls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod1eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod1emod { +//// var mX = 1; +//// function mFunc() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mClass { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var meX = 1; +//// export function meFunc() { +//// } +//// export class meClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface meInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mMod { } +//// export module meMod { } +//// } +////} +//// +////// EXTENDING MODULE 1 +////module mod1 { +//// export var mod1eexvar = 1; +//// var mod1exvar = 2; +////} +//// +////module mod2 { +//// var mod2var = "shadow"; +//// function mod2fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod2cls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// module mod2mod { } +//// interface mod2int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var mod2evar = 1; +//// export function mod2efn() { +//// } +//// export class mod2ecls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod2eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod2emod { } +////} +//// +////module mod2 { +//// export var mod2eexvar = 1; +////} +//// +////module mod3 { +//// var shwvar = "shadow"; +//// function shwfn(shadow: any) { +//// var bar = 1; +//// function foob() { } +//// } +//// class shwcls { +//// constructor(public shadow: any) { } +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: string; +//// sifn(shadow: any): any; +//// } +//// /*shadowModuleWithNoExport*/ +////} +//// +////module mod4 { +//// export var shwvar = "shadow"; +//// export function shwfn(shadow: any) { +//// var bar = 1; +//// function foob(){ } +//// } +//// export class shwcls { +//// constructor(shadow: any) { } +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: string; +//// sifn(shadow: any): any; +//// } +//// /*shadowModuleWithExport*/ +////} +//// +////module mod5 { +//// import Mod1 = mod1; +//// import iMod1 = mod1.mod1emod; +//// /*moduleWithImport*/ +////} +//// +////function shwfn() { +//// var sfvar = 1; +//// function sffn() { } +////} +//// +////class shwcls { +//// private scvar = 1; +//// private scfn() { } +//// public scpfn() { } +//// public scpvar = 1; +//// static scsvar = 1; +//// static scsfn() { } +////} +//// +////interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: any; +//// sifn(bar: any): any; +////} +//// +////var shwvar = 1; + +function sharedNegativeVerify() +{ + verify.not.completionListContains('sfvar'); + verify.not.completionListContains('sffn'); + verify.not.completionListContains('scvar'); + verify.not.completionListContains('scfn'); + verify.not.completionListContains('scpfn'); + verify.not.completionListContains('scpvar'); + verify.not.completionListContains('scsvar'); + verify.not.completionListContains('scsfn'); + verify.not.completionListContains('sivar'); + verify.not.completionListContains('sifn'); + verify.not.completionListContains('mod1exvar'); + verify.not.completionListContains('mod2eexvar'); +} + +function goToMarkAndVerifyShadow() +{ + sharedNegativeVerify(); + verify.not.completionListContains('mod2var'); + verify.not.completionListContains('mod2fn'); + verify.not.completionListContains('mod2cls'); + verify.not.completionListContains('mod2int'); + verify.not.completionListContains('mod2mod'); + verify.not.completionListContains('mod2evar'); + verify.not.completionListContains('mod2efn'); + verify.not.completionListContains('mod2ecls'); + verify.not.completionListContains('mod2eint'); + verify.not.completionListContains('mod2emod'); +} + +// from a shadow module with no export +goTo.marker('shadowModuleWithNoExport'); +verify.completionListContains('shwvar', '(var) shwvar: string'); +verify.completionListContains('shwfn', '(function) shwfn(shadow: any): void'); +verify.completionListContains('shwcls', 'class shwcls'); +verify.completionListContains('shwint', 'interface shwint'); +goToMarkAndVerifyShadow(); + +// from a shadow module with export +goTo.marker('shadowModuleWithExport'); +verify.completionListContains('shwvar', '(var) mod4.shwvar: string'); +verify.completionListContains('shwfn', '(function) mod4.shwfn(shadow: any): void'); +verify.completionListContains('shwcls', 'class mod4.shwcls'); +verify.completionListContains('shwint', 'interface mod4.shwint'); +goToMarkAndVerifyShadow(); + +// from a modlue with import +goTo.marker('moduleWithImport'); +verify.completionListContains('mod1', 'module mod1'); +verify.completionListContains('mod2', 'module mod2'); +verify.completionListContains('mod3', 'module mod3'); +verify.completionListContains('shwvar', '(var) shwvar: number'); +verify.completionListContains('shwfn', '(function) shwfn(): void'); +verify.completionListContains('shwcls', 'class shwcls'); +verify.completionListContains('shwint', 'interface shwint'); + +sharedNegativeVerify(); + +verify.not.completionListContains('mod1var'); +verify.not.completionListContains('mod1fn'); +verify.not.completionListContains('mod1cls'); +verify.not.completionListContains('mod1int'); +verify.not.completionListContains('mod1mod'); +verify.not.completionListContains('mod1evar'); +verify.not.completionListContains('mod1efn'); +verify.not.completionListContains('mod1ecls'); +verify.not.completionListContains('mod1eint'); +verify.not.completionListContains('mod1emod'); +verify.not.completionListContains('mX'); +verify.not.completionListContains('mFunc'); +verify.not.completionListContains('mClass'); +verify.not.completionListContains('mInt'); +verify.not.completionListContains('mMod'); +verify.not.completionListContains('meX'); +verify.not.completionListContains('meFunc'); +verify.not.completionListContains('meClass'); +verify.not.completionListContains('meInt'); verify.not.completionListContains('meMod'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts index 920ba030264..49180cb95d5 100644 --- a/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts @@ -1,364 +1,364 @@ -/// - -////module mod1 { -//// var mod1var = 1; -//// function mod1fn() { -//// var bar = 1; -//// function foob() { } -//// /*function*/ -//// } -//// class mod1cls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// /*class*/ -//// } -//// interface mod1int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// /*interface*/ -//// } -//// module mod1mod { -//// var m1X = 1; -//// function m1Func() { -//// var bar = 1; -//// function foob() { } -//// } -//// class m1Class { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface m1Int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var m1eX = 1; -//// export function m1eFunc() { -//// } -//// export class m1eClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface m1eInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module m1Mod { } -//// export module m1eMod { } -//// /*module*/ -//// } -//// export var mod1evar = 1; -//// export function mod1efn() { -//// var bar = 1; -//// function foob() { } -//// /*exportedFunction*/ -//// } -//// export class mod1ecls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// /*exportedClass*/ -//// } -//// export interface mod1eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// /*exportedInterface*/ -//// } -//// export module mod1emod { -//// var mX = 1; -//// function mFunc() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mClass { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var meX = 1; -//// export function meFunc() { -//// } -//// export class meClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface meInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mMod { } -//// export module meMod { } -//// /*exportedModule*/ -//// } -//// /*mod1*/ -////} -//// -////// EXTENDING MODULE 1 -////module mod1 { -//// export var mod1eexvar = 1; -//// var mod1exvar = 2; -//// /*extendedModule*/ -////} -//// -////module mod2 { -//// var mod2var = "shadow"; -//// function mod2fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod2cls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// module mod2mod { } -//// interface mod2int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var mod2evar = 1; -//// export function mod2efn() { -//// } -//// export class mod2ecls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod2eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod2emod { } -////} -//// -////module mod2 { -//// export var mod2eexvar = 1; -////} -//// -////module mod3 { -//// var shwvar = "shadow"; -//// function shwfn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class shwcls { -//// constructor(public shadow: any) { } -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: string; -//// sifn(shadow: any): any; -//// } -////} -//// -////function shwfn() { -//// var sfvar = 1; -//// function sffn() { } -////} -//// -////class shwcls { -//// private scvar = 1; -//// private scfn() { } -//// public scpfn() { } -//// public scpvar = 1; -//// static scsvar = 1; -//// static scsfn() { } -////} -//// -////interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: any; -//// sifn(bar: any): any; -////} -//// -////var shwvar = 1; - -function goToMarkAndGeneralVerify(marker: string) -{ - goTo.marker(marker); - - verify.completionListContains('mod1var', '(var) mod1var: number'); - verify.completionListContains('mod1fn', '(function) mod1fn(): void'); - verify.completionListContains('mod1cls', 'class mod1cls'); - verify.completionListContains('mod1int', 'interface mod1int'); - verify.completionListContains('mod1mod', 'module mod1mod'); - verify.completionListContains('mod1evar', '(var) mod1.mod1evar: number'); - verify.completionListContains('mod1efn', '(function) mod1.mod1efn(): void'); - verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); - verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); - verify.completionListContains('mod1emod', 'module mod1.mod1emod'); - verify.completionListContains('mod1eexvar', '(var) mod1.mod1eexvar: number'); - verify.completionListContains('mod2', 'module mod2'); - verify.completionListContains('mod3', 'module mod3'); - verify.completionListContains('shwvar', '(var) shwvar: number'); - verify.completionListContains('shwfn', '(function) shwfn(): void'); - verify.completionListContains('shwcls', 'class shwcls'); - verify.completionListContains('shwint', 'interface shwint'); - - verify.not.completionListContains('mod2var'); - verify.not.completionListContains('mod2fn'); - verify.not.completionListContains('mod2cls'); - verify.not.completionListContains('mod2int'); - verify.not.completionListContains('mod2mod'); - verify.not.completionListContains('mod2evar'); - verify.not.completionListContains('mod2efn'); - verify.not.completionListContains('mod2ecls'); - verify.not.completionListContains('mod2eint'); - verify.not.completionListContains('mod2emod'); - verify.not.completionListContains('sfvar'); - verify.not.completionListContains('sffn'); - verify.not.completionListContains('scvar'); - verify.not.completionListContains('scfn'); - verify.not.completionListContains('scpfn'); - verify.not.completionListContains('scpvar'); - verify.not.completionListContains('scsvar'); - verify.not.completionListContains('scsfn'); - verify.not.completionListContains('sivar'); - verify.not.completionListContains('sifn'); - verify.not.completionListContains('mod1exvar'); - verify.not.completionListContains('mod2eexvar'); -} - -// from mod1 -goToMarkAndGeneralVerify('mod1'); - -// from function in mod1 -goToMarkAndGeneralVerify('function'); -verify.completionListContains('bar', '(local var) bar: number'); -verify.completionListContains('foob', '(local function) foob(): void'); - -// from class in mod1 -goToMarkAndGeneralVerify('class'); -//verify.not.completionListContains('ceFunc'); -//verify.not.completionListContains('ceVar'); - -// from interface in mod1 -goToMarkAndGeneralVerify('interface'); - -// from module in mod1 -goToMarkAndGeneralVerify('module'); -verify.completionListContains('m1X', '(var) m1X: number'); -verify.completionListContains('m1Func', '(function) m1Func(): void'); -verify.completionListContains('m1Class', 'class m1Class'); -verify.completionListContains('m1Int', 'interface m1Int'); -verify.completionListContains('m1Mod', 'module m1Mod'); -verify.completionListContains('m1eX', '(var) mod1mod.m1eX: number'); -verify.completionListContains('m1eFunc', '(function) mod1mod.m1eFunc(): void'); -verify.completionListContains('m1eClass', 'class mod1mod.m1eClass'); -verify.completionListContains('m1eInt', 'interface mod1mod.m1eInt'); -verify.completionListContains('m1eMod', 'module mod1mod.m1eMod'); - -// from exported function in mod1 -goToMarkAndGeneralVerify('exportedFunction'); -verify.completionListContains('bar', '(local var) bar: number'); -verify.completionListContains('foob', '(local function) foob(): void'); - -// from exported class in mod1 -goToMarkAndGeneralVerify('exportedClass'); -//verify.not.completionListContains('ceFunc'); -//verify.not.completionListContains('ceVar'); - -// from exported interface in mod1 -goToMarkAndGeneralVerify('exportedInterface'); - -// from exported module in mod1 -goToMarkAndGeneralVerify('exportedModule'); -verify.completionListContains('mX', '(var) mX: number'); -verify.completionListContains('mFunc', '(function) mFunc(): void'); -verify.completionListContains('mClass', 'class mClass'); -verify.completionListContains('mInt', 'interface mInt'); -verify.completionListContains('mMod', 'module mMod'); -verify.completionListContains('meX', '(var) mod1.mod1emod.meX: number'); -verify.completionListContains('meFunc', '(function) mod1.mod1emod.meFunc(): void'); -verify.completionListContains('meClass', 'class mod1.mod1emod.meClass'); -verify.completionListContains('meInt', 'interface mod1.mod1emod.meInt'); -verify.completionListContains('meMod', 'module mod1.mod1emod.meMod'); - -// from extended module -goTo.marker('extendedModule'); -verify.completionListContains('mod1evar', '(var) mod1.mod1evar: number'); -verify.completionListContains('mod1efn', '(function) mod1.mod1efn(): void'); -verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); -verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); -verify.completionListContains('mod1emod', 'module mod1.mod1emod'); -verify.completionListContains('mod1eexvar', '(var) mod1.mod1eexvar: number'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); -verify.completionListContains('shwvar', '(var) shwvar: number'); -verify.completionListContains('shwfn', '(function) shwfn(): void'); -verify.completionListContains('shwcls', 'class shwcls'); -verify.completionListContains('shwint', 'interface shwint'); - -verify.not.completionListContains('mod2var'); -verify.not.completionListContains('mod2fn'); -verify.not.completionListContains('mod2cls'); -verify.not.completionListContains('mod2int'); -verify.not.completionListContains('mod2mod'); -verify.not.completionListContains('mod2evar'); -verify.not.completionListContains('mod2efn'); -verify.not.completionListContains('mod2ecls'); -verify.not.completionListContains('mod2eint'); -verify.not.completionListContains('mod2emod'); -verify.not.completionListContains('sfvar'); -verify.not.completionListContains('sffn'); -verify.not.completionListContains('scvar'); -verify.not.completionListContains('scfn'); -verify.not.completionListContains('scpfn'); -verify.not.completionListContains('scpvar'); -verify.not.completionListContains('scsvar'); -verify.not.completionListContains('scsfn'); -verify.not.completionListContains('sivar'); -verify.not.completionListContains('sifn'); +/// + +////module mod1 { +//// var mod1var = 1; +//// function mod1fn() { +//// var bar = 1; +//// function foob() { } +//// /*function*/ +//// } +//// class mod1cls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// /*class*/ +//// } +//// interface mod1int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// /*interface*/ +//// } +//// module mod1mod { +//// var m1X = 1; +//// function m1Func() { +//// var bar = 1; +//// function foob() { } +//// } +//// class m1Class { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface m1Int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var m1eX = 1; +//// export function m1eFunc() { +//// } +//// export class m1eClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface m1eInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module m1Mod { } +//// export module m1eMod { } +//// /*module*/ +//// } +//// export var mod1evar = 1; +//// export function mod1efn() { +//// var bar = 1; +//// function foob() { } +//// /*exportedFunction*/ +//// } +//// export class mod1ecls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// /*exportedClass*/ +//// } +//// export interface mod1eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// /*exportedInterface*/ +//// } +//// export module mod1emod { +//// var mX = 1; +//// function mFunc() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mClass { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var meX = 1; +//// export function meFunc() { +//// } +//// export class meClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface meInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mMod { } +//// export module meMod { } +//// /*exportedModule*/ +//// } +//// /*mod1*/ +////} +//// +////// EXTENDING MODULE 1 +////module mod1 { +//// export var mod1eexvar = 1; +//// var mod1exvar = 2; +//// /*extendedModule*/ +////} +//// +////module mod2 { +//// var mod2var = "shadow"; +//// function mod2fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod2cls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// module mod2mod { } +//// interface mod2int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var mod2evar = 1; +//// export function mod2efn() { +//// } +//// export class mod2ecls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod2eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod2emod { } +////} +//// +////module mod2 { +//// export var mod2eexvar = 1; +////} +//// +////module mod3 { +//// var shwvar = "shadow"; +//// function shwfn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class shwcls { +//// constructor(public shadow: any) { } +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: string; +//// sifn(shadow: any): any; +//// } +////} +//// +////function shwfn() { +//// var sfvar = 1; +//// function sffn() { } +////} +//// +////class shwcls { +//// private scvar = 1; +//// private scfn() { } +//// public scpfn() { } +//// public scpvar = 1; +//// static scsvar = 1; +//// static scsfn() { } +////} +//// +////interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: any; +//// sifn(bar: any): any; +////} +//// +////var shwvar = 1; + +function goToMarkAndGeneralVerify(marker: string) +{ + goTo.marker(marker); + + verify.completionListContains('mod1var', '(var) mod1var: number'); + verify.completionListContains('mod1fn', '(function) mod1fn(): void'); + verify.completionListContains('mod1cls', 'class mod1cls'); + verify.completionListContains('mod1int', 'interface mod1int'); + verify.completionListContains('mod1mod', 'module mod1mod'); + verify.completionListContains('mod1evar', '(var) mod1.mod1evar: number'); + verify.completionListContains('mod1efn', '(function) mod1.mod1efn(): void'); + verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); + verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); + verify.completionListContains('mod1emod', 'module mod1.mod1emod'); + verify.completionListContains('mod1eexvar', '(var) mod1.mod1eexvar: number'); + verify.completionListContains('mod2', 'module mod2'); + verify.completionListContains('mod3', 'module mod3'); + verify.completionListContains('shwvar', '(var) shwvar: number'); + verify.completionListContains('shwfn', '(function) shwfn(): void'); + verify.completionListContains('shwcls', 'class shwcls'); + verify.completionListContains('shwint', 'interface shwint'); + + verify.not.completionListContains('mod2var'); + verify.not.completionListContains('mod2fn'); + verify.not.completionListContains('mod2cls'); + verify.not.completionListContains('mod2int'); + verify.not.completionListContains('mod2mod'); + verify.not.completionListContains('mod2evar'); + verify.not.completionListContains('mod2efn'); + verify.not.completionListContains('mod2ecls'); + verify.not.completionListContains('mod2eint'); + verify.not.completionListContains('mod2emod'); + verify.not.completionListContains('sfvar'); + verify.not.completionListContains('sffn'); + verify.not.completionListContains('scvar'); + verify.not.completionListContains('scfn'); + verify.not.completionListContains('scpfn'); + verify.not.completionListContains('scpvar'); + verify.not.completionListContains('scsvar'); + verify.not.completionListContains('scsfn'); + verify.not.completionListContains('sivar'); + verify.not.completionListContains('sifn'); + verify.not.completionListContains('mod1exvar'); + verify.not.completionListContains('mod2eexvar'); +} + +// from mod1 +goToMarkAndGeneralVerify('mod1'); + +// from function in mod1 +goToMarkAndGeneralVerify('function'); +verify.completionListContains('bar', '(local var) bar: number'); +verify.completionListContains('foob', '(local function) foob(): void'); + +// from class in mod1 +goToMarkAndGeneralVerify('class'); +//verify.not.completionListContains('ceFunc'); +//verify.not.completionListContains('ceVar'); + +// from interface in mod1 +goToMarkAndGeneralVerify('interface'); + +// from module in mod1 +goToMarkAndGeneralVerify('module'); +verify.completionListContains('m1X', '(var) m1X: number'); +verify.completionListContains('m1Func', '(function) m1Func(): void'); +verify.completionListContains('m1Class', 'class m1Class'); +verify.completionListContains('m1Int', 'interface m1Int'); +verify.completionListContains('m1Mod', 'module m1Mod'); +verify.completionListContains('m1eX', '(var) mod1mod.m1eX: number'); +verify.completionListContains('m1eFunc', '(function) mod1mod.m1eFunc(): void'); +verify.completionListContains('m1eClass', 'class mod1mod.m1eClass'); +verify.completionListContains('m1eInt', 'interface mod1mod.m1eInt'); +verify.completionListContains('m1eMod', 'module mod1mod.m1eMod'); + +// from exported function in mod1 +goToMarkAndGeneralVerify('exportedFunction'); +verify.completionListContains('bar', '(local var) bar: number'); +verify.completionListContains('foob', '(local function) foob(): void'); + +// from exported class in mod1 +goToMarkAndGeneralVerify('exportedClass'); +//verify.not.completionListContains('ceFunc'); +//verify.not.completionListContains('ceVar'); + +// from exported interface in mod1 +goToMarkAndGeneralVerify('exportedInterface'); + +// from exported module in mod1 +goToMarkAndGeneralVerify('exportedModule'); +verify.completionListContains('mX', '(var) mX: number'); +verify.completionListContains('mFunc', '(function) mFunc(): void'); +verify.completionListContains('mClass', 'class mClass'); +verify.completionListContains('mInt', 'interface mInt'); +verify.completionListContains('mMod', 'module mMod'); +verify.completionListContains('meX', '(var) mod1.mod1emod.meX: number'); +verify.completionListContains('meFunc', '(function) mod1.mod1emod.meFunc(): void'); +verify.completionListContains('meClass', 'class mod1.mod1emod.meClass'); +verify.completionListContains('meInt', 'interface mod1.mod1emod.meInt'); +verify.completionListContains('meMod', 'module mod1.mod1emod.meMod'); + +// from extended module +goTo.marker('extendedModule'); +verify.completionListContains('mod1evar', '(var) mod1.mod1evar: number'); +verify.completionListContains('mod1efn', '(function) mod1.mod1efn(): void'); +verify.completionListContains('mod1ecls', 'class mod1.mod1ecls'); +verify.completionListContains('mod1eint', 'interface mod1.mod1eint'); +verify.completionListContains('mod1emod', 'module mod1.mod1emod'); +verify.completionListContains('mod1eexvar', '(var) mod1.mod1eexvar: number'); +verify.completionListContains('mod2', 'module mod2'); +verify.completionListContains('mod3', 'module mod3'); +verify.completionListContains('shwvar', '(var) shwvar: number'); +verify.completionListContains('shwfn', '(function) shwfn(): void'); +verify.completionListContains('shwcls', 'class shwcls'); +verify.completionListContains('shwint', 'interface shwint'); + +verify.not.completionListContains('mod2var'); +verify.not.completionListContains('mod2fn'); +verify.not.completionListContains('mod2cls'); +verify.not.completionListContains('mod2int'); +verify.not.completionListContains('mod2mod'); +verify.not.completionListContains('mod2evar'); +verify.not.completionListContains('mod2efn'); +verify.not.completionListContains('mod2ecls'); +verify.not.completionListContains('mod2eint'); +verify.not.completionListContains('mod2emod'); +verify.not.completionListContains('sfvar'); +verify.not.completionListContains('sffn'); +verify.not.completionListContains('scvar'); +verify.not.completionListContains('scfn'); +verify.not.completionListContains('scpfn'); +verify.not.completionListContains('scpvar'); +verify.not.completionListContains('scsvar'); +verify.not.completionListContains('scsfn'); +verify.not.completionListContains('sivar'); +verify.not.completionListContains('sifn'); verify.not.completionListContains('mod2eexvar'); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts index 43314b45d7f..b228b244fee 100644 --- a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts @@ -1,291 +1,291 @@ -/// - -////module mod1 { -//// var mod1var = 1; -//// function mod1fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod1cls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mod1int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mod1mod { -//// var m1X = 1; -//// function m1Func() { -//// var bar = 1; -//// function foob() { } -//// } -//// class m1Class { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface m1Int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var m1eX = 1; -//// export function m1eFunc() { -//// } -//// export class m1eClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface m1eInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module m1Mod { } -//// export module m1eMod { } -//// } -//// export var mod1evar = 1; -//// export function mod1efn() { -//// var bar = 1; -//// function foob() { } -//// } -//// export class mod1ecls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod1eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod1emod { -//// var mX = 1; -//// function mFunc() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mClass { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var meX = 1; -//// export function meFunc() { -//// } -//// export class meClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface meInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mMod { } -//// export module meMod { } -//// } -////} -//// -////// EXTENDING MODULE 1 -////module mod1 { -//// export var mod1eexvar = 1; -//// var mod1exvar = 2; -////} -//// -////module mod2 { -//// var mod2var = "shadow"; -//// function mod2fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod2cls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// module mod2mod { } -//// interface mod2int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var mod2evar = 1; -//// export function mod2efn() { -//// } -//// export class mod2ecls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod2eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod2emod { } -////} -//// -////module mod2 { -//// export var mod2eexvar = 1; -////} -//// -////module mod3 { -//// var shwvar = "shadow"; -//// function shwfn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class shwcls { -//// constructor(public shadow: any) { } -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: string; -//// sifn(shadow: any): any; -//// } -////} -//// -////function shwfn() { -//// var sfvar = 1; -//// function sffn() { } -//// /*function*/ -////} -//// -////class shwcls { -//// private scvar = 1; -//// private scfn() { } -//// public scpfn() { } -//// public scpvar = 1; -//// static scsvar = 1; -//// static scsfn() { } -//// /*class*/ -////} -//// -////interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: any; -//// sifn(bar: any): any; -//// /*interface*/ -////} -//// -////var shwvar = 1; -/////*global*/ - -function verifyNotContainFunctionMembers() -{ - verify.not.completionListContains('sfvar'); - verify.not.completionListContains('sffn'); -} - -function verifyNotContainClassMembers() -{ - verify.not.completionListContains('scvar'); - verify.not.completionListContains('scfn'); - verify.not.completionListContains('scpfn'); - verify.not.completionListContains('scpvar'); - verify.not.completionListContains('scsvar'); - verify.not.completionListContains('scsfn'); -} - -function verifyNotContainInterfaceMembers() -{ - verify.not.completionListContains('sivar'); - verify.not.completionListContains('sifn'); -} - -function goToMarkAndGeneralVerify(marker: string) -{ - goTo.marker(marker); - - verify.not.completionListContains('mod1var'); - verify.not.completionListContains('mod1fn'); - verify.not.completionListContains('mod1cls'); - verify.not.completionListContains('mod1int'); - verify.not.completionListContains('mod1mod'); - verify.not.completionListContains('mod1evar'); - verify.not.completionListContains('mod1efn'); - verify.not.completionListContains('mod1ecls'); - verify.not.completionListContains('mod1eint'); - verify.not.completionListContains('mod1emod'); - verify.not.completionListContains('mod1eexvar'); -} - -// from global scope -goToMarkAndGeneralVerify('global'); -verify.completionListContains('mod1', 'module mod1'); -verify.completionListContains('mod2', 'module mod2'); -verify.completionListContains('mod3', 'module mod3'); -verify.completionListContains('shwvar', '(var) shwvar: number'); -verify.completionListContains('shwfn', '(function) shwfn(): void'); -verify.completionListContains('shwcls', 'class shwcls'); -verify.completionListContains('shwint', 'interface shwint'); - -verifyNotContainFunctionMembers(); -verifyNotContainClassMembers(); -verifyNotContainInterfaceMembers(); - -// from function scope -goToMarkAndGeneralVerify('function'); -verify.completionListContains('sfvar', '(local var) sfvar: number'); -verify.completionListContains('sffn', '(local function) sffn(): void'); - -verifyNotContainClassMembers(); -verifyNotContainInterfaceMembers(); - -// from class scope -goToMarkAndGeneralVerify('class'); -verifyNotContainFunctionMembers(); -verifyNotContainInterfaceMembers(); - -// from interface scope -goToMarkAndGeneralVerify('interface'); -verifyNotContainClassMembers(); +/// + +////module mod1 { +//// var mod1var = 1; +//// function mod1fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod1cls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mod1int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mod1mod { +//// var m1X = 1; +//// function m1Func() { +//// var bar = 1; +//// function foob() { } +//// } +//// class m1Class { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface m1Int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var m1eX = 1; +//// export function m1eFunc() { +//// } +//// export class m1eClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface m1eInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module m1Mod { } +//// export module m1eMod { } +//// } +//// export var mod1evar = 1; +//// export function mod1efn() { +//// var bar = 1; +//// function foob() { } +//// } +//// export class mod1ecls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod1eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod1emod { +//// var mX = 1; +//// function mFunc() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mClass { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var meX = 1; +//// export function meFunc() { +//// } +//// export class meClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface meInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mMod { } +//// export module meMod { } +//// } +////} +//// +////// EXTENDING MODULE 1 +////module mod1 { +//// export var mod1eexvar = 1; +//// var mod1exvar = 2; +////} +//// +////module mod2 { +//// var mod2var = "shadow"; +//// function mod2fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod2cls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// module mod2mod { } +//// interface mod2int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var mod2evar = 1; +//// export function mod2efn() { +//// } +//// export class mod2ecls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod2eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod2emod { } +////} +//// +////module mod2 { +//// export var mod2eexvar = 1; +////} +//// +////module mod3 { +//// var shwvar = "shadow"; +//// function shwfn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class shwcls { +//// constructor(public shadow: any) { } +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: string; +//// sifn(shadow: any): any; +//// } +////} +//// +////function shwfn() { +//// var sfvar = 1; +//// function sffn() { } +//// /*function*/ +////} +//// +////class shwcls { +//// private scvar = 1; +//// private scfn() { } +//// public scpfn() { } +//// public scpvar = 1; +//// static scsvar = 1; +//// static scsfn() { } +//// /*class*/ +////} +//// +////interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: any; +//// sifn(bar: any): any; +//// /*interface*/ +////} +//// +////var shwvar = 1; +/////*global*/ + +function verifyNotContainFunctionMembers() +{ + verify.not.completionListContains('sfvar'); + verify.not.completionListContains('sffn'); +} + +function verifyNotContainClassMembers() +{ + verify.not.completionListContains('scvar'); + verify.not.completionListContains('scfn'); + verify.not.completionListContains('scpfn'); + verify.not.completionListContains('scpvar'); + verify.not.completionListContains('scsvar'); + verify.not.completionListContains('scsfn'); +} + +function verifyNotContainInterfaceMembers() +{ + verify.not.completionListContains('sivar'); + verify.not.completionListContains('sifn'); +} + +function goToMarkAndGeneralVerify(marker: string) +{ + goTo.marker(marker); + + verify.not.completionListContains('mod1var'); + verify.not.completionListContains('mod1fn'); + verify.not.completionListContains('mod1cls'); + verify.not.completionListContains('mod1int'); + verify.not.completionListContains('mod1mod'); + verify.not.completionListContains('mod1evar'); + verify.not.completionListContains('mod1efn'); + verify.not.completionListContains('mod1ecls'); + verify.not.completionListContains('mod1eint'); + verify.not.completionListContains('mod1emod'); + verify.not.completionListContains('mod1eexvar'); +} + +// from global scope +goToMarkAndGeneralVerify('global'); +verify.completionListContains('mod1', 'module mod1'); +verify.completionListContains('mod2', 'module mod2'); +verify.completionListContains('mod3', 'module mod3'); +verify.completionListContains('shwvar', '(var) shwvar: number'); +verify.completionListContains('shwfn', '(function) shwfn(): void'); +verify.completionListContains('shwcls', 'class shwcls'); +verify.completionListContains('shwint', 'interface shwint'); + +verifyNotContainFunctionMembers(); +verifyNotContainClassMembers(); +verifyNotContainInterfaceMembers(); + +// from function scope +goToMarkAndGeneralVerify('function'); +verify.completionListContains('sfvar', '(local var) sfvar: number'); +verify.completionListContains('sffn', '(local function) sffn(): void'); + +verifyNotContainClassMembers(); +verifyNotContainInterfaceMembers(); + +// from class scope +goToMarkAndGeneralVerify('class'); +verifyNotContainFunctionMembers(); +verifyNotContainInterfaceMembers(); + +// from interface scope +goToMarkAndGeneralVerify('interface'); +verifyNotContainClassMembers(); verifyNotContainFunctionMembers(); \ No newline at end of file diff --git a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts index 04bf7bf26d5..aed914657ae 100644 --- a/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts +++ b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts @@ -1,275 +1,275 @@ -/// - -////module mod1 { -//// var mod1var = 1; -//// function mod1fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod1cls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mod1int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mod1mod { -//// var m1X = 1; -//// function m1Func() { -//// var bar = 1; -//// function foob() { } -//// } -//// class m1Class { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface m1Int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var m1eX = 1; -//// export function m1eFunc() { -//// } -//// export class m1eClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface m1eInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module m1Mod { } -//// export module m1eMod { } -//// } -//// export var mod1evar = 1; -//// export function mod1efn() { -//// var bar = 1; -//// function foob() { } -//// } -//// export class mod1ecls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod1eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod1emod { -//// var mX = 1; -//// function mFunc() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mClass { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface mInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var meX = 1; -//// export function meFunc() { -//// } -//// export class meClass { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface meInt { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// module mMod { } -//// export module meMod { } -//// } -////} -//// -////// EXTENDING MODULE 1 -////module mod1 { -//// export var mod1eexvar = 1; -//// var mod1exvar = 2; -////} -//// -////module mod2 { -//// var mod2var = "shadow"; -//// function mod2fn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class mod2cls { -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// module mod2mod { } -//// interface mod2int { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export var mod2evar = 1; -//// export function mod2efn() { -//// } -//// export class mod2ecls { -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// export interface mod2eint { -//// (bar: any): any; -//// new (bar: any): any; -//// bar: any; -//// foob(bar: any): any; -//// } -//// export module mod2emod { } -////} -//// -////module mod2 { -//// export var mod2eexvar = 1; -////} -//// -////module mod3 { -//// var shwvar = "shadow"; -//// function shwfn() { -//// var bar = 1; -//// function foob() { } -//// } -//// class shwcls { -//// constructor(public shadow: any) { } -//// private cVar = 1; -//// public cFunc() { } -//// public ceFunc() { } -//// public ceVar = 1; -//// static csVar = 1; -//// static csFunc() { } -//// } -//// interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: string; -//// sifn(shadow: any): any; -//// } -////} -//// -////function shwfn() { -//// var sfvar = 1; -//// function sffn() { } -////} -//// -////class shwcls { -//// private scvar = 1; -//// private scfn() { } -//// public scpfn() { } -//// public scpvar = 1; -//// static scsvar = 1; -//// static scsfn() { } -////} -//// -////interface shwint { -//// (bar: any): any; -//// new (bar: any): any; -//// sivar: any; -//// sifn(bar: any): any; -////} -//// -////var shwvar = 1; -//// -////class extCls extends shwcls { -//// /*extendedClass*/ -////} -//// -////function shwFnTest() { -//// function shwFnTest { -//// -//// } -//// var shwvar = "1"; -//// /*localVar*/ -////} -//// -////var obj = { -//// x: /*objectLiteral*/ -////} - -function goToMarkerAndVerify(marker: string) -{ - goTo.marker(marker); - - verify.completionListContains('mod1'); - verify.completionListContains('mod2'); - verify.completionListContains('mod3'); - verify.completionListContains('shwvar', '(var) shwvar: number'); - verify.completionListContains('shwfn', '(function) shwfn(): void'); - verify.completionListContains('shwcls', 'class shwcls'); - verify.completionListContains('shwint', 'interface shwint'); - - verify.not.completionListContains('mod2var'); - verify.not.completionListContains('mod2fn'); - verify.not.completionListContains('mod2cls'); - verify.not.completionListContains('mod2int'); - verify.not.completionListContains('mod2mod'); - verify.not.completionListContains('mod2evar'); - verify.not.completionListContains('mod2efn'); - verify.not.completionListContains('mod2ecls'); - verify.not.completionListContains('mod2eint'); - verify.not.completionListContains('mod2emod'); - verify.not.completionListContains('sfvar'); - verify.not.completionListContains('sffn'); - verify.not.completionListContains('scvar'); - verify.not.completionListContains('scfn'); - verify.not.completionListContains('scpfn'); - verify.not.completionListContains('scpvar'); - verify.not.completionListContains('scsvar'); - verify.not.completionListContains('scsfn'); - verify.not.completionListContains('sivar'); - verify.not.completionListContains('sifn'); - verify.not.completionListContains('mod1exvar'); - verify.not.completionListContains('mod2eexvar'); -} - -goToMarkerAndVerify('extendedClass'); - -goToMarkerAndVerify('objectLiteral'); - -goTo.marker('localVar'); +/// + +////module mod1 { +//// var mod1var = 1; +//// function mod1fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod1cls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mod1int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mod1mod { +//// var m1X = 1; +//// function m1Func() { +//// var bar = 1; +//// function foob() { } +//// } +//// class m1Class { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface m1Int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var m1eX = 1; +//// export function m1eFunc() { +//// } +//// export class m1eClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface m1eInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module m1Mod { } +//// export module m1eMod { } +//// } +//// export var mod1evar = 1; +//// export function mod1efn() { +//// var bar = 1; +//// function foob() { } +//// } +//// export class mod1ecls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod1eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod1emod { +//// var mX = 1; +//// function mFunc() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mClass { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface mInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var meX = 1; +//// export function meFunc() { +//// } +//// export class meClass { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface meInt { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// module mMod { } +//// export module meMod { } +//// } +////} +//// +////// EXTENDING MODULE 1 +////module mod1 { +//// export var mod1eexvar = 1; +//// var mod1exvar = 2; +////} +//// +////module mod2 { +//// var mod2var = "shadow"; +//// function mod2fn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class mod2cls { +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// module mod2mod { } +//// interface mod2int { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export var mod2evar = 1; +//// export function mod2efn() { +//// } +//// export class mod2ecls { +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// export interface mod2eint { +//// (bar: any): any; +//// new (bar: any): any; +//// bar: any; +//// foob(bar: any): any; +//// } +//// export module mod2emod { } +////} +//// +////module mod2 { +//// export var mod2eexvar = 1; +////} +//// +////module mod3 { +//// var shwvar = "shadow"; +//// function shwfn() { +//// var bar = 1; +//// function foob() { } +//// } +//// class shwcls { +//// constructor(public shadow: any) { } +//// private cVar = 1; +//// public cFunc() { } +//// public ceFunc() { } +//// public ceVar = 1; +//// static csVar = 1; +//// static csFunc() { } +//// } +//// interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: string; +//// sifn(shadow: any): any; +//// } +////} +//// +////function shwfn() { +//// var sfvar = 1; +//// function sffn() { } +////} +//// +////class shwcls { +//// private scvar = 1; +//// private scfn() { } +//// public scpfn() { } +//// public scpvar = 1; +//// static scsvar = 1; +//// static scsfn() { } +////} +//// +////interface shwint { +//// (bar: any): any; +//// new (bar: any): any; +//// sivar: any; +//// sifn(bar: any): any; +////} +//// +////var shwvar = 1; +//// +////class extCls extends shwcls { +//// /*extendedClass*/ +////} +//// +////function shwFnTest() { +//// function shwFnTest { +//// +//// } +//// var shwvar = "1"; +//// /*localVar*/ +////} +//// +////var obj = { +//// x: /*objectLiteral*/ +////} + +function goToMarkerAndVerify(marker: string) +{ + goTo.marker(marker); + + verify.completionListContains('mod1'); + verify.completionListContains('mod2'); + verify.completionListContains('mod3'); + verify.completionListContains('shwvar', '(var) shwvar: number'); + verify.completionListContains('shwfn', '(function) shwfn(): void'); + verify.completionListContains('shwcls', 'class shwcls'); + verify.completionListContains('shwint', 'interface shwint'); + + verify.not.completionListContains('mod2var'); + verify.not.completionListContains('mod2fn'); + verify.not.completionListContains('mod2cls'); + verify.not.completionListContains('mod2int'); + verify.not.completionListContains('mod2mod'); + verify.not.completionListContains('mod2evar'); + verify.not.completionListContains('mod2efn'); + verify.not.completionListContains('mod2ecls'); + verify.not.completionListContains('mod2eint'); + verify.not.completionListContains('mod2emod'); + verify.not.completionListContains('sfvar'); + verify.not.completionListContains('sffn'); + verify.not.completionListContains('scvar'); + verify.not.completionListContains('scfn'); + verify.not.completionListContains('scpfn'); + verify.not.completionListContains('scpvar'); + verify.not.completionListContains('scsvar'); + verify.not.completionListContains('scsfn'); + verify.not.completionListContains('sivar'); + verify.not.completionListContains('sifn'); + verify.not.completionListContains('mod1exvar'); + verify.not.completionListContains('mod2eexvar'); +} + +goToMarkerAndVerify('extendedClass'); + +goToMarkerAndVerify('objectLiteral'); + +goTo.marker('localVar'); verify.completionListContains('shwvar', '(local var) shwvar: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts b/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts index 693f9698da1..ec2ae9b3c22 100644 --- a/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts +++ b/tests/cases/fourslash/consistenceOnIndentionsOfChainedFunctionCalls.ts @@ -1,21 +1,21 @@ -/// - -////interface ig { -//// module(data): ig; -//// requires(data): ig; -//// defines(data): ig; -////} -//// -////var ig: ig; -////ig.module( -//// 'mything' -////).requires( -//// 'otherstuff' -////).defines(/*0*//*1*/ -////}); - -goTo.marker("1"); -edit.insert("\r\n"); -goTo.marker("0"); -// Won't-fixed: Smart indent during chained function calls +/// + +////interface ig { +//// module(data): ig; +//// requires(data): ig; +//// defines(data): ig; +////} +//// +////var ig: ig; +////ig.module( +//// 'mything' +////).requires( +//// 'otherstuff' +////).defines(/*0*//*1*/ +////}); + +goTo.marker("1"); +edit.insert("\r\n"); +goTo.marker("0"); +// Won't-fixed: Smart indent during chained function calls verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/consistenceOnIndentionsOfObjectsInAListAfterFormatting.ts b/tests/cases/fourslash/consistenceOnIndentionsOfObjectsInAListAfterFormatting.ts index 310f91915db..14ada206026 100644 --- a/tests/cases/fourslash/consistenceOnIndentionsOfObjectsInAListAfterFormatting.ts +++ b/tests/cases/fourslash/consistenceOnIndentionsOfObjectsInAListAfterFormatting.ts @@ -1,11 +1,11 @@ -/// - -////foo({ -////}, {/*1*/ -////});/*2*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("}, {"); -goTo.marker("2"); +/// + +////foo({ +////}, {/*1*/ +////});/*2*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("}, {"); +goTo.marker("2"); verify.currentLineContentIs(" });"); \ No newline at end of file diff --git a/tests/cases/fourslash/consistentContextualTypeErrorsAfterEdits.ts b/tests/cases/fourslash/consistentContextualTypeErrorsAfterEdits.ts index 7e434c6bb89..03024ce0020 100644 --- a/tests/cases/fourslash/consistentContextualTypeErrorsAfterEdits.ts +++ b/tests/cases/fourslash/consistentContextualTypeErrorsAfterEdits.ts @@ -1,5 +1,5 @@ -/// - +/// + //// class A { //// foo: string; //// } diff --git a/tests/cases/fourslash/contextualTypingGenericFunction1.ts b/tests/cases/fourslash/contextualTypingGenericFunction1.ts index c7e409820d4..0216f713cf7 100644 --- a/tests/cases/fourslash/contextualTypingGenericFunction1.ts +++ b/tests/cases/fourslash/contextualTypingGenericFunction1.ts @@ -4,10 +4,10 @@ ////var obj: { f(x: T): T } = { f: (/*1*/x) => x }; ////var obj2: (x: T) => T = (/*2*/x) => x; //// -////class C { -//// obj: (x: T) => T -////} -////var c = new C(); +////class C { +//// obj: (x: T) => T +////} +////var c = new C(); ////c.obj = (/*3*/x) => x; goTo.marker('1'); diff --git a/tests/cases/fourslash/definition.ts b/tests/cases/fourslash/definition.ts index 531e4562843..f403965fe12 100644 --- a/tests/cases/fourslash/definition.ts +++ b/tests/cases/fourslash/definition.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/deleteExtensionInReopenedInterface.ts b/tests/cases/fourslash/deleteExtensionInReopenedInterface.ts index 13c3498e71e..1fd0a99e0ac 100644 --- a/tests/cases/fourslash/deleteExtensionInReopenedInterface.ts +++ b/tests/cases/fourslash/deleteExtensionInReopenedInterface.ts @@ -1,24 +1,24 @@ -/// - -//// interface A { a: number; } -//// interface B { b: number; } -//// -//// interface I /*del*/extends A { } -//// interface I extends B { } -//// -//// var i: I; -//// class C /*delImplements*/implements A { } -//// var c: C; -//// c.a; - -goTo.marker('del'); -edit.deleteAtCaret('extends A'.length); - -goTo.eof(); -edit.insert("var a = i.a;"); - -goTo.marker('delImplements'); -edit.deleteAtCaret('implements A'.length); - -goTo.marker('del'); +/// + +//// interface A { a: number; } +//// interface B { b: number; } +//// +//// interface I /*del*/extends A { } +//// interface I extends B { } +//// +//// var i: I; +//// class C /*delImplements*/implements A { } +//// var c: C; +//// c.a; + +goTo.marker('del'); +edit.deleteAtCaret('extends A'.length); + +goTo.eof(); +edit.insert("var a = i.a;"); + +goTo.marker('delImplements'); +edit.deleteAtCaret('implements A'.length); + +goTo.marker('del'); edit.insert('extends A'); \ No newline at end of file diff --git a/tests/cases/fourslash/deleteModifierBeforeVarStatement1.ts b/tests/cases/fourslash/deleteModifierBeforeVarStatement1.ts index 803d6bf66ce..a929e67687f 100644 --- a/tests/cases/fourslash/deleteModifierBeforeVarStatement1.ts +++ b/tests/cases/fourslash/deleteModifierBeforeVarStatement1.ts @@ -1,64 +1,64 @@ -/// - -//// -//// -//// ///////////////////////////// -//// /// Windows Script Host APIS -//// ///////////////////////////// -//// -//// declare var ActiveXObject: { new (s: string): any; }; -//// -//// interface ITextWriter { -//// WriteLine(s): void; -//// } -//// -//// declare var WScript: { -//// Echo(s): void; -//// StdErr: ITextWriter; -//// Arguments: { length: number; Item(): string; }; -//// ScriptFullName: string; -//// Quit(): number; -//// } -//// - - -goTo.file(0); - -// : -// : |--- go here -// 1: -// 2: -goTo.position(0); - -// : -// : |--- delete "\n\n///..." -// 1: -// 2: -debugger; -edit.deleteAtCaret(100); - - -// 12: -// : |--- go here -// 13: declare var WScript: { -// 14: Echo(s): void; -goTo.position(198); - -// 12: -// : |--- delete "declare..." -// 13: declare var WScript: { -// 14: Echo(s): void; -edit.deleteAtCaret(16); - - -// 9: StdErr: ITextWriter; -// : |--- go here -// 10: Arguments: { length: number; Item(): string; }; -// 11: ScriptFullName: string; -goTo.position(198); - -// 9: StdErr: ITextWriter; -// : |--- insert "Item(): string; " -// 10: Arguments: { length: number; Item(): string; }; -// 11: ScriptFullName: string; -edit.insert("Item(): string; "); +/// + +//// +//// +//// ///////////////////////////// +//// /// Windows Script Host APIS +//// ///////////////////////////// +//// +//// declare var ActiveXObject: { new (s: string): any; }; +//// +//// interface ITextWriter { +//// WriteLine(s): void; +//// } +//// +//// declare var WScript: { +//// Echo(s): void; +//// StdErr: ITextWriter; +//// Arguments: { length: number; Item(): string; }; +//// ScriptFullName: string; +//// Quit(): number; +//// } +//// + + +goTo.file(0); + +// : +// : |--- go here +// 1: +// 2: +goTo.position(0); + +// : +// : |--- delete "\n\n///..." +// 1: +// 2: +debugger; +edit.deleteAtCaret(100); + + +// 12: +// : |--- go here +// 13: declare var WScript: { +// 14: Echo(s): void; +goTo.position(198); + +// 12: +// : |--- delete "declare..." +// 13: declare var WScript: { +// 14: Echo(s): void; +edit.deleteAtCaret(16); + + +// 9: StdErr: ITextWriter; +// : |--- go here +// 10: Arguments: { length: number; Item(): string; }; +// 11: ScriptFullName: string; +goTo.position(198); + +// 9: StdErr: ITextWriter; +// : |--- insert "Item(): string; " +// 10: Arguments: { length: number; Item(): string; }; +// 11: ScriptFullName: string; +edit.insert("Item(): string; "); diff --git a/tests/cases/fourslash/deleteTypeParameter.ts b/tests/cases/fourslash/deleteTypeParameter.ts index c3d2236813c..4c70d61580a 100644 --- a/tests/cases/fourslash/deleteTypeParameter.ts +++ b/tests/cases/fourslash/deleteTypeParameter.ts @@ -9,6 +9,6 @@ //// var q1: Query; //// var q2: Query2; //// q1 = q2; - -goTo.marker(); -edit.deleteAtCaret(1); + +goTo.marker(); +edit.deleteAtCaret(1); diff --git a/tests/cases/fourslash/duplicateClassModuleError0.ts b/tests/cases/fourslash/duplicateClassModuleError0.ts index e133ba70e93..a6d63ba5277 100644 --- a/tests/cases/fourslash/duplicateClassModuleError0.ts +++ b/tests/cases/fourslash/duplicateClassModuleError0.ts @@ -1,25 +1,25 @@ -/// - -//// module A -//// { -//// class B -//// { -//// public Hello(): string -//// { -//// return "from private B"; -//// } -//// } -//// } -//// -//// module A -//// { -//// /*1*/ -//// } - -edit.disableFormatting(); - -goTo.marker("1"); - -edit.insert(" export class B\n {\n public Hello(): string\n {\n return \"from export B\";\n }\n }\n"); - -edit.insert("\n"); +/// + +//// module A +//// { +//// class B +//// { +//// public Hello(): string +//// { +//// return "from private B"; +//// } +//// } +//// } +//// +//// module A +//// { +//// /*1*/ +//// } + +edit.disableFormatting(); + +goTo.marker("1"); + +edit.insert(" export class B\n {\n public Hello(): string\n {\n return \"from export B\";\n }\n }\n"); + +edit.insert("\n"); diff --git a/tests/cases/fourslash/duplicateTypeParameters.ts b/tests/cases/fourslash/duplicateTypeParameters.ts index 40b0441606e..a7cdebe1153 100644 --- a/tests/cases/fourslash/duplicateTypeParameters.ts +++ b/tests/cases/fourslash/duplicateTypeParameters.ts @@ -1,7 +1,7 @@ -/// - +/// + //// class A { } - -goTo.marker(); -verify.quickInfoExists(); - + +goTo.marker(); +verify.quickInfoExists(); + diff --git a/tests/cases/fourslash/eval.ts b/tests/cases/fourslash/eval.ts index e9ee90b768b..db1077a0b10 100644 --- a/tests/cases/fourslash/eval.ts +++ b/tests/cases/fourslash/eval.ts @@ -1,14 +1,14 @@ -/// - -////class SomeObj { -//// public n = 5; -//// -//// public getCallback() { -//// return () => this.n; -//// } -////} -//// -////var x = new SomeObj(); -////var y = x.getCallback()(); - -verify.eval('y', 5); +/// + +////class SomeObj { +//// public n = 5; +//// +//// public getCallback() { +//// return () => this.n; +//// } +////} +//// +////var x = new SomeObj(); +////var y = x.getCallback()(); + +verify.eval('y', 5); diff --git a/tests/cases/fourslash/exportClauseErrorReporting0.ts b/tests/cases/fourslash/exportClauseErrorReporting0.ts index 75490500d87..a931c3ff130 100644 --- a/tests/cases/fourslash/exportClauseErrorReporting0.ts +++ b/tests/cases/fourslash/exportClauseErrorReporting0.ts @@ -1,16 +1,16 @@ -/// - -//// module M { -//// /*1*/class C { } -//// } -//// -//// var x = new M.C(); -//// - -edit.disableFormatting(); - -goTo.marker("1"); -edit.insert("export "); -goTo.marker("1"); - -edit.deleteAtCaret(8); +/// + +//// module M { +//// /*1*/class C { } +//// } +//// +//// var x = new M.C(); +//// + +edit.disableFormatting(); + +goTo.marker("1"); +edit.insert("export "); +goTo.marker("1"); + +edit.deleteAtCaret(8); diff --git a/tests/cases/fourslash/failureToImplementClass.ts b/tests/cases/fourslash/failureToImplementClass.ts index d6942f87117..345a8d94111 100644 --- a/tests/cases/fourslash/failureToImplementClass.ts +++ b/tests/cases/fourslash/failureToImplementClass.ts @@ -1,9 +1,9 @@ -/// - -////interface IExec { -//// exec: (filename: string, cmdLine: string) => boolean; -////} -////class /*1*/NodeExec/*2*/ implements IExec { } - -verify.errorExistsBetweenMarkers("1", "2"); +/// + +////interface IExec { +//// exec: (filename: string, cmdLine: string) => boolean; +////} +////class /*1*/NodeExec/*2*/ implements IExec { } + +verify.errorExistsBetweenMarkers("1", "2"); verify.numberOfErrorsInCurrentFile(1); \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts index 76adc714b2c..afcaf625ede 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames7.ts @@ -1,4 +1,4 @@ -/// +/// ////function [|__foo|]() { //// [|__foo|](); diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts index d25d6335f2b..08ed3414366 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames8.ts @@ -1,4 +1,4 @@ -/// +/// ////(function [|__foo|]() { //// [|__foo|](); diff --git a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts index 295344d23f9..a3923783c46 100644 --- a/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts +++ b/tests/cases/fourslash/findAllRefsWithLeadingUnderscoreNames9.ts @@ -1,4 +1,4 @@ -/// +/// ////(function [|___foo|]() { //// [|___foo|](); diff --git a/tests/cases/fourslash/formatArrayOrObjectLiteralsInVariableList.ts b/tests/cases/fourslash/formatArrayOrObjectLiteralsInVariableList.ts index 8de0a6a2458..40ad89c4203 100644 --- a/tests/cases/fourslash/formatArrayOrObjectLiteralsInVariableList.ts +++ b/tests/cases/fourslash/formatArrayOrObjectLiteralsInVariableList.ts @@ -1,7 +1,7 @@ -/// - -////var v30 = [1, 2], v31, v32, v33 = [0], v34 = {'a': true}, v35;/**/ - -format.document(); -goTo.marker(""); +/// + +////var v30 = [1, 2], v31, v32, v33 = [0], v34 = {'a': true}, v35;/**/ + +format.document(); +goTo.marker(""); verify.currentLineContentIs("var v30 = [1, 2], v31, v32, v33 = [0], v34 = { 'a': true }, v35;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatColonAndQMark.ts b/tests/cases/fourslash/formatColonAndQMark.ts index 4a2b956ee1d..856c9941117 100644 --- a/tests/cases/fourslash/formatColonAndQMark.ts +++ b/tests/cases/fourslash/formatColonAndQMark.ts @@ -1,16 +1,16 @@ -/// - -////class foo {/*1*/ -//// constructor (n?: number, m = 5, o?: string) { }/*2*/ -//// x:number = 1?2:3;/*3*/ -////}/*4*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("class foo {"); -goTo.marker("2"); -verify.currentLineContentIs(" constructor(n?: number, m = 5, o?: string) { }"); -goTo.marker("3"); -verify.currentLineContentIs(" x: number = 1 ? 2 : 3;"); -goTo.marker("4"); +/// + +////class foo {/*1*/ +//// constructor (n?: number, m = 5, o?: string) { }/*2*/ +//// x:number = 1?2:3;/*3*/ +////}/*4*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("class foo {"); +goTo.marker("2"); +verify.currentLineContentIs(" constructor(n?: number, m = 5, o?: string) { }"); +goTo.marker("3"); +verify.currentLineContentIs(" x: number = 1 ? 2 : 3;"); +goTo.marker("4"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatControlFlowConstructs.ts b/tests/cases/fourslash/formatControlFlowConstructs.ts index 853df75115a..001a708c649 100644 --- a/tests/cases/fourslash/formatControlFlowConstructs.ts +++ b/tests/cases/fourslash/formatControlFlowConstructs.ts @@ -1,9 +1,9 @@ -/// +/// ////if (true)/**/ ////{ -////} - -format.document(); -goTo.marker(); +////} + +format.document(); +goTo.marker(); verify.currentLineContentIs("if (true) {"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatDebuggerStatement.ts b/tests/cases/fourslash/formatDebuggerStatement.ts index 82175ef3f94..f91359f76f6 100644 --- a/tests/cases/fourslash/formatDebuggerStatement.ts +++ b/tests/cases/fourslash/formatDebuggerStatement.ts @@ -1,10 +1,10 @@ -/// - -////if(false){debugger;} -//// if ( false ) { debugger ; } - -format.document(); -goTo.bof(); -verify.currentLineContentIs("if (false) { debugger; }"); -goTo.eof(); +/// + +////if(false){debugger;} +//// if ( false ) { debugger ; } + +format.document(); +goTo.bof(); +verify.currentLineContentIs("if (false) { debugger; }"); +goTo.eof(); verify.currentLineContentIs("if (false) { debugger; }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatEmptyBlock.ts b/tests/cases/fourslash/formatEmptyBlock.ts index c65a2d607d0..565dbc6257c 100644 --- a/tests/cases/fourslash/formatEmptyBlock.ts +++ b/tests/cases/fourslash/formatEmptyBlock.ts @@ -1,8 +1,8 @@ -/// - -////{} - -goTo.eof(); -edit.insert("\r\n"); -goTo.bof(); +/// + +////{} + +goTo.eof(); +edit.insert("\r\n"); +goTo.bof(); verify.currentLineContentIs("{ }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatEmptyParamList.ts b/tests/cases/fourslash/formatEmptyParamList.ts index 5b207581d61..a5372010baa 100644 --- a/tests/cases/fourslash/formatEmptyParamList.ts +++ b/tests/cases/fourslash/formatEmptyParamList.ts @@ -1,5 +1,5 @@ -/// -////function f( f: function){/*1*/ -goTo.marker("1"); -edit.insert("}"); +/// +////function f( f: function){/*1*/ +goTo.marker("1"); +edit.insert("}"); verify.currentLineContentIs("function f(f: function){ }") \ No newline at end of file diff --git a/tests/cases/fourslash/formatImplicitModule.ts b/tests/cases/fourslash/formatImplicitModule.ts index 22583940d6e..22a933ce031 100644 --- a/tests/cases/fourslash/formatImplicitModule.ts +++ b/tests/cases/fourslash/formatImplicitModule.ts @@ -1,11 +1,11 @@ -/// - -//// export class A { -//// -//// } - -format.document(); -goTo.bof(); -verify.currentLineContentIs("export class A {"); -goTo.eof(); +/// + +//// export class A { +//// +//// } + +format.document(); +goTo.bof(); +verify.currentLineContentIs("export class A {"); +goTo.eof(); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatImportDeclaration.ts b/tests/cases/fourslash/formatImportDeclaration.ts index 4dc26fd5bc6..09c3e95964c 100644 --- a/tests/cases/fourslash/formatImportDeclaration.ts +++ b/tests/cases/fourslash/formatImportDeclaration.ts @@ -1,18 +1,18 @@ -/// - -////module Foo {/*1*/ -////}/*2*/ -//// -////import bar = Foo;/*3*/ -//// -////import bar2=Foo;/*4*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("module Foo {"); -goTo.marker("2"); -verify.currentLineContentIs("}"); -goTo.marker("3"); -verify.currentLineContentIs("import bar = Foo;"); -goTo.marker("4"); +/// + +////module Foo {/*1*/ +////}/*2*/ +//// +////import bar = Foo;/*3*/ +//// +////import bar2=Foo;/*4*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("module Foo {"); +goTo.marker("2"); +verify.currentLineContentIs("}"); +goTo.marker("3"); +verify.currentLineContentIs("import bar = Foo;"); +goTo.marker("4"); verify.currentLineContentIs("import bar2 = Foo;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formatNestedClassWithOpenBraceOnNewLines.ts b/tests/cases/fourslash/formatNestedClassWithOpenBraceOnNewLines.ts index 2f3157a2833..028fc349b39 100644 --- a/tests/cases/fourslash/formatNestedClassWithOpenBraceOnNewLines.ts +++ b/tests/cases/fourslash/formatNestedClassWithOpenBraceOnNewLines.ts @@ -1,21 +1,21 @@ -/// - -////module A -////{ -//// class B { -//// /*1*/ -////} - -format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); -format.setOption("PlaceOpenBraceOnNewLineForFunctions", true); -goTo.marker("1"); -edit.insert("}"); - -verify.currentFileContentIs( -"module A\n\ -{\n\ - class B\n\ - {\n\ - }\n\ -}" +/// + +////module A +////{ +//// class B { +//// /*1*/ +////} + +format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); +format.setOption("PlaceOpenBraceOnNewLineForFunctions", true); +goTo.marker("1"); +edit.insert("}"); + +verify.currentFileContentIs( +"module A\n\ +{\n\ + class B\n\ + {\n\ + }\n\ +}" ); \ No newline at end of file diff --git a/tests/cases/fourslash/formatSelectionWithTrivia.ts b/tests/cases/fourslash/formatSelectionWithTrivia.ts index 3aae18d9204..ff399642745 100644 --- a/tests/cases/fourslash/formatSelectionWithTrivia.ts +++ b/tests/cases/fourslash/formatSelectionWithTrivia.ts @@ -1,13 +1,13 @@ -/// +/// ////if (true) { -//// // -//// /*begin*/ -//// // -//// ; -//// -//// }/*end*/ - -format.selection('begin', 'end'); - -verify.currentFileContentIs("if (true) { \n // \n\n // \n ;\n\n}"); +//// // +//// /*begin*/ +//// // +//// ; +//// +//// }/*end*/ + +format.selection('begin', 'end'); + +verify.currentFileContentIs("if (true) { \n // \n\n // \n ;\n\n}"); diff --git a/tests/cases/fourslash/formatVariableDeclarationList.ts b/tests/cases/fourslash/formatVariableDeclarationList.ts index 6d1b6e0ac5a..37392d38c62 100644 --- a/tests/cases/fourslash/formatVariableDeclarationList.ts +++ b/tests/cases/fourslash/formatVariableDeclarationList.ts @@ -1,40 +1,40 @@ -/// - -/////*1*/var fun1 = function ( ) { -/////*2*/ var x = 'foo' , -/////*3*/ z = 'bar' ; -/////*4*/ return x ; -/////*5*/}, -//// -/////*6*/fun2 = ( function ( f ) { -/////*7*/ var fun = function ( ) { -/////*8*/ console . log ( f ( ) ) ; -/////*9*/ }, -/////*10*/ x = 'Foo' ; -/////*11*/ return fun ; -/////*12*/} ( fun1 ) ) ; -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("var fun1 = function() {"); -goTo.marker("2"); -verify.currentLineContentIs(" var x = 'foo',"); -goTo.marker("3"); -verify.currentLineContentIs(" z = 'bar';"); -goTo.marker("4"); -verify.currentLineContentIs(" return x;"); -goTo.marker("5"); -verify.currentLineContentIs("},"); -goTo.marker("6"); -verify.currentLineContentIs(" fun2 = (function(f) {"); -goTo.marker("7"); -verify.currentLineContentIs(" var fun = function() {"); -goTo.marker("8"); -verify.currentLineContentIs(" console.log(f());"); -goTo.marker("9"); -verify.currentLineContentIs(" },"); -goTo.marker("10"); -verify.currentLineContentIs(" x = 'Foo';"); -goTo.marker("11"); -verify.currentLineContentIs(" return fun;"); -goTo.marker("12"); -verify.currentLineContentIs(" } (fun1));"); +/// + +/////*1*/var fun1 = function ( ) { +/////*2*/ var x = 'foo' , +/////*3*/ z = 'bar' ; +/////*4*/ return x ; +/////*5*/}, +//// +/////*6*/fun2 = ( function ( f ) { +/////*7*/ var fun = function ( ) { +/////*8*/ console . log ( f ( ) ) ; +/////*9*/ }, +/////*10*/ x = 'Foo' ; +/////*11*/ return fun ; +/////*12*/} ( fun1 ) ) ; +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("var fun1 = function() {"); +goTo.marker("2"); +verify.currentLineContentIs(" var x = 'foo',"); +goTo.marker("3"); +verify.currentLineContentIs(" z = 'bar';"); +goTo.marker("4"); +verify.currentLineContentIs(" return x;"); +goTo.marker("5"); +verify.currentLineContentIs("},"); +goTo.marker("6"); +verify.currentLineContentIs(" fun2 = (function(f) {"); +goTo.marker("7"); +verify.currentLineContentIs(" var fun = function() {"); +goTo.marker("8"); +verify.currentLineContentIs(" console.log(f());"); +goTo.marker("9"); +verify.currentLineContentIs(" },"); +goTo.marker("10"); +verify.currentLineContentIs(" x = 'Foo';"); +goTo.marker("11"); +verify.currentLineContentIs(" return fun;"); +goTo.marker("12"); +verify.currentLineContentIs(" } (fun1));"); diff --git a/tests/cases/fourslash/formatWithStatement.ts b/tests/cases/fourslash/formatWithStatement.ts index 410b8f5601f..bc5ddf38443 100644 --- a/tests/cases/fourslash/formatWithStatement.ts +++ b/tests/cases/fourslash/formatWithStatement.ts @@ -1,15 +1,15 @@ -/// - -////with /*1*/(foo.bar) -//// -//// {/*2*/ -//// -//// }/*3*/ -//// -////with (bar.blah)/*4*/ -////{/*5*/ -////}/*6*/ - +/// + +////with /*1*/(foo.bar) +//// +//// {/*2*/ +//// +//// }/*3*/ +//// +////with (bar.blah)/*4*/ +////{/*5*/ +////}/*6*/ + format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", false); format.document(); goTo.marker("1"); @@ -19,15 +19,15 @@ verify.currentLineContentIs("}"); goTo.marker("4"); verify.currentLineContentIs("with (bar.blah) {"); goTo.marker("6"); -verify.currentLineContentIs("}"); - -format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("with (foo.bar)"); -goTo.marker("2"); -verify.currentLineContentIs("{"); -goTo.marker("4"); -verify.currentLineContentIs("with (bar.blah)"); -goTo.marker("5"); +verify.currentLineContentIs("}"); + +format.setOption("PlaceOpenBraceOnNewLineForControlBlocks", true); +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("with (foo.bar)"); +goTo.marker("2"); +verify.currentLineContentIs("{"); +goTo.marker("4"); +verify.currentLineContentIs("with (bar.blah)"); +goTo.marker("5"); verify.currentLineContentIs("{"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingFatArrowFunctions.ts b/tests/cases/fourslash/formattingFatArrowFunctions.ts index 73463852a67..c540c2837e1 100644 --- a/tests/cases/fourslash/formattingFatArrowFunctions.ts +++ b/tests/cases/fourslash/formattingFatArrowFunctions.ts @@ -1,290 +1,290 @@ -/// - -////// valid -//// ( ) => 1 ;/*1*/ -//// ( arg ) => 2 ;/*2*/ -//// arg => 2 ;/*3*/ -//// ( arg = 1 ) => 3 ;/*4*/ -//// ( arg ? ) => 4 ;/*5*/ -//// ( arg : number ) => 5 ;/*6*/ -//// ( arg : number = 0 ) => 6 ;/*7*/ -//// ( arg ? : number ) => 7 ;/*8*/ -//// ( ... arg : number [ ] ) => 8 ;/*9*/ -//// ( arg1 , arg2 ) => 12 ;/*10*/ -//// ( arg1 = 1 , arg2 =3 ) => 13 ;/*11*/ -//// ( arg1 ? , arg2 ? ) => 14 ;/*12*/ -//// ( arg1 : number , arg2 : number ) => 15 ;/*13*/ -//// ( arg1 : number = 0 , arg2 : number = 1 ) => 16 ;/*14*/ -//// ( arg1 ? : number , arg2 ? : number ) => 17 ;/*15*/ -//// ( arg1 , ... arg2 : number [ ] ) => 18 ;/*16*/ -//// ( arg1 , arg2 ? : number ) => 19 ;/*17*/ -//// -////// in paren -//// ( ( ) => 21 ) ;/*18*/ -//// ( ( arg ) => 22 ) ;/*19*/ -//// ( ( arg = 1 ) => 23 ) ;/*20*/ -//// ( ( arg ? ) => 24 ) ;/*21*/ -//// ( ( arg : number ) => 25 ) ;/*22*/ -//// ( ( arg : number = 0 ) => 26 ) ;/*23*/ -//// ( ( arg ? : number ) => 27 ) ;/*24*/ -//// ( ( ... arg : number [ ] ) => 28 ) ;/*25*/ -//// -////// in multiple paren -//// ( ( ( ( ( arg ) => { return 32 ; } ) ) ) ) ;/*26*/ -//// -////// in ternary exression -//// false ? ( ) => 41 : null ;/*27*/ -//// false ? ( arg ) => 42 : null ;/*28*/ -//// false ? ( arg = 1 ) => 43 : null ;/*29*/ -//// false ? ( arg ? ) => 44 : null ;/*30*/ -//// false ? ( arg : number ) => 45 : null ;/*31*/ -//// false ? ( arg ? : number ) => 46 : null ;/*32*/ -//// false ? ( arg ? : number = 0 ) => 47 : null ;/*33*/ -//// false ? ( ... arg : number [ ] ) => 48 : null ;/*34*/ -//// -////// in ternary exression within paren -//// false ? ( ( ) => 51 ) : null ;/*35*/ -//// false ? ( ( arg ) => 52 ) : null ;/*36*/ -//// false ? ( ( arg = 1 ) => 53 ) : null ;/*37*/ -//// false ? ( ( arg ? ) => 54 ) : null ;/*38*/ -//// false ? ( ( arg : number ) => 55 ) : null ;/*39*/ -//// false ? ( ( arg ? : number ) => 56 ) : null ;/*40*/ -//// false ? ( ( arg ? : number = 0 ) => 57 ) : null ;/*41*/ -//// false ? ( ( ... arg : number [ ] ) => 58 ) : null ;/*42*/ -//// -////// ternary exression's else clause -//// false ? null : ( ) => 61 ;/*43*/ -//// false ? null : ( arg ) => 62 ;/*44*/ -//// false ? null : ( arg = 1 ) => 63 ;/*45*/ -//// false ? null : ( arg ? ) => 64 ;/*46*/ -//// false ? null : ( arg : number ) => 65 ;/*47*/ -//// false ? null : ( arg ? : number ) => 66 ;/*48*/ -//// false ? null : ( arg ? : number = 0 ) => 67 ;/*49*/ -//// false ? null : ( ... arg : number [ ] ) => 68 ;/*50*/ -//// -//// -////// nested ternary expressions -//// (( a ? ) => { return a ; }) ? ( b ? ) => { return b ; } : ( c ? ) => { return c ; } ;/*51*/ -//// -//////multiple levels -//// (( a ? ) => { return a ; }) ? ( b ) => ( c ) => 81 : ( c ) => ( d ) => 82 ;/*52*/ -//// -//// -////// In Expressions -//// ( ( arg ) => 90 ) instanceof Function ;/*53*/ -//// ( ( arg = 1 ) => 91 ) instanceof Function ;/*54*/ -//// ( ( arg ? ) => 92 ) instanceof Function ;/*55*/ -//// ( ( arg : number ) => 93 ) instanceof Function ;/*56*/ -//// ( ( arg : number = 1 ) => 94 ) instanceof Function ;/*57*/ -//// ( ( arg ? : number ) => 95 ) instanceof Function ;/*58*/ -//// ( ( ... arg : number [ ] ) => 96 ) instanceof Function ;/*59*/ -//// -////'' + (( arg ) => 100) ;/*60*/ -//// ( ( arg ) => 0 ) + '' + (( arg ) => 101) ;/*61*/ -//// ( ( arg = 1 ) => 0 ) + '' + (( arg = 2 ) => 102) ;/*62*/ -//// ( ( arg ? ) => 0 ) + '' + (( arg ? ) => 103) ;/*63*/ -//// ( ( arg : number ) => 0 ) + '' + (( arg : number ) => 104) ;/*64*/ -//// ( ( arg : number = 1 ) => 0 ) + '' + (( arg : number = 2 ) => 105) ;/*65*/ -//// ( ( arg ? : number ) => 0 ) + '' + (( arg ? : number ) => 106) ;/*66*/ -//// ( ( ... arg : number [ ] ) => 0 ) + '' + (( ... arg : number [ ] ) => 107) ;/*67*/ -//// ( ( arg1 , arg2 ? ) => 0 ) + '' + (( arg1 , arg2 ? ) => 108) ;/*68*/ -//// ( ( arg1 , ... arg2 : number [ ] ) => 0 ) + '' + (( arg1 , ... arg2 : number [ ] ) => 108) ;/*69*/ -//// -//// -////// Function Parameters -/////*70*/function foo ( ... arg : any [ ] ) { } -//// -/////*71*/foo ( -/////*72*/ ( a ) => 110 , -/////*73*/ ( ( a ) => 111 ) , -/////*74*/ ( a ) => { -//// return /*75*/112 ; -/////*76*/ } , -/////*77*/ ( a ? ) => 113 , -/////*78*/ ( a , b ? ) => 114 , -/////*79*/ ( a : number ) => 115 , -/////*80*/ ( a : number = 0 ) => 116 , -/////*81*/ ( a = 0 ) => 117 , -/////*82*/ ( a : number = 0 ) => 118 , -/////*83*/ ( a ? , b ? : number ) => 118 , -/////*84*/ ( ... a : number [ ] ) => 119 , -/////*85*/ ( a , b = 0 , ... c : number [ ] ) => 120 , -/////*86*/ ( a ) => ( b ) => ( c ) => 121 , -/////*87*/ false ? ( a ) => 0 : ( b ) => 122 -//// /*88*/) ; -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("() => 1;"); -goTo.marker("2"); -verify.currentLineContentIs("(arg) => 2;"); -goTo.marker("3"); -verify.currentLineContentIs("arg => 2;"); -goTo.marker("4"); -verify.currentLineContentIs("(arg = 1) => 3;"); -goTo.marker("5"); -verify.currentLineContentIs("(arg?) => 4;"); -goTo.marker("6"); -verify.currentLineContentIs("(arg: number) => 5;"); -goTo.marker("7"); -verify.currentLineContentIs("(arg: number = 0) => 6;"); -goTo.marker("8"); -verify.currentLineContentIs("(arg?: number) => 7;"); -goTo.marker("9"); -verify.currentLineContentIs("(...arg: number[]) => 8;"); -goTo.marker("10"); -verify.currentLineContentIs("(arg1, arg2) => 12;"); -goTo.marker("11"); -verify.currentLineContentIs("(arg1 = 1, arg2 = 3) => 13;"); -goTo.marker("12"); -verify.currentLineContentIs("(arg1?, arg2?) => 14;"); -goTo.marker("13"); -verify.currentLineContentIs("(arg1: number, arg2: number) => 15;"); -goTo.marker("14"); -verify.currentLineContentIs("(arg1: number = 0, arg2: number = 1) => 16;"); -goTo.marker("15"); -verify.currentLineContentIs("(arg1?: number, arg2?: number) => 17;"); -goTo.marker("16"); -verify.currentLineContentIs("(arg1, ...arg2: number[]) => 18;"); -goTo.marker("17"); -verify.currentLineContentIs("(arg1, arg2?: number) => 19;"); -goTo.marker("18"); -verify.currentLineContentIs("(() => 21);"); -goTo.marker("19"); -verify.currentLineContentIs("((arg) => 22);"); -goTo.marker("20"); -verify.currentLineContentIs("((arg = 1) => 23);"); -goTo.marker("21"); -verify.currentLineContentIs("((arg?) => 24);"); -goTo.marker("22"); -verify.currentLineContentIs("((arg: number) => 25);"); -goTo.marker("23"); -verify.currentLineContentIs("((arg: number = 0) => 26);"); -goTo.marker("24"); -verify.currentLineContentIs("((arg?: number) => 27);"); -goTo.marker("25"); -verify.currentLineContentIs("((...arg: number[]) => 28);"); -goTo.marker("26"); -verify.currentLineContentIs("(((((arg) => { return 32; }))));"); -goTo.marker("27"); -verify.currentLineContentIs("false ? () => 41 : null;"); -goTo.marker("28"); -verify.currentLineContentIs("false ? (arg) => 42 : null;"); -goTo.marker("29"); -verify.currentLineContentIs("false ? (arg = 1) => 43 : null;"); -goTo.marker("30"); -verify.currentLineContentIs("false ? (arg?) => 44 : null;"); -goTo.marker("31"); -verify.currentLineContentIs("false ? (arg: number) => 45 : null;"); -goTo.marker("32"); -verify.currentLineContentIs("false ? (arg?: number) => 46 : null;"); -goTo.marker("33"); -verify.currentLineContentIs("false ? (arg?: number = 0) => 47 : null;"); -goTo.marker("34"); -verify.currentLineContentIs("false ? (...arg: number[]) => 48 : null;"); -goTo.marker("35"); -verify.currentLineContentIs("false ? (() => 51) : null;"); -goTo.marker("36"); -verify.currentLineContentIs("false ? ((arg) => 52) : null;"); -goTo.marker("37"); -verify.currentLineContentIs("false ? ((arg = 1) => 53) : null;"); -goTo.marker("38"); -verify.currentLineContentIs("false ? ((arg?) => 54) : null;"); -goTo.marker("39"); -verify.currentLineContentIs("false ? ((arg: number) => 55) : null;"); -goTo.marker("40"); -verify.currentLineContentIs("false ? ((arg?: number) => 56) : null;"); -goTo.marker("41"); -verify.currentLineContentIs("false ? ((arg?: number = 0) => 57) : null;"); -goTo.marker("42"); -verify.currentLineContentIs("false ? ((...arg: number[]) => 58) : null;"); -goTo.marker("43"); -verify.currentLineContentIs("false ? null : () => 61;"); -goTo.marker("44"); -verify.currentLineContentIs("false ? null : (arg) => 62;"); -goTo.marker("45"); -verify.currentLineContentIs("false ? null : (arg = 1) => 63;"); -goTo.marker("46"); -verify.currentLineContentIs("false ? null : (arg?) => 64;"); -goTo.marker("47"); -verify.currentLineContentIs("false ? null : (arg: number) => 65;"); -goTo.marker("48"); -verify.currentLineContentIs("false ? null : (arg?: number) => 66;"); -goTo.marker("49"); -verify.currentLineContentIs("false ? null : (arg?: number = 0) => 67;"); -goTo.marker("50"); -verify.currentLineContentIs("false ? null : (...arg: number[]) => 68;"); -goTo.marker("51"); -verify.currentLineContentIs("((a?) => { return a; }) ? (b?) => { return b; } : (c?) => { return c; };"); -goTo.marker("52"); -verify.currentLineContentIs("((a?) => { return a; }) ? (b) => (c) => 81 : (c) => (d) => 82;"); -goTo.marker("53"); -verify.currentLineContentIs("((arg) => 90) instanceof Function;"); -goTo.marker("54"); -verify.currentLineContentIs("((arg = 1) => 91) instanceof Function;"); -goTo.marker("55"); -verify.currentLineContentIs("((arg?) => 92) instanceof Function;"); -goTo.marker("56"); -verify.currentLineContentIs("((arg: number) => 93) instanceof Function;"); -goTo.marker("57"); -verify.currentLineContentIs("((arg: number = 1) => 94) instanceof Function;"); -goTo.marker("58"); -verify.currentLineContentIs("((arg?: number) => 95) instanceof Function;"); -goTo.marker("59"); -verify.currentLineContentIs("((...arg: number[]) => 96) instanceof Function;"); -goTo.marker("60"); -verify.currentLineContentIs("'' + ((arg) => 100);"); - -goTo.marker("61"); -verify.currentLineContentIs("((arg) => 0) + '' + ((arg) => 101);"); -goTo.marker("62"); -verify.currentLineContentIs("((arg = 1) => 0) + '' + ((arg = 2) => 102);"); -goTo.marker("63"); -verify.currentLineContentIs("((arg?) => 0) + '' + ((arg?) => 103);"); -goTo.marker("64"); -verify.currentLineContentIs("((arg: number) => 0) + '' + ((arg: number) => 104);"); -goTo.marker("65"); -verify.currentLineContentIs("((arg: number = 1) => 0) + '' + ((arg: number = 2) => 105);"); -goTo.marker("66"); -verify.currentLineContentIs("((arg?: number) => 0) + '' + ((arg?: number) => 106);"); -goTo.marker("67"); -verify.currentLineContentIs("((...arg: number[]) => 0) + '' + ((...arg: number[]) => 107);"); -goTo.marker("68"); -verify.currentLineContentIs("((arg1, arg2?) => 0) + '' + ((arg1, arg2?) => 108);"); -goTo.marker("69"); -verify.currentLineContentIs("((arg1, ...arg2: number[]) => 0) + '' + ((arg1, ...arg2: number[]) => 108);"); -goTo.marker("70"); -verify.currentLineContentIs("function foo(...arg: any[]) { }"); -goTo.marker("71"); -verify.currentLineContentIs("foo("); -goTo.marker("72"); -verify.currentLineContentIs(" (a) => 110,"); -goTo.marker("73"); -verify.currentLineContentIs(" ((a) => 111),"); -goTo.marker("74"); -verify.currentLineContentIs(" (a) => {"); -goTo.marker("75"); -verify.currentLineContentIs(" return 112;"); -goTo.marker("76"); -verify.currentLineContentIs(" },"); -goTo.marker("77"); -verify.currentLineContentIs(" (a?) => 113,"); -goTo.marker("78"); -verify.currentLineContentIs(" (a, b?) => 114,"); -goTo.marker("79"); -verify.currentLineContentIs(" (a: number) => 115,"); -goTo.marker("80"); -verify.currentLineContentIs(" (a: number = 0) => 116,"); -goTo.marker("81"); -verify.currentLineContentIs(" (a = 0) => 117,"); -goTo.marker("82"); -verify.currentLineContentIs(" (a: number = 0) => 118,"); -goTo.marker("83"); -verify.currentLineContentIs(" (a?, b?: number) => 118,"); -goTo.marker("84"); -verify.currentLineContentIs(" (...a: number[]) => 119,"); -goTo.marker("85"); -verify.currentLineContentIs(" (a, b = 0, ...c: number[]) => 120,"); -goTo.marker("86"); -verify.currentLineContentIs(" (a) => (b) => (c) => 121,"); -goTo.marker("87"); -verify.currentLineContentIs(" false ? (a) => 0 : (b) => 122"); +/// + +////// valid +//// ( ) => 1 ;/*1*/ +//// ( arg ) => 2 ;/*2*/ +//// arg => 2 ;/*3*/ +//// ( arg = 1 ) => 3 ;/*4*/ +//// ( arg ? ) => 4 ;/*5*/ +//// ( arg : number ) => 5 ;/*6*/ +//// ( arg : number = 0 ) => 6 ;/*7*/ +//// ( arg ? : number ) => 7 ;/*8*/ +//// ( ... arg : number [ ] ) => 8 ;/*9*/ +//// ( arg1 , arg2 ) => 12 ;/*10*/ +//// ( arg1 = 1 , arg2 =3 ) => 13 ;/*11*/ +//// ( arg1 ? , arg2 ? ) => 14 ;/*12*/ +//// ( arg1 : number , arg2 : number ) => 15 ;/*13*/ +//// ( arg1 : number = 0 , arg2 : number = 1 ) => 16 ;/*14*/ +//// ( arg1 ? : number , arg2 ? : number ) => 17 ;/*15*/ +//// ( arg1 , ... arg2 : number [ ] ) => 18 ;/*16*/ +//// ( arg1 , arg2 ? : number ) => 19 ;/*17*/ +//// +////// in paren +//// ( ( ) => 21 ) ;/*18*/ +//// ( ( arg ) => 22 ) ;/*19*/ +//// ( ( arg = 1 ) => 23 ) ;/*20*/ +//// ( ( arg ? ) => 24 ) ;/*21*/ +//// ( ( arg : number ) => 25 ) ;/*22*/ +//// ( ( arg : number = 0 ) => 26 ) ;/*23*/ +//// ( ( arg ? : number ) => 27 ) ;/*24*/ +//// ( ( ... arg : number [ ] ) => 28 ) ;/*25*/ +//// +////// in multiple paren +//// ( ( ( ( ( arg ) => { return 32 ; } ) ) ) ) ;/*26*/ +//// +////// in ternary exression +//// false ? ( ) => 41 : null ;/*27*/ +//// false ? ( arg ) => 42 : null ;/*28*/ +//// false ? ( arg = 1 ) => 43 : null ;/*29*/ +//// false ? ( arg ? ) => 44 : null ;/*30*/ +//// false ? ( arg : number ) => 45 : null ;/*31*/ +//// false ? ( arg ? : number ) => 46 : null ;/*32*/ +//// false ? ( arg ? : number = 0 ) => 47 : null ;/*33*/ +//// false ? ( ... arg : number [ ] ) => 48 : null ;/*34*/ +//// +////// in ternary exression within paren +//// false ? ( ( ) => 51 ) : null ;/*35*/ +//// false ? ( ( arg ) => 52 ) : null ;/*36*/ +//// false ? ( ( arg = 1 ) => 53 ) : null ;/*37*/ +//// false ? ( ( arg ? ) => 54 ) : null ;/*38*/ +//// false ? ( ( arg : number ) => 55 ) : null ;/*39*/ +//// false ? ( ( arg ? : number ) => 56 ) : null ;/*40*/ +//// false ? ( ( arg ? : number = 0 ) => 57 ) : null ;/*41*/ +//// false ? ( ( ... arg : number [ ] ) => 58 ) : null ;/*42*/ +//// +////// ternary exression's else clause +//// false ? null : ( ) => 61 ;/*43*/ +//// false ? null : ( arg ) => 62 ;/*44*/ +//// false ? null : ( arg = 1 ) => 63 ;/*45*/ +//// false ? null : ( arg ? ) => 64 ;/*46*/ +//// false ? null : ( arg : number ) => 65 ;/*47*/ +//// false ? null : ( arg ? : number ) => 66 ;/*48*/ +//// false ? null : ( arg ? : number = 0 ) => 67 ;/*49*/ +//// false ? null : ( ... arg : number [ ] ) => 68 ;/*50*/ +//// +//// +////// nested ternary expressions +//// (( a ? ) => { return a ; }) ? ( b ? ) => { return b ; } : ( c ? ) => { return c ; } ;/*51*/ +//// +//////multiple levels +//// (( a ? ) => { return a ; }) ? ( b ) => ( c ) => 81 : ( c ) => ( d ) => 82 ;/*52*/ +//// +//// +////// In Expressions +//// ( ( arg ) => 90 ) instanceof Function ;/*53*/ +//// ( ( arg = 1 ) => 91 ) instanceof Function ;/*54*/ +//// ( ( arg ? ) => 92 ) instanceof Function ;/*55*/ +//// ( ( arg : number ) => 93 ) instanceof Function ;/*56*/ +//// ( ( arg : number = 1 ) => 94 ) instanceof Function ;/*57*/ +//// ( ( arg ? : number ) => 95 ) instanceof Function ;/*58*/ +//// ( ( ... arg : number [ ] ) => 96 ) instanceof Function ;/*59*/ +//// +////'' + (( arg ) => 100) ;/*60*/ +//// ( ( arg ) => 0 ) + '' + (( arg ) => 101) ;/*61*/ +//// ( ( arg = 1 ) => 0 ) + '' + (( arg = 2 ) => 102) ;/*62*/ +//// ( ( arg ? ) => 0 ) + '' + (( arg ? ) => 103) ;/*63*/ +//// ( ( arg : number ) => 0 ) + '' + (( arg : number ) => 104) ;/*64*/ +//// ( ( arg : number = 1 ) => 0 ) + '' + (( arg : number = 2 ) => 105) ;/*65*/ +//// ( ( arg ? : number ) => 0 ) + '' + (( arg ? : number ) => 106) ;/*66*/ +//// ( ( ... arg : number [ ] ) => 0 ) + '' + (( ... arg : number [ ] ) => 107) ;/*67*/ +//// ( ( arg1 , arg2 ? ) => 0 ) + '' + (( arg1 , arg2 ? ) => 108) ;/*68*/ +//// ( ( arg1 , ... arg2 : number [ ] ) => 0 ) + '' + (( arg1 , ... arg2 : number [ ] ) => 108) ;/*69*/ +//// +//// +////// Function Parameters +/////*70*/function foo ( ... arg : any [ ] ) { } +//// +/////*71*/foo ( +/////*72*/ ( a ) => 110 , +/////*73*/ ( ( a ) => 111 ) , +/////*74*/ ( a ) => { +//// return /*75*/112 ; +/////*76*/ } , +/////*77*/ ( a ? ) => 113 , +/////*78*/ ( a , b ? ) => 114 , +/////*79*/ ( a : number ) => 115 , +/////*80*/ ( a : number = 0 ) => 116 , +/////*81*/ ( a = 0 ) => 117 , +/////*82*/ ( a : number = 0 ) => 118 , +/////*83*/ ( a ? , b ? : number ) => 118 , +/////*84*/ ( ... a : number [ ] ) => 119 , +/////*85*/ ( a , b = 0 , ... c : number [ ] ) => 120 , +/////*86*/ ( a ) => ( b ) => ( c ) => 121 , +/////*87*/ false ? ( a ) => 0 : ( b ) => 122 +//// /*88*/) ; +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("() => 1;"); +goTo.marker("2"); +verify.currentLineContentIs("(arg) => 2;"); +goTo.marker("3"); +verify.currentLineContentIs("arg => 2;"); +goTo.marker("4"); +verify.currentLineContentIs("(arg = 1) => 3;"); +goTo.marker("5"); +verify.currentLineContentIs("(arg?) => 4;"); +goTo.marker("6"); +verify.currentLineContentIs("(arg: number) => 5;"); +goTo.marker("7"); +verify.currentLineContentIs("(arg: number = 0) => 6;"); +goTo.marker("8"); +verify.currentLineContentIs("(arg?: number) => 7;"); +goTo.marker("9"); +verify.currentLineContentIs("(...arg: number[]) => 8;"); +goTo.marker("10"); +verify.currentLineContentIs("(arg1, arg2) => 12;"); +goTo.marker("11"); +verify.currentLineContentIs("(arg1 = 1, arg2 = 3) => 13;"); +goTo.marker("12"); +verify.currentLineContentIs("(arg1?, arg2?) => 14;"); +goTo.marker("13"); +verify.currentLineContentIs("(arg1: number, arg2: number) => 15;"); +goTo.marker("14"); +verify.currentLineContentIs("(arg1: number = 0, arg2: number = 1) => 16;"); +goTo.marker("15"); +verify.currentLineContentIs("(arg1?: number, arg2?: number) => 17;"); +goTo.marker("16"); +verify.currentLineContentIs("(arg1, ...arg2: number[]) => 18;"); +goTo.marker("17"); +verify.currentLineContentIs("(arg1, arg2?: number) => 19;"); +goTo.marker("18"); +verify.currentLineContentIs("(() => 21);"); +goTo.marker("19"); +verify.currentLineContentIs("((arg) => 22);"); +goTo.marker("20"); +verify.currentLineContentIs("((arg = 1) => 23);"); +goTo.marker("21"); +verify.currentLineContentIs("((arg?) => 24);"); +goTo.marker("22"); +verify.currentLineContentIs("((arg: number) => 25);"); +goTo.marker("23"); +verify.currentLineContentIs("((arg: number = 0) => 26);"); +goTo.marker("24"); +verify.currentLineContentIs("((arg?: number) => 27);"); +goTo.marker("25"); +verify.currentLineContentIs("((...arg: number[]) => 28);"); +goTo.marker("26"); +verify.currentLineContentIs("(((((arg) => { return 32; }))));"); +goTo.marker("27"); +verify.currentLineContentIs("false ? () => 41 : null;"); +goTo.marker("28"); +verify.currentLineContentIs("false ? (arg) => 42 : null;"); +goTo.marker("29"); +verify.currentLineContentIs("false ? (arg = 1) => 43 : null;"); +goTo.marker("30"); +verify.currentLineContentIs("false ? (arg?) => 44 : null;"); +goTo.marker("31"); +verify.currentLineContentIs("false ? (arg: number) => 45 : null;"); +goTo.marker("32"); +verify.currentLineContentIs("false ? (arg?: number) => 46 : null;"); +goTo.marker("33"); +verify.currentLineContentIs("false ? (arg?: number = 0) => 47 : null;"); +goTo.marker("34"); +verify.currentLineContentIs("false ? (...arg: number[]) => 48 : null;"); +goTo.marker("35"); +verify.currentLineContentIs("false ? (() => 51) : null;"); +goTo.marker("36"); +verify.currentLineContentIs("false ? ((arg) => 52) : null;"); +goTo.marker("37"); +verify.currentLineContentIs("false ? ((arg = 1) => 53) : null;"); +goTo.marker("38"); +verify.currentLineContentIs("false ? ((arg?) => 54) : null;"); +goTo.marker("39"); +verify.currentLineContentIs("false ? ((arg: number) => 55) : null;"); +goTo.marker("40"); +verify.currentLineContentIs("false ? ((arg?: number) => 56) : null;"); +goTo.marker("41"); +verify.currentLineContentIs("false ? ((arg?: number = 0) => 57) : null;"); +goTo.marker("42"); +verify.currentLineContentIs("false ? ((...arg: number[]) => 58) : null;"); +goTo.marker("43"); +verify.currentLineContentIs("false ? null : () => 61;"); +goTo.marker("44"); +verify.currentLineContentIs("false ? null : (arg) => 62;"); +goTo.marker("45"); +verify.currentLineContentIs("false ? null : (arg = 1) => 63;"); +goTo.marker("46"); +verify.currentLineContentIs("false ? null : (arg?) => 64;"); +goTo.marker("47"); +verify.currentLineContentIs("false ? null : (arg: number) => 65;"); +goTo.marker("48"); +verify.currentLineContentIs("false ? null : (arg?: number) => 66;"); +goTo.marker("49"); +verify.currentLineContentIs("false ? null : (arg?: number = 0) => 67;"); +goTo.marker("50"); +verify.currentLineContentIs("false ? null : (...arg: number[]) => 68;"); +goTo.marker("51"); +verify.currentLineContentIs("((a?) => { return a; }) ? (b?) => { return b; } : (c?) => { return c; };"); +goTo.marker("52"); +verify.currentLineContentIs("((a?) => { return a; }) ? (b) => (c) => 81 : (c) => (d) => 82;"); +goTo.marker("53"); +verify.currentLineContentIs("((arg) => 90) instanceof Function;"); +goTo.marker("54"); +verify.currentLineContentIs("((arg = 1) => 91) instanceof Function;"); +goTo.marker("55"); +verify.currentLineContentIs("((arg?) => 92) instanceof Function;"); +goTo.marker("56"); +verify.currentLineContentIs("((arg: number) => 93) instanceof Function;"); +goTo.marker("57"); +verify.currentLineContentIs("((arg: number = 1) => 94) instanceof Function;"); +goTo.marker("58"); +verify.currentLineContentIs("((arg?: number) => 95) instanceof Function;"); +goTo.marker("59"); +verify.currentLineContentIs("((...arg: number[]) => 96) instanceof Function;"); +goTo.marker("60"); +verify.currentLineContentIs("'' + ((arg) => 100);"); + +goTo.marker("61"); +verify.currentLineContentIs("((arg) => 0) + '' + ((arg) => 101);"); +goTo.marker("62"); +verify.currentLineContentIs("((arg = 1) => 0) + '' + ((arg = 2) => 102);"); +goTo.marker("63"); +verify.currentLineContentIs("((arg?) => 0) + '' + ((arg?) => 103);"); +goTo.marker("64"); +verify.currentLineContentIs("((arg: number) => 0) + '' + ((arg: number) => 104);"); +goTo.marker("65"); +verify.currentLineContentIs("((arg: number = 1) => 0) + '' + ((arg: number = 2) => 105);"); +goTo.marker("66"); +verify.currentLineContentIs("((arg?: number) => 0) + '' + ((arg?: number) => 106);"); +goTo.marker("67"); +verify.currentLineContentIs("((...arg: number[]) => 0) + '' + ((...arg: number[]) => 107);"); +goTo.marker("68"); +verify.currentLineContentIs("((arg1, arg2?) => 0) + '' + ((arg1, arg2?) => 108);"); +goTo.marker("69"); +verify.currentLineContentIs("((arg1, ...arg2: number[]) => 0) + '' + ((arg1, ...arg2: number[]) => 108);"); +goTo.marker("70"); +verify.currentLineContentIs("function foo(...arg: any[]) { }"); +goTo.marker("71"); +verify.currentLineContentIs("foo("); +goTo.marker("72"); +verify.currentLineContentIs(" (a) => 110,"); +goTo.marker("73"); +verify.currentLineContentIs(" ((a) => 111),"); +goTo.marker("74"); +verify.currentLineContentIs(" (a) => {"); +goTo.marker("75"); +verify.currentLineContentIs(" return 112;"); +goTo.marker("76"); +verify.currentLineContentIs(" },"); +goTo.marker("77"); +verify.currentLineContentIs(" (a?) => 113,"); +goTo.marker("78"); +verify.currentLineContentIs(" (a, b?) => 114,"); +goTo.marker("79"); +verify.currentLineContentIs(" (a: number) => 115,"); +goTo.marker("80"); +verify.currentLineContentIs(" (a: number = 0) => 116,"); +goTo.marker("81"); +verify.currentLineContentIs(" (a = 0) => 117,"); +goTo.marker("82"); +verify.currentLineContentIs(" (a: number = 0) => 118,"); +goTo.marker("83"); +verify.currentLineContentIs(" (a?, b?: number) => 118,"); +goTo.marker("84"); +verify.currentLineContentIs(" (...a: number[]) => 119,"); +goTo.marker("85"); +verify.currentLineContentIs(" (a, b = 0, ...c: number[]) => 120,"); +goTo.marker("86"); +verify.currentLineContentIs(" (a) => (b) => (c) => 121,"); +goTo.marker("87"); +verify.currentLineContentIs(" false ? (a) => 0 : (b) => 122"); diff --git a/tests/cases/fourslash/formattingKeywordAsIdentifier.ts b/tests/cases/fourslash/formattingKeywordAsIdentifier.ts index aa1a636f624..ee544da345d 100644 --- a/tests/cases/fourslash/formattingKeywordAsIdentifier.ts +++ b/tests/cases/fourslash/formattingKeywordAsIdentifier.ts @@ -1,7 +1,7 @@ -/// - -////declare var module/*1*/ - -goTo.marker("1"); -edit.insert(";"); +/// + +////declare var module/*1*/ + +goTo.marker("1"); +edit.insert(";"); verify.currentLineContentIs("declare var module;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingNestedScopes.ts b/tests/cases/fourslash/formattingNestedScopes.ts index 269a67dcaaf..cbec72d9b11 100644 --- a/tests/cases/fourslash/formattingNestedScopes.ts +++ b/tests/cases/fourslash/formattingNestedScopes.ts @@ -1,4 +1,4 @@ -/// +/// /////*1*/ module My.App { /////*2*/export var appModule = angular.module("app", [ diff --git a/tests/cases/fourslash/formattingOnClasses.ts b/tests/cases/fourslash/formattingOnClasses.ts index 91e63eb3c97..045ee91e427 100644 --- a/tests/cases/fourslash/formattingOnClasses.ts +++ b/tests/cases/fourslash/formattingOnClasses.ts @@ -1,207 +1,207 @@ -/// - -/////*1*/ class a { -/////*2*/ constructor ( n : number ) ; -/////*3*/ constructor ( s : string ) ; -/////*4*/ constructor ( ns : any ) { -//// -/////*5*/ } -//// -/////*6*/ public pgF ( ) { } -//// -/////*7*/ public pv ; -/////*8*/ public get d ( ) { -/////*9*/ return 30 ; -/////*10*/ } -/////*11*/ public set d ( number ) { -/////*12*/ } -//// -/////*13*/ public static get p2 ( ) { -/////*14*/ return { x : 30 , y : 40 } ; -/////*15*/ } -//// -/////*16*/ private static d2 ( ) { -/////*17*/ } -/////*18*/ private static get p3 ( ) { -/////*19*/ return "string" ; -/////*20*/ } -/////*21*/ private pv3 ; -//// -/////*22*/ private foo ( n : number ) : string ; -/////*23*/ private foo ( s : string ) : string ; -/////*24*/ private foo ( ns : any ) { -/////*25*/ return ns.toString ( ) ; -/////*26*/ } -/////*27*/} -//// -/////*28*/ class b extends a { -/////*29*/} -//// -/////*30*/ class m1b { -//// -/////*31*/} -//// -/////*32*/ interface m1ib { -//// -/////*33*/ } -/////*34*/ class c extends m1b { -/////*35*/} -//// -/////*36*/ class ib2 implements m1ib { -/////*37*/} -//// -/////*38*/ declare class aAmbient { -/////*39*/ constructor ( n : number ) ; -/////*40*/ constructor ( s : string ) ; -/////*41*/ public pgF ( ) : void ; -/////*42*/ public pv ; -/////*43*/ public d : number ; -/////*44*/ static p2 : { x : number ; y : number ; } ; -/////*45*/ static d2 ( ) ; -/////*46*/ static p3 ; -/////*47*/ private pv3 ; -/////*48*/ private foo ( s ) ; -/////*49*/} -//// -/////*50*/ class d { -/////*51*/ private foo ( n : number ) : string ; -/////*52*/ private foo ( s : string ) : string ; -/////*53*/ private foo ( ns : any ) { -/////*54*/ return ns.toString ( ) ; -/////*55*/ } -/////*56*/} -//// -/////*57*/ class e { -/////*58*/ private foo ( s : string ) : string ; -/////*59*/ private foo ( n : number ) : string ; -/////*60*/ private foo ( ns : any ) { -/////*61*/ return ns.toString ( ) ; -/////*62*/ } -/////*63*/} -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("class a {"); -goTo.marker("2"); -verify.currentLineContentIs(" constructor(n: number);"); -goTo.marker("3"); -verify.currentLineContentIs(" constructor(s: string);"); -goTo.marker("4"); -verify.currentLineContentIs(" constructor(ns: any) {"); -goTo.marker("5"); -verify.currentLineContentIs(" }"); -goTo.marker("6"); -verify.currentLineContentIs(" public pgF() { }"); -goTo.marker("7"); -verify.currentLineContentIs(" public pv;"); -goTo.marker("8"); -verify.currentLineContentIs(" public get d() {"); -goTo.marker("9"); -verify.currentLineContentIs(" return 30;"); -goTo.marker("10"); -verify.currentLineContentIs(" }"); -goTo.marker("11"); -verify.currentLineContentIs(" public set d(number) {"); -goTo.marker("12"); -verify.currentLineContentIs(" }"); -goTo.marker("13"); -verify.currentLineContentIs(" public static get p2() {"); -goTo.marker("14"); -verify.currentLineContentIs(" return { x: 30, y: 40 };"); -goTo.marker("15"); -verify.currentLineContentIs(" }"); -goTo.marker("16"); -verify.currentLineContentIs(" private static d2() {"); -goTo.marker("17"); -verify.currentLineContentIs(" }"); -goTo.marker("18"); -verify.currentLineContentIs(" private static get p3() {"); -goTo.marker("19"); -verify.currentLineContentIs(' return "string";'); -goTo.marker("20"); -verify.currentLineContentIs(" }"); -goTo.marker("21"); -verify.currentLineContentIs(" private pv3;"); -goTo.marker("22"); -verify.currentLineContentIs(" private foo(n: number): string;"); -goTo.marker("23"); -verify.currentLineContentIs(" private foo(s: string): string;"); -goTo.marker("24"); -verify.currentLineContentIs(" private foo(ns: any) {"); -goTo.marker("25"); -verify.currentLineContentIs(" return ns.toString();"); -goTo.marker("26"); -verify.currentLineContentIs(" }"); -goTo.marker("27"); -verify.currentLineContentIs("}"); -goTo.marker("28"); -verify.currentLineContentIs("class b extends a {"); -goTo.marker("29"); -verify.currentLineContentIs("}"); -goTo.marker("30"); -verify.currentLineContentIs("class m1b {"); -goTo.marker("31"); -verify.currentLineContentIs("}"); -goTo.marker("32"); -verify.currentLineContentIs("interface m1ib {"); -goTo.marker("33"); -verify.currentLineContentIs("}"); -goTo.marker("34"); -verify.currentLineContentIs("class c extends m1b {"); -goTo.marker("35"); -verify.currentLineContentIs("}"); -goTo.marker("36"); -verify.currentLineContentIs("class ib2 implements m1ib {"); -goTo.marker("37"); -verify.currentLineContentIs("}"); -goTo.marker("38"); -verify.currentLineContentIs("declare class aAmbient {"); -goTo.marker("39"); -verify.currentLineContentIs(" constructor(n: number);"); -goTo.marker("40"); -verify.currentLineContentIs(" constructor(s: string);"); -goTo.marker("41"); -verify.currentLineContentIs(" public pgF(): void;"); -goTo.marker("42"); -verify.currentLineContentIs(" public pv;"); -goTo.marker("43"); -verify.currentLineContentIs(" public d: number;"); -goTo.marker("44"); -verify.currentLineContentIs(" static p2: { x: number; y: number; };"); -goTo.marker("45"); -verify.currentLineContentIs(" static d2();"); -goTo.marker("46"); -verify.currentLineContentIs(" static p3;"); -goTo.marker("47"); -verify.currentLineContentIs(" private pv3;"); -goTo.marker("48"); -verify.currentLineContentIs(" private foo(s);"); -goTo.marker("49"); -verify.currentLineContentIs("}"); -goTo.marker("50"); -verify.currentLineContentIs("class d {"); -goTo.marker("51"); -verify.currentLineContentIs(" private foo(n: number): string;"); -goTo.marker("52"); -verify.currentLineContentIs(" private foo(s: string): string;"); -goTo.marker("53"); -verify.currentLineContentIs(" private foo(ns: any) {"); -goTo.marker("54"); -verify.currentLineContentIs(" return ns.toString();"); -goTo.marker("55"); -verify.currentLineContentIs(" }"); -goTo.marker("56"); -verify.currentLineContentIs("}"); -goTo.marker("57"); -verify.currentLineContentIs("class e {"); -goTo.marker("58"); -verify.currentLineContentIs(" private foo(s: string): string;"); -goTo.marker("59"); -verify.currentLineContentIs(" private foo(n: number): string;"); -goTo.marker("60"); -verify.currentLineContentIs(" private foo(ns: any) {"); -goTo.marker("61"); -verify.currentLineContentIs(" return ns.toString();"); -goTo.marker("62"); -verify.currentLineContentIs(" }"); -goTo.marker("63"); +/// + +/////*1*/ class a { +/////*2*/ constructor ( n : number ) ; +/////*3*/ constructor ( s : string ) ; +/////*4*/ constructor ( ns : any ) { +//// +/////*5*/ } +//// +/////*6*/ public pgF ( ) { } +//// +/////*7*/ public pv ; +/////*8*/ public get d ( ) { +/////*9*/ return 30 ; +/////*10*/ } +/////*11*/ public set d ( number ) { +/////*12*/ } +//// +/////*13*/ public static get p2 ( ) { +/////*14*/ return { x : 30 , y : 40 } ; +/////*15*/ } +//// +/////*16*/ private static d2 ( ) { +/////*17*/ } +/////*18*/ private static get p3 ( ) { +/////*19*/ return "string" ; +/////*20*/ } +/////*21*/ private pv3 ; +//// +/////*22*/ private foo ( n : number ) : string ; +/////*23*/ private foo ( s : string ) : string ; +/////*24*/ private foo ( ns : any ) { +/////*25*/ return ns.toString ( ) ; +/////*26*/ } +/////*27*/} +//// +/////*28*/ class b extends a { +/////*29*/} +//// +/////*30*/ class m1b { +//// +/////*31*/} +//// +/////*32*/ interface m1ib { +//// +/////*33*/ } +/////*34*/ class c extends m1b { +/////*35*/} +//// +/////*36*/ class ib2 implements m1ib { +/////*37*/} +//// +/////*38*/ declare class aAmbient { +/////*39*/ constructor ( n : number ) ; +/////*40*/ constructor ( s : string ) ; +/////*41*/ public pgF ( ) : void ; +/////*42*/ public pv ; +/////*43*/ public d : number ; +/////*44*/ static p2 : { x : number ; y : number ; } ; +/////*45*/ static d2 ( ) ; +/////*46*/ static p3 ; +/////*47*/ private pv3 ; +/////*48*/ private foo ( s ) ; +/////*49*/} +//// +/////*50*/ class d { +/////*51*/ private foo ( n : number ) : string ; +/////*52*/ private foo ( s : string ) : string ; +/////*53*/ private foo ( ns : any ) { +/////*54*/ return ns.toString ( ) ; +/////*55*/ } +/////*56*/} +//// +/////*57*/ class e { +/////*58*/ private foo ( s : string ) : string ; +/////*59*/ private foo ( n : number ) : string ; +/////*60*/ private foo ( ns : any ) { +/////*61*/ return ns.toString ( ) ; +/////*62*/ } +/////*63*/} +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("class a {"); +goTo.marker("2"); +verify.currentLineContentIs(" constructor(n: number);"); +goTo.marker("3"); +verify.currentLineContentIs(" constructor(s: string);"); +goTo.marker("4"); +verify.currentLineContentIs(" constructor(ns: any) {"); +goTo.marker("5"); +verify.currentLineContentIs(" }"); +goTo.marker("6"); +verify.currentLineContentIs(" public pgF() { }"); +goTo.marker("7"); +verify.currentLineContentIs(" public pv;"); +goTo.marker("8"); +verify.currentLineContentIs(" public get d() {"); +goTo.marker("9"); +verify.currentLineContentIs(" return 30;"); +goTo.marker("10"); +verify.currentLineContentIs(" }"); +goTo.marker("11"); +verify.currentLineContentIs(" public set d(number) {"); +goTo.marker("12"); +verify.currentLineContentIs(" }"); +goTo.marker("13"); +verify.currentLineContentIs(" public static get p2() {"); +goTo.marker("14"); +verify.currentLineContentIs(" return { x: 30, y: 40 };"); +goTo.marker("15"); +verify.currentLineContentIs(" }"); +goTo.marker("16"); +verify.currentLineContentIs(" private static d2() {"); +goTo.marker("17"); +verify.currentLineContentIs(" }"); +goTo.marker("18"); +verify.currentLineContentIs(" private static get p3() {"); +goTo.marker("19"); +verify.currentLineContentIs(' return "string";'); +goTo.marker("20"); +verify.currentLineContentIs(" }"); +goTo.marker("21"); +verify.currentLineContentIs(" private pv3;"); +goTo.marker("22"); +verify.currentLineContentIs(" private foo(n: number): string;"); +goTo.marker("23"); +verify.currentLineContentIs(" private foo(s: string): string;"); +goTo.marker("24"); +verify.currentLineContentIs(" private foo(ns: any) {"); +goTo.marker("25"); +verify.currentLineContentIs(" return ns.toString();"); +goTo.marker("26"); +verify.currentLineContentIs(" }"); +goTo.marker("27"); +verify.currentLineContentIs("}"); +goTo.marker("28"); +verify.currentLineContentIs("class b extends a {"); +goTo.marker("29"); +verify.currentLineContentIs("}"); +goTo.marker("30"); +verify.currentLineContentIs("class m1b {"); +goTo.marker("31"); +verify.currentLineContentIs("}"); +goTo.marker("32"); +verify.currentLineContentIs("interface m1ib {"); +goTo.marker("33"); +verify.currentLineContentIs("}"); +goTo.marker("34"); +verify.currentLineContentIs("class c extends m1b {"); +goTo.marker("35"); +verify.currentLineContentIs("}"); +goTo.marker("36"); +verify.currentLineContentIs("class ib2 implements m1ib {"); +goTo.marker("37"); +verify.currentLineContentIs("}"); +goTo.marker("38"); +verify.currentLineContentIs("declare class aAmbient {"); +goTo.marker("39"); +verify.currentLineContentIs(" constructor(n: number);"); +goTo.marker("40"); +verify.currentLineContentIs(" constructor(s: string);"); +goTo.marker("41"); +verify.currentLineContentIs(" public pgF(): void;"); +goTo.marker("42"); +verify.currentLineContentIs(" public pv;"); +goTo.marker("43"); +verify.currentLineContentIs(" public d: number;"); +goTo.marker("44"); +verify.currentLineContentIs(" static p2: { x: number; y: number; };"); +goTo.marker("45"); +verify.currentLineContentIs(" static d2();"); +goTo.marker("46"); +verify.currentLineContentIs(" static p3;"); +goTo.marker("47"); +verify.currentLineContentIs(" private pv3;"); +goTo.marker("48"); +verify.currentLineContentIs(" private foo(s);"); +goTo.marker("49"); +verify.currentLineContentIs("}"); +goTo.marker("50"); +verify.currentLineContentIs("class d {"); +goTo.marker("51"); +verify.currentLineContentIs(" private foo(n: number): string;"); +goTo.marker("52"); +verify.currentLineContentIs(" private foo(s: string): string;"); +goTo.marker("53"); +verify.currentLineContentIs(" private foo(ns: any) {"); +goTo.marker("54"); +verify.currentLineContentIs(" return ns.toString();"); +goTo.marker("55"); +verify.currentLineContentIs(" }"); +goTo.marker("56"); +verify.currentLineContentIs("}"); +goTo.marker("57"); +verify.currentLineContentIs("class e {"); +goTo.marker("58"); +verify.currentLineContentIs(" private foo(s: string): string;"); +goTo.marker("59"); +verify.currentLineContentIs(" private foo(n: number): string;"); +goTo.marker("60"); +verify.currentLineContentIs(" private foo(ns: any) {"); +goTo.marker("61"); +verify.currentLineContentIs(" return ns.toString();"); +goTo.marker("62"); +verify.currentLineContentIs(" }"); +goTo.marker("63"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnClosingBracket.ts b/tests/cases/fourslash/formattingOnClosingBracket.ts index babfd39b90c..08909753317 100644 --- a/tests/cases/fourslash/formattingOnClosingBracket.ts +++ b/tests/cases/fourslash/formattingOnClosingBracket.ts @@ -1,91 +1,91 @@ -/// - -////function f( ) {/*1*/ -////var x = 3;/*2*/ -//// var z = 2 ;/*3*/ -//// a = z ++ - 2 * x ;/*4*/ -//// for ( ; ; ) {/*5*/ -//// a+=(g +g)*a%t;/*6*/ -//// b -- ;/*7*/ -////}/*8*/ -//// -//// switch ( a )/*9*/ -//// { -//// case 1 : {/*10*/ -//// a ++ ;/*11*/ -//// b--;/*12*/ -//// if(a===a)/*13*/ -//// return;/*14*/ -//// else/*15*/ -//// { -//// for(a in b)/*16*/ -//// if(a!=a)/*17*/ -//// { -//// for(a in b)/*18*/ -//// { -////a++;/*19*/ -//// }/*20*/ -//// }/*21*/ -//// }/*22*/ -//// }/*23*/ -//// default:/*24*/ -//// break;/*25*/ -//// }/*26*/ -////}/*27*/ - -format.setOption("InsertSpaceAfterSemicolonInForStatements", true); -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("function f() {"); -goTo.marker("2"); -verify.currentLineContentIs(" var x = 3;"); -goTo.marker("3"); -verify.currentLineContentIs(" var z = 2;"); -goTo.marker("4"); -verify.currentLineContentIs(" a = z++ - 2 * x;"); -goTo.marker("5"); -verify.currentLineContentIs(" for (; ;) {"); -goTo.marker("6"); -verify.currentLineContentIs(" a += (g + g) * a % t;"); -goTo.marker("7"); -verify.currentLineContentIs(" b--;"); -goTo.marker("8"); -verify.currentLineContentIs(" }"); -goTo.marker("9"); -verify.currentLineContentIs(" switch (a) {"); -goTo.marker("10"); -verify.currentLineContentIs(" case 1: {"); -goTo.marker("11"); -verify.currentLineContentIs(" a++;"); -goTo.marker("12"); -verify.currentLineContentIs(" b--;"); -goTo.marker("13"); -verify.currentLineContentIs(" if (a === a)"); -goTo.marker("14"); -verify.currentLineContentIs(" return;"); -goTo.marker("15"); -verify.currentLineContentIs(" else {"); -goTo.marker("16"); -verify.currentLineContentIs(" for (a in b)"); -goTo.marker("17"); -verify.currentLineContentIs(" if (a != a) {"); -goTo.marker("18"); -verify.currentLineContentIs(" for (a in b) {"); -goTo.marker("19"); -verify.currentLineContentIs(" a++;"); -goTo.marker("20"); -verify.currentLineContentIs(" }"); -goTo.marker("21"); -verify.currentLineContentIs(" }"); -goTo.marker("22"); -verify.currentLineContentIs(" }"); -goTo.marker("23"); -verify.currentLineContentIs(" }"); -goTo.marker("24"); -verify.currentLineContentIs(" default:"); -goTo.marker("25"); -verify.currentLineContentIs(" break;"); -goTo.marker("26"); -verify.currentLineContentIs(" }"); -goTo.marker("27"); +/// + +////function f( ) {/*1*/ +////var x = 3;/*2*/ +//// var z = 2 ;/*3*/ +//// a = z ++ - 2 * x ;/*4*/ +//// for ( ; ; ) {/*5*/ +//// a+=(g +g)*a%t;/*6*/ +//// b -- ;/*7*/ +////}/*8*/ +//// +//// switch ( a )/*9*/ +//// { +//// case 1 : {/*10*/ +//// a ++ ;/*11*/ +//// b--;/*12*/ +//// if(a===a)/*13*/ +//// return;/*14*/ +//// else/*15*/ +//// { +//// for(a in b)/*16*/ +//// if(a!=a)/*17*/ +//// { +//// for(a in b)/*18*/ +//// { +////a++;/*19*/ +//// }/*20*/ +//// }/*21*/ +//// }/*22*/ +//// }/*23*/ +//// default:/*24*/ +//// break;/*25*/ +//// }/*26*/ +////}/*27*/ + +format.setOption("InsertSpaceAfterSemicolonInForStatements", true); +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("function f() {"); +goTo.marker("2"); +verify.currentLineContentIs(" var x = 3;"); +goTo.marker("3"); +verify.currentLineContentIs(" var z = 2;"); +goTo.marker("4"); +verify.currentLineContentIs(" a = z++ - 2 * x;"); +goTo.marker("5"); +verify.currentLineContentIs(" for (; ;) {"); +goTo.marker("6"); +verify.currentLineContentIs(" a += (g + g) * a % t;"); +goTo.marker("7"); +verify.currentLineContentIs(" b--;"); +goTo.marker("8"); +verify.currentLineContentIs(" }"); +goTo.marker("9"); +verify.currentLineContentIs(" switch (a) {"); +goTo.marker("10"); +verify.currentLineContentIs(" case 1: {"); +goTo.marker("11"); +verify.currentLineContentIs(" a++;"); +goTo.marker("12"); +verify.currentLineContentIs(" b--;"); +goTo.marker("13"); +verify.currentLineContentIs(" if (a === a)"); +goTo.marker("14"); +verify.currentLineContentIs(" return;"); +goTo.marker("15"); +verify.currentLineContentIs(" else {"); +goTo.marker("16"); +verify.currentLineContentIs(" for (a in b)"); +goTo.marker("17"); +verify.currentLineContentIs(" if (a != a) {"); +goTo.marker("18"); +verify.currentLineContentIs(" for (a in b) {"); +goTo.marker("19"); +verify.currentLineContentIs(" a++;"); +goTo.marker("20"); +verify.currentLineContentIs(" }"); +goTo.marker("21"); +verify.currentLineContentIs(" }"); +goTo.marker("22"); +verify.currentLineContentIs(" }"); +goTo.marker("23"); +verify.currentLineContentIs(" }"); +goTo.marker("24"); +verify.currentLineContentIs(" default:"); +goTo.marker("25"); +verify.currentLineContentIs(" break;"); +goTo.marker("26"); +verify.currentLineContentIs(" }"); +goTo.marker("27"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnCommaOperator.ts b/tests/cases/fourslash/formattingOnCommaOperator.ts index 00626f992ca..1b8ec5087ac 100644 --- a/tests/cases/fourslash/formattingOnCommaOperator.ts +++ b/tests/cases/fourslash/formattingOnCommaOperator.ts @@ -1,13 +1,13 @@ -/// - -////var v1 = ((1, 2, 3), 4, 5, (6, 7));/*1*/ -////function f1() { -//// var a = 1; -//// return a, v1, a;/*2*/ -////} - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("var v1 = ((1, 2, 3), 4, 5, (6, 7));"); -goTo.marker("2"); +/// + +////var v1 = ((1, 2, 3), 4, 5, (6, 7));/*1*/ +////function f1() { +//// var a = 1; +//// return a, v1, a;/*2*/ +////} + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("var v1 = ((1, 2, 3), 4, 5, (6, 7));"); +goTo.marker("2"); verify.currentLineContentIs(" return a, v1, a;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts b/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts index ccc00b587e2..848f9943925 100644 --- a/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts +++ b/tests/cases/fourslash/formattingOnDoWhileNoSemicolon.ts @@ -1,19 +1,19 @@ -/// - -/////*2*/do { -/////*3*/ for (var i = 0; i < 10; i++) -/////*4*/ i -= 2 -/////*5*/ }/*1*/while (1 !== 1) -goTo.marker("1"); -edit.insert("\r\n"); -verify.currentLineContentIs("while (1 !== 1)"); -goTo.marker("2"); -verify.currentLineContentIs("do {"); -goTo.marker("3"); -verify.currentLineContentIs(" for (var i = 0; i < 10; i++)"); -goTo.marker("4"); -verify.currentLineContentIs(" i -= 2"); -goTo.marker("5"); -//bug 718362 expected result : "}" , actual result : " }" -//verify.currentLineContentIs("}"); +/// + +/////*2*/do { +/////*3*/ for (var i = 0; i < 10; i++) +/////*4*/ i -= 2 +/////*5*/ }/*1*/while (1 !== 1) +goTo.marker("1"); +edit.insert("\r\n"); +verify.currentLineContentIs("while (1 !== 1)"); +goTo.marker("2"); +verify.currentLineContentIs("do {"); +goTo.marker("3"); +verify.currentLineContentIs(" for (var i = 0; i < 10; i++)"); +goTo.marker("4"); +verify.currentLineContentIs(" i -= 2"); +goTo.marker("5"); +//bug 718362 expected result : "}" , actual result : " }" +//verify.currentLineContentIs("}"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnDocumentReadyFunction.ts b/tests/cases/fourslash/formattingOnDocumentReadyFunction.ts index 17a7f34c98c..ecc42c05320 100644 --- a/tests/cases/fourslash/formattingOnDocumentReadyFunction.ts +++ b/tests/cases/fourslash/formattingOnDocumentReadyFunction.ts @@ -1,12 +1,12 @@ -/// - -/////*1*/$ ( document ) . ready ( function ( ) { -/////*2*/ alert ( 'i am ready' ) ; -/////*3*/ } ); -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("$(document).ready(function() {"); -goTo.marker("2"); -verify.currentLineContentIs(" alert('i am ready');"); -goTo.marker("3"); +/// + +/////*1*/$ ( document ) . ready ( function ( ) { +/////*2*/ alert ( 'i am ready' ) ; +/////*3*/ } ); +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("$(document).ready(function() {"); +goTo.marker("2"); +verify.currentLineContentIs(" alert('i am ready');"); +goTo.marker("3"); verify.currentLineContentIs("});"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnEmptyInterfaceLiteral.ts b/tests/cases/fourslash/formattingOnEmptyInterfaceLiteral.ts index 5710357c377..bd82ed698c0 100644 --- a/tests/cases/fourslash/formattingOnEmptyInterfaceLiteral.ts +++ b/tests/cases/fourslash/formattingOnEmptyInterfaceLiteral.ts @@ -1,25 +1,25 @@ -/// - -/////*1*/ function foo ( x : { } ) { } -//// -/////*2*/foo ( { } ) ; -//// -//// -//// -/////*3*/ interface bar { -/////*4*/ x : { } ; -/////*5*/ y : ( ) => { } ; -/////*6*/ } -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("function foo(x: {}) { }"); -goTo.marker("2"); -verify.currentLineContentIs("foo({});"); -goTo.marker("3"); -verify.currentLineContentIs("interface bar {"); -goTo.marker("4"); -verify.currentLineContentIs(" x: {};"); -goTo.marker("5"); -verify.currentLineContentIs(" y: () => {};"); -goTo.marker("6"); +/// + +/////*1*/ function foo ( x : { } ) { } +//// +/////*2*/foo ( { } ) ; +//// +//// +//// +/////*3*/ interface bar { +/////*4*/ x : { } ; +/////*5*/ y : ( ) => { } ; +/////*6*/ } +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("function foo(x: {}) { }"); +goTo.marker("2"); +verify.currentLineContentIs("foo({});"); +goTo.marker("3"); +verify.currentLineContentIs("interface bar {"); +goTo.marker("4"); +verify.currentLineContentIs(" x: {};"); +goTo.marker("5"); +verify.currentLineContentIs(" y: () => {};"); +goTo.marker("6"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnInvalidCodes.ts b/tests/cases/fourslash/formattingOnInvalidCodes.ts index c42412628b6..c5d71020249 100644 --- a/tests/cases/fourslash/formattingOnInvalidCodes.ts +++ b/tests/cases/fourslash/formattingOnInvalidCodes.ts @@ -1,273 +1,273 @@ -/// - -/////*1*/var a;var c , b;var $d -/////*2*/var $e -/////*3*/var f -/////*4*/a++;b++; -//// -/////*5*/function f ( ) { -/////*6*/ for (i = 0; i < 10; i++) { -/////*7*/ k = abc + 123 ^ d; -/////*8*/ a = XYZ[m (a[b[c][d]])]; -/////*9*/ break; -//// -/////*10*/ switch ( variable){ -/////*11*/ case 1: abc += 425; -/////*12*/break; -/////*13*/case 404 : a [x--/2]%=3 ; -/////*14*/ break ; -/////*15*/ case vari : v[--x ] *=++y*( m + n / k[z]); -/////*16*/ for (a in b){ -/////*17*/ for (a = 0; a < 10; ++a) { -/////*18*/ a++;--a; -/////*19*/ if (a == b) { -/////*20*/ a++;b--; -/////*21*/ } -/////*22*/else -/////*23*/if (a == c){ -/////*24*/++a; -/////*25*/(--c)+=d; -/////*26*/$c = $a + --$b; -/////*27*/} -/////*28*/if (a == b) -/////*29*/if (a != b) { -/////*30*/ if (a !== b) -/////*31*/ if (a === b) -/////*32*/ --a; -/////*33*/ else -/////*34*/ --a; -/////*35*/ else { -/////*36*/ a--;++b; -/////*37*/a++ -/////*38*/ } -/////*39*/ } -/////*40*/ } -/////*41*/ for (x in y) { -/////*42*/m-=m; -/////*43*/k=1+2+3+4; -/////*44*/} -/////*45*/} -/////*46*/ break; -//// -/////*47*/ } -/////*48*/ } -/////*49*/ var a ={b:function(){}}; -/////*50*/ return {a:1,b:2} -/////*51*/} -//// -/////*52*/var z = 1; -/////*53*/ for (i = 0; i < 10; i++) -/////*54*/ for (j = 0; j < 10; j++) -/////*55*/for (k = 0; k < 10; ++k) { -/////*56*/z++; -/////*57*/} -//// -/////*58*/for (k = 0; k < 10; k += 2) { -/////*59*/z++; -/////*60*/} -//// -/////*61*/ $(document).ready (); -//// -//// -/////*62*/ function pageLoad() { -/////*63*/ $('#TextBox1' ) . unbind ( ) ; -/////*64*/$('#TextBox1' ) . datepicker ( ) ; -/////*65*/} -//// -/////*66*/ function pageLoad ( ) { -/////*67*/ var webclass=[ -/////*68*/ { 'student' :/*69*/ -/////*70*/ { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } -/////*71*/ } , -/////*72*/{ 'student':/*73*/ -/////*74*/{'id':'2','name':'Adam Davidson','legacySkill':'Cobol,MainFrame'} -/////*75*/} , -/////*76*/ { 'student':/*77*/ -/////*78*/{ 'id':'3','name':'Charles Boyer' ,'legacySkill':'HTML, XML'} -/////*79*/} -/////*80*/ ]; -//// -/////*81*/$create(Sys.UI.DataView,{data:webclass},null,null,$get('SList')); -//// -/////*82*/} -//// -/////*83*/$( document ).ready(function(){ -/////*84*/alert('hello'); -/////*85*/ } ) ; -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("var a; var c, b; var $d"); -goTo.marker("2"); -verify.currentLineContentIs("var $e"); -goTo.marker("3"); -verify.currentLineContentIs("var f"); -goTo.marker("4"); -verify.currentLineContentIs("a++; b++;"); -goTo.marker("5"); -verify.currentLineContentIs("function f() {"); -goTo.marker("6"); -verify.currentLineContentIs(" for (i = 0; i < 10; i++) {"); -goTo.marker("7"); -verify.currentLineContentIs(" k = abc + 123 ^ d;"); -goTo.marker("8"); -verify.currentLineContentIs(" a = XYZ[m(a[b[c][d]])];"); -goTo.marker("9"); -verify.currentLineContentIs(" break;"); -goTo.marker("10"); -verify.currentLineContentIs(" switch (variable) {"); -goTo.marker("11"); -verify.currentLineContentIs(" case 1: abc += 425;"); -goTo.marker("12"); -verify.currentLineContentIs(" break;"); -goTo.marker("13"); -verify.currentLineContentIs(" case 404: a[x-- / 2] %= 3;"); -goTo.marker("14"); -verify.currentLineContentIs(" break;"); -goTo.marker("15"); -verify.currentLineContentIs(" case vari: v[--x] *= ++y * (m + n / k[z]);"); -goTo.marker("16"); -verify.currentLineContentIs(" for (a in b) {"); -goTo.marker("17"); -verify.currentLineContentIs(" for (a = 0; a < 10; ++a) {"); -goTo.marker("18"); -verify.currentLineContentIs(" a++; --a;"); -goTo.marker("19"); -verify.currentLineContentIs(" if (a == b) {"); -goTo.marker("20"); -verify.currentLineContentIs(" a++; b--;"); -goTo.marker("21"); -verify.currentLineContentIs(" }"); -goTo.marker("22"); -verify.currentLineContentIs(" else"); -goTo.marker("23"); -verify.currentLineContentIs(" if (a == c) {"); -goTo.marker("24"); -verify.currentLineContentIs(" ++a;"); -goTo.marker("25"); -verify.currentLineContentIs(" (--c) += d;"); -goTo.marker("26"); -verify.currentLineContentIs(" $c = $a + --$b;"); -goTo.marker("27"); -verify.currentLineContentIs(" }"); -goTo.marker("28"); -verify.currentLineContentIs(" if (a == b)"); -goTo.marker("29"); -verify.currentLineContentIs(" if (a != b) {"); -goTo.marker("30"); -verify.currentLineContentIs(" if (a !== b)"); -goTo.marker("31"); -verify.currentLineContentIs(" if (a === b)"); -goTo.marker("32"); -verify.currentLineContentIs(" --a;"); -goTo.marker("33"); -verify.currentLineContentIs(" else"); -goTo.marker("34"); -verify.currentLineContentIs(" --a;"); -goTo.marker("35"); -verify.currentLineContentIs(" else {"); -goTo.marker("36"); -verify.currentLineContentIs(" a--; ++b;"); -goTo.marker("37"); -verify.currentLineContentIs(" a++"); -goTo.marker("38"); -//bug 697788 expect result : " }", actual result : " }" -//verify.currentLineContentIs(" }"); -verify.currentLineContentIs(" }"); -goTo.marker("39"); -verify.currentLineContentIs(" }"); -goTo.marker("40"); -verify.currentLineContentIs(" }"); -goTo.marker("41"); -verify.currentLineContentIs(" for (x in y) {"); -goTo.marker("42"); -verify.currentLineContentIs(" m -= m;"); -goTo.marker("43"); -verify.currentLineContentIs(" k = 1 + 2 + 3 + 4;"); -goTo.marker("44"); -verify.currentLineContentIs(" }"); -goTo.marker("45"); -verify.currentLineContentIs(" }"); -goTo.marker("46"); -verify.currentLineContentIs(" break;"); -goTo.marker("47"); -verify.currentLineContentIs(" }"); -goTo.marker("48"); -verify.currentLineContentIs(" }"); -goTo.marker("49"); -//bug 704204 expect result : " var a = { b: function () { } };", actual result : " var a = { b: function() { } };" -//verify.currentLineContentIs(" var a = { b: function () { } };"); -verify.currentLineContentIs(" var a = { b: function() { } };"); -goTo.marker("50"); -verify.currentLineContentIs(" return { a: 1, b: 2 }"); -goTo.marker("51"); -verify.currentLineContentIs("}"); -goTo.marker("52"); -verify.currentLineContentIs("var z = 1;"); -goTo.marker("53"); -verify.currentLineContentIs("for (i = 0; i < 10; i++)"); -goTo.marker("54"); -verify.currentLineContentIs(" for (j = 0; j < 10; j++)"); -goTo.marker("55"); -verify.currentLineContentIs(" for (k = 0; k < 10; ++k) {"); -goTo.marker("56"); -verify.currentLineContentIs(" z++;"); -goTo.marker("57"); -verify.currentLineContentIs(" }"); -goTo.marker("58"); -verify.currentLineContentIs("for (k = 0; k < 10; k += 2) {"); -goTo.marker("59"); -verify.currentLineContentIs(" z++;"); -goTo.marker("60"); -verify.currentLineContentIs("}"); -goTo.marker("61"); -verify.currentLineContentIs("$(document).ready();"); -goTo.marker("62"); -verify.currentLineContentIs("function pageLoad() {"); -goTo.marker("63"); -verify.currentLineContentIs(" $('#TextBox1').unbind();"); -goTo.marker("64"); -verify.currentLineContentIs(" $('#TextBox1').datepicker();"); -goTo.marker("65"); -verify.currentLineContentIs("}"); -goTo.marker("66"); -verify.currentLineContentIs("function pageLoad() {"); -goTo.marker("67"); -verify.currentLineContentIs(" var webclass = ["); -goTo.marker("68"); -verify.currentLineContentIs(" {"); -goTo.marker("69"); -verify.currentLineContentIs(" 'student':"); -goTo.marker("70"); -verify.currentLineContentIs(" { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' }"); -goTo.marker("71"); -verify.currentLineContentIs(" },"); -goTo.marker("72"); -verify.currentLineContentIs(" {"); -goTo.marker("73"); -verify.currentLineContentIs(" 'student':"); -goTo.marker("74"); -verify.currentLineContentIs(" { 'id': '2', 'name': 'Adam Davidson', 'legacySkill': 'Cobol,MainFrame' }"); -goTo.marker("75"); -verify.currentLineContentIs(" },"); -goTo.marker("76"); -verify.currentLineContentIs(" {"); -goTo.marker("77"); -verify.currentLineContentIs(" 'student':"); -goTo.marker("78"); -verify.currentLineContentIs(" { 'id': '3', 'name': 'Charles Boyer', 'legacySkill': 'HTML, XML' }"); -goTo.marker("79"); -verify.currentLineContentIs(" }"); -goTo.marker("80"); -verify.currentLineContentIs(" ];"); -goTo.marker("81"); -verify.currentLineContentIs(" $create(Sys.UI.DataView, { data: webclass }, null, null, $get('SList'));"); -goTo.marker("82"); -verify.currentLineContentIs("}"); -goTo.marker("83"); -//bug 704204 expect result : "$(document).ready(function () {", actual result : "$(document).ready(function() " -//verify.currentLineContentIs("$(document).ready(function () {"); -verify.currentLineContentIs("$(document).ready(function() {"); -goTo.marker("84"); -verify.currentLineContentIs(" alert('hello');"); -goTo.marker("85"); +/// + +/////*1*/var a;var c , b;var $d +/////*2*/var $e +/////*3*/var f +/////*4*/a++;b++; +//// +/////*5*/function f ( ) { +/////*6*/ for (i = 0; i < 10; i++) { +/////*7*/ k = abc + 123 ^ d; +/////*8*/ a = XYZ[m (a[b[c][d]])]; +/////*9*/ break; +//// +/////*10*/ switch ( variable){ +/////*11*/ case 1: abc += 425; +/////*12*/break; +/////*13*/case 404 : a [x--/2]%=3 ; +/////*14*/ break ; +/////*15*/ case vari : v[--x ] *=++y*( m + n / k[z]); +/////*16*/ for (a in b){ +/////*17*/ for (a = 0; a < 10; ++a) { +/////*18*/ a++;--a; +/////*19*/ if (a == b) { +/////*20*/ a++;b--; +/////*21*/ } +/////*22*/else +/////*23*/if (a == c){ +/////*24*/++a; +/////*25*/(--c)+=d; +/////*26*/$c = $a + --$b; +/////*27*/} +/////*28*/if (a == b) +/////*29*/if (a != b) { +/////*30*/ if (a !== b) +/////*31*/ if (a === b) +/////*32*/ --a; +/////*33*/ else +/////*34*/ --a; +/////*35*/ else { +/////*36*/ a--;++b; +/////*37*/a++ +/////*38*/ } +/////*39*/ } +/////*40*/ } +/////*41*/ for (x in y) { +/////*42*/m-=m; +/////*43*/k=1+2+3+4; +/////*44*/} +/////*45*/} +/////*46*/ break; +//// +/////*47*/ } +/////*48*/ } +/////*49*/ var a ={b:function(){}}; +/////*50*/ return {a:1,b:2} +/////*51*/} +//// +/////*52*/var z = 1; +/////*53*/ for (i = 0; i < 10; i++) +/////*54*/ for (j = 0; j < 10; j++) +/////*55*/for (k = 0; k < 10; ++k) { +/////*56*/z++; +/////*57*/} +//// +/////*58*/for (k = 0; k < 10; k += 2) { +/////*59*/z++; +/////*60*/} +//// +/////*61*/ $(document).ready (); +//// +//// +/////*62*/ function pageLoad() { +/////*63*/ $('#TextBox1' ) . unbind ( ) ; +/////*64*/$('#TextBox1' ) . datepicker ( ) ; +/////*65*/} +//// +/////*66*/ function pageLoad ( ) { +/////*67*/ var webclass=[ +/////*68*/ { 'student' :/*69*/ +/////*70*/ { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' } +/////*71*/ } , +/////*72*/{ 'student':/*73*/ +/////*74*/{'id':'2','name':'Adam Davidson','legacySkill':'Cobol,MainFrame'} +/////*75*/} , +/////*76*/ { 'student':/*77*/ +/////*78*/{ 'id':'3','name':'Charles Boyer' ,'legacySkill':'HTML, XML'} +/////*79*/} +/////*80*/ ]; +//// +/////*81*/$create(Sys.UI.DataView,{data:webclass},null,null,$get('SList')); +//// +/////*82*/} +//// +/////*83*/$( document ).ready(function(){ +/////*84*/alert('hello'); +/////*85*/ } ) ; +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("var a; var c, b; var $d"); +goTo.marker("2"); +verify.currentLineContentIs("var $e"); +goTo.marker("3"); +verify.currentLineContentIs("var f"); +goTo.marker("4"); +verify.currentLineContentIs("a++; b++;"); +goTo.marker("5"); +verify.currentLineContentIs("function f() {"); +goTo.marker("6"); +verify.currentLineContentIs(" for (i = 0; i < 10; i++) {"); +goTo.marker("7"); +verify.currentLineContentIs(" k = abc + 123 ^ d;"); +goTo.marker("8"); +verify.currentLineContentIs(" a = XYZ[m(a[b[c][d]])];"); +goTo.marker("9"); +verify.currentLineContentIs(" break;"); +goTo.marker("10"); +verify.currentLineContentIs(" switch (variable) {"); +goTo.marker("11"); +verify.currentLineContentIs(" case 1: abc += 425;"); +goTo.marker("12"); +verify.currentLineContentIs(" break;"); +goTo.marker("13"); +verify.currentLineContentIs(" case 404: a[x-- / 2] %= 3;"); +goTo.marker("14"); +verify.currentLineContentIs(" break;"); +goTo.marker("15"); +verify.currentLineContentIs(" case vari: v[--x] *= ++y * (m + n / k[z]);"); +goTo.marker("16"); +verify.currentLineContentIs(" for (a in b) {"); +goTo.marker("17"); +verify.currentLineContentIs(" for (a = 0; a < 10; ++a) {"); +goTo.marker("18"); +verify.currentLineContentIs(" a++; --a;"); +goTo.marker("19"); +verify.currentLineContentIs(" if (a == b) {"); +goTo.marker("20"); +verify.currentLineContentIs(" a++; b--;"); +goTo.marker("21"); +verify.currentLineContentIs(" }"); +goTo.marker("22"); +verify.currentLineContentIs(" else"); +goTo.marker("23"); +verify.currentLineContentIs(" if (a == c) {"); +goTo.marker("24"); +verify.currentLineContentIs(" ++a;"); +goTo.marker("25"); +verify.currentLineContentIs(" (--c) += d;"); +goTo.marker("26"); +verify.currentLineContentIs(" $c = $a + --$b;"); +goTo.marker("27"); +verify.currentLineContentIs(" }"); +goTo.marker("28"); +verify.currentLineContentIs(" if (a == b)"); +goTo.marker("29"); +verify.currentLineContentIs(" if (a != b) {"); +goTo.marker("30"); +verify.currentLineContentIs(" if (a !== b)"); +goTo.marker("31"); +verify.currentLineContentIs(" if (a === b)"); +goTo.marker("32"); +verify.currentLineContentIs(" --a;"); +goTo.marker("33"); +verify.currentLineContentIs(" else"); +goTo.marker("34"); +verify.currentLineContentIs(" --a;"); +goTo.marker("35"); +verify.currentLineContentIs(" else {"); +goTo.marker("36"); +verify.currentLineContentIs(" a--; ++b;"); +goTo.marker("37"); +verify.currentLineContentIs(" a++"); +goTo.marker("38"); +//bug 697788 expect result : " }", actual result : " }" +//verify.currentLineContentIs(" }"); +verify.currentLineContentIs(" }"); +goTo.marker("39"); +verify.currentLineContentIs(" }"); +goTo.marker("40"); +verify.currentLineContentIs(" }"); +goTo.marker("41"); +verify.currentLineContentIs(" for (x in y) {"); +goTo.marker("42"); +verify.currentLineContentIs(" m -= m;"); +goTo.marker("43"); +verify.currentLineContentIs(" k = 1 + 2 + 3 + 4;"); +goTo.marker("44"); +verify.currentLineContentIs(" }"); +goTo.marker("45"); +verify.currentLineContentIs(" }"); +goTo.marker("46"); +verify.currentLineContentIs(" break;"); +goTo.marker("47"); +verify.currentLineContentIs(" }"); +goTo.marker("48"); +verify.currentLineContentIs(" }"); +goTo.marker("49"); +//bug 704204 expect result : " var a = { b: function () { } };", actual result : " var a = { b: function() { } };" +//verify.currentLineContentIs(" var a = { b: function () { } };"); +verify.currentLineContentIs(" var a = { b: function() { } };"); +goTo.marker("50"); +verify.currentLineContentIs(" return { a: 1, b: 2 }"); +goTo.marker("51"); +verify.currentLineContentIs("}"); +goTo.marker("52"); +verify.currentLineContentIs("var z = 1;"); +goTo.marker("53"); +verify.currentLineContentIs("for (i = 0; i < 10; i++)"); +goTo.marker("54"); +verify.currentLineContentIs(" for (j = 0; j < 10; j++)"); +goTo.marker("55"); +verify.currentLineContentIs(" for (k = 0; k < 10; ++k) {"); +goTo.marker("56"); +verify.currentLineContentIs(" z++;"); +goTo.marker("57"); +verify.currentLineContentIs(" }"); +goTo.marker("58"); +verify.currentLineContentIs("for (k = 0; k < 10; k += 2) {"); +goTo.marker("59"); +verify.currentLineContentIs(" z++;"); +goTo.marker("60"); +verify.currentLineContentIs("}"); +goTo.marker("61"); +verify.currentLineContentIs("$(document).ready();"); +goTo.marker("62"); +verify.currentLineContentIs("function pageLoad() {"); +goTo.marker("63"); +verify.currentLineContentIs(" $('#TextBox1').unbind();"); +goTo.marker("64"); +verify.currentLineContentIs(" $('#TextBox1').datepicker();"); +goTo.marker("65"); +verify.currentLineContentIs("}"); +goTo.marker("66"); +verify.currentLineContentIs("function pageLoad() {"); +goTo.marker("67"); +verify.currentLineContentIs(" var webclass = ["); +goTo.marker("68"); +verify.currentLineContentIs(" {"); +goTo.marker("69"); +verify.currentLineContentIs(" 'student':"); +goTo.marker("70"); +verify.currentLineContentIs(" { 'id': '1', 'name': 'Linda Jones', 'legacySkill': 'Access, VB 5.0' }"); +goTo.marker("71"); +verify.currentLineContentIs(" },"); +goTo.marker("72"); +verify.currentLineContentIs(" {"); +goTo.marker("73"); +verify.currentLineContentIs(" 'student':"); +goTo.marker("74"); +verify.currentLineContentIs(" { 'id': '2', 'name': 'Adam Davidson', 'legacySkill': 'Cobol,MainFrame' }"); +goTo.marker("75"); +verify.currentLineContentIs(" },"); +goTo.marker("76"); +verify.currentLineContentIs(" {"); +goTo.marker("77"); +verify.currentLineContentIs(" 'student':"); +goTo.marker("78"); +verify.currentLineContentIs(" { 'id': '3', 'name': 'Charles Boyer', 'legacySkill': 'HTML, XML' }"); +goTo.marker("79"); +verify.currentLineContentIs(" }"); +goTo.marker("80"); +verify.currentLineContentIs(" ];"); +goTo.marker("81"); +verify.currentLineContentIs(" $create(Sys.UI.DataView, { data: webclass }, null, null, $get('SList'));"); +goTo.marker("82"); +verify.currentLineContentIs("}"); +goTo.marker("83"); +//bug 704204 expect result : "$(document).ready(function () {", actual result : "$(document).ready(function() " +//verify.currentLineContentIs("$(document).ready(function () {"); +verify.currentLineContentIs("$(document).ready(function() {"); +goTo.marker("84"); +verify.currentLineContentIs(" alert('hello');"); +goTo.marker("85"); verify.currentLineContentIs("});"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnModuleIndentation.ts b/tests/cases/fourslash/formattingOnModuleIndentation.ts index 374c5a7c95c..776e2fa1bd5 100644 --- a/tests/cases/fourslash/formattingOnModuleIndentation.ts +++ b/tests/cases/fourslash/formattingOnModuleIndentation.ts @@ -1,13 +1,13 @@ -/// - -//// module Foo { -//// export module A . B . C { }/**/ -//// } - -format.document(); -goTo.bof(); -verify.currentLineContentIs("module Foo {"); -goTo.marker(); -verify.currentLineContentIs(" export module A.B.C { }"); -goTo.eof(); +/// + +//// module Foo { +//// export module A . B . C { }/**/ +//// } + +format.document(); +goTo.bof(); +verify.currentLineContentIs("module Foo {"); +goTo.marker(); +verify.currentLineContentIs(" export module A.B.C { }"); +goTo.eof(); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts b/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts index 17b91dbd808..e35f4a333b9 100644 --- a/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts +++ b/tests/cases/fourslash/formattingOnNestedDoWhileByEnter.ts @@ -1,23 +1,23 @@ -/// - -/////*2*/do{ -/////*3*/do/*1*/{ -/////*4*/do{ -/////*5*/}while(a!==b) -/////*6*/}while(a!==b) -/////*7*/}while(a!==b) -goTo.marker("1"); -edit.insert("\r\n"); -verify.currentLineContentIs(" {"); -goTo.marker("2"); -verify.currentLineContentIs("do{"); -goTo.marker("3"); -verify.currentLineContentIs(" do"); -goTo.marker("4"); -verify.currentLineContentIs("do{"); -goTo.marker("5"); -verify.currentLineContentIs("}while(a!==b)"); -goTo.marker("6"); -verify.currentLineContentIs("}while(a!==b)"); -goTo.marker("7"); +/// + +/////*2*/do{ +/////*3*/do/*1*/{ +/////*4*/do{ +/////*5*/}while(a!==b) +/////*6*/}while(a!==b) +/////*7*/}while(a!==b) +goTo.marker("1"); +edit.insert("\r\n"); +verify.currentLineContentIs(" {"); +goTo.marker("2"); +verify.currentLineContentIs("do{"); +goTo.marker("3"); +verify.currentLineContentIs(" do"); +goTo.marker("4"); +verify.currentLineContentIs("do{"); +goTo.marker("5"); +verify.currentLineContentIs("}while(a!==b)"); +goTo.marker("6"); +verify.currentLineContentIs("}while(a!==b)"); +goTo.marker("7"); verify.currentLineContentIs("}while(a!==b)"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnNestedStatements.ts b/tests/cases/fourslash/formattingOnNestedStatements.ts index 547fcfa27ef..13c957af455 100644 --- a/tests/cases/fourslash/formattingOnNestedStatements.ts +++ b/tests/cases/fourslash/formattingOnNestedStatements.ts @@ -1,14 +1,14 @@ -/// - -////{ -/////*1*/{ -/////*3*/test -////}/*2*/ -////} -format.selection("1", "2"); -goTo.marker("1"); -verify.currentLineContentIs(" {"); -goTo.marker("3"); -verify.currentLineContentIs(" test"); -goTo.marker("2"); +/// + +////{ +/////*1*/{ +/////*3*/test +////}/*2*/ +////} +format.selection("1", "2"); +goTo.marker("1"); +verify.currentLineContentIs(" {"); +goTo.marker("3"); +verify.currentLineContentIs(" test"); +goTo.marker("2"); verify.currentLineContentIs(" }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnObjectLiteral.ts b/tests/cases/fourslash/formattingOnObjectLiteral.ts index b8db4dd45dc..5b8d5f9cb52 100644 --- a/tests/cases/fourslash/formattingOnObjectLiteral.ts +++ b/tests/cases/fourslash/formattingOnObjectLiteral.ts @@ -1,85 +1,85 @@ -/// - -////var x = /*1*/{foo:/*2*/ 1, -////bar: "tt",/*3*/ -////boo: /*4*/1 + 5}/*5*/; -//// -////var x2 = /*6*/{foo/*7*/: 1, -////bar: /*8*/"tt",boo:1+5}/*9*/; -//// -////function Foo() {/*10*/ -////var typeICalc = {/*11*/ -////clear: {/*12*/ -////"()": [1, 2, 3]/*13*/ -////}/*14*/ -////}/*15*/ -////}/*16*/ -//// -////// Rule for object literal members for the "value" of the memebr to follow the indent/*17*/ -////// of the member, i.e. the relative position of the value is maintained when the member/*18*/ -////// is indented./*19*/ -////var x2 = {/*20*/ -//// foo:/*21*/ -////3,/*22*/ -//// 'bar':/*23*/ -//// { a: 1, b : 2}/*24*/ -////};/*25*/ -//// -////var x={ };/*26*/ -////var y = {};/*27*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("var x = {"); -goTo.marker("2"); -verify.currentLineContentIs(" foo: 1,"); -goTo.marker("3"); -verify.currentLineContentIs(" bar: \"tt\","); -goTo.marker("4"); -verify.currentLineContentIs(" boo: 1 + 5"); -goTo.marker("5"); -verify.currentLineContentIs("};"); -goTo.marker("6"); -verify.currentLineContentIs("var x2 = {"); -goTo.marker("7"); -verify.currentLineContentIs(" foo: 1,"); -goTo.marker("8"); -verify.currentLineContentIs(" bar: \"tt\", boo: 1 + 5"); -goTo.marker("9"); -verify.currentLineContentIs("};"); -goTo.marker("10"); -verify.currentLineContentIs("function Foo() {"); -goTo.marker("11"); -verify.currentLineContentIs(" var typeICalc = {"); -goTo.marker("12"); -verify.currentLineContentIs(" clear: {"); -goTo.marker("13"); -verify.currentLineContentIs(" \"()\": [1, 2, 3]"); -goTo.marker("14"); -verify.currentLineContentIs(" }"); -goTo.marker("15"); -verify.currentLineContentIs(" }"); -goTo.marker("16"); -verify.currentLineContentIs("}"); -goTo.marker("17"); -verify.currentLineContentIs("// Rule for object literal members for the \"value\" of the memebr to follow the indent"); -goTo.marker("18"); -verify.currentLineContentIs("// of the member, i.e. the relative position of the value is maintained when the member"); -goTo.marker("19"); -verify.currentLineContentIs("// is indented."); -goTo.marker("20"); -verify.currentLineContentIs("var x2 = {"); -goTo.marker("21"); -verify.currentLineContentIs(" foo:"); -goTo.marker("22"); -verify.currentLineContentIs(" 3,"); -goTo.marker("23"); -verify.currentLineContentIs(" 'bar':"); -goTo.marker("24"); -verify.currentLineContentIs(" { a: 1, b: 2 }"); -goTo.marker("25"); -verify.currentLineContentIs("};"); -goTo.marker("26"); -verify.currentLineContentIs("var x = {};"); -goTo.marker("27"); +/// + +////var x = /*1*/{foo:/*2*/ 1, +////bar: "tt",/*3*/ +////boo: /*4*/1 + 5}/*5*/; +//// +////var x2 = /*6*/{foo/*7*/: 1, +////bar: /*8*/"tt",boo:1+5}/*9*/; +//// +////function Foo() {/*10*/ +////var typeICalc = {/*11*/ +////clear: {/*12*/ +////"()": [1, 2, 3]/*13*/ +////}/*14*/ +////}/*15*/ +////}/*16*/ +//// +////// Rule for object literal members for the "value" of the memebr to follow the indent/*17*/ +////// of the member, i.e. the relative position of the value is maintained when the member/*18*/ +////// is indented./*19*/ +////var x2 = {/*20*/ +//// foo:/*21*/ +////3,/*22*/ +//// 'bar':/*23*/ +//// { a: 1, b : 2}/*24*/ +////};/*25*/ +//// +////var x={ };/*26*/ +////var y = {};/*27*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("var x = {"); +goTo.marker("2"); +verify.currentLineContentIs(" foo: 1,"); +goTo.marker("3"); +verify.currentLineContentIs(" bar: \"tt\","); +goTo.marker("4"); +verify.currentLineContentIs(" boo: 1 + 5"); +goTo.marker("5"); +verify.currentLineContentIs("};"); +goTo.marker("6"); +verify.currentLineContentIs("var x2 = {"); +goTo.marker("7"); +verify.currentLineContentIs(" foo: 1,"); +goTo.marker("8"); +verify.currentLineContentIs(" bar: \"tt\", boo: 1 + 5"); +goTo.marker("9"); +verify.currentLineContentIs("};"); +goTo.marker("10"); +verify.currentLineContentIs("function Foo() {"); +goTo.marker("11"); +verify.currentLineContentIs(" var typeICalc = {"); +goTo.marker("12"); +verify.currentLineContentIs(" clear: {"); +goTo.marker("13"); +verify.currentLineContentIs(" \"()\": [1, 2, 3]"); +goTo.marker("14"); +verify.currentLineContentIs(" }"); +goTo.marker("15"); +verify.currentLineContentIs(" }"); +goTo.marker("16"); +verify.currentLineContentIs("}"); +goTo.marker("17"); +verify.currentLineContentIs("// Rule for object literal members for the \"value\" of the memebr to follow the indent"); +goTo.marker("18"); +verify.currentLineContentIs("// of the member, i.e. the relative position of the value is maintained when the member"); +goTo.marker("19"); +verify.currentLineContentIs("// is indented."); +goTo.marker("20"); +verify.currentLineContentIs("var x2 = {"); +goTo.marker("21"); +verify.currentLineContentIs(" foo:"); +goTo.marker("22"); +verify.currentLineContentIs(" 3,"); +goTo.marker("23"); +verify.currentLineContentIs(" 'bar':"); +goTo.marker("24"); +verify.currentLineContentIs(" { a: 1, b: 2 }"); +goTo.marker("25"); +verify.currentLineContentIs("};"); +goTo.marker("26"); +verify.currentLineContentIs("var x = {};"); +goTo.marker("27"); verify.currentLineContentIs("var y = {};"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnOpenBraceOfFunctions.ts b/tests/cases/fourslash/formattingOnOpenBraceOfFunctions.ts index 6414362a4cd..a7905dc938d 100644 --- a/tests/cases/fourslash/formattingOnOpenBraceOfFunctions.ts +++ b/tests/cases/fourslash/formattingOnOpenBraceOfFunctions.ts @@ -1,10 +1,10 @@ -/// - -/////**/function T2_y() -////{ -////Plugin.T1.t1_x(); -////} - -format.document(); -goTo.marker(); +/// + +/////**/function T2_y() +////{ +////Plugin.T1.t1_x(); +////} + +format.document(); +goTo.marker(); verify.currentLineContentIs("function T2_y() {"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnSemiColon.ts b/tests/cases/fourslash/formattingOnSemiColon.ts index b560055a761..027bb637edd 100644 --- a/tests/cases/fourslash/formattingOnSemiColon.ts +++ b/tests/cases/fourslash/formattingOnSemiColon.ts @@ -1,7 +1,7 @@ -/// - -////var a=b+c^d-e*++f - -goTo.eof(); -edit.insert(";"); +/// + +////var a=b+c^d-e*++f + +goTo.eof(); +edit.insert(";"); verify.currentFileContentIs("var a = b + c ^ d - e * ++f;"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnSingleLineBlocks.ts b/tests/cases/fourslash/formattingOnSingleLineBlocks.ts index b832fa7222b..fc1a6818b95 100644 --- a/tests/cases/fourslash/formattingOnSingleLineBlocks.ts +++ b/tests/cases/fourslash/formattingOnSingleLineBlocks.ts @@ -1,16 +1,16 @@ -/// - -/////*1*/class C -////{}/*2*/ -/////*3*/if (true) -////{}/*4*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("class C"); -goTo.marker("2"); -verify.currentLineContentIs("{ }"); -goTo.marker("3"); -verify.currentLineContentIs("if (true)"); -goTo.marker("4"); +/// + +/////*1*/class C +////{}/*2*/ +/////*3*/if (true) +////{}/*4*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("class C"); +goTo.marker("2"); +verify.currentLineContentIs("{ }"); +goTo.marker("3"); +verify.currentLineContentIs("if (true)"); +goTo.marker("4"); verify.currentLineContentIs("{ }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts b/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts index c49152f5011..e33298a5a3b 100644 --- a/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts +++ b/tests/cases/fourslash/formattingOnStatementsWithNoSemicolon.ts @@ -1,170 +1,170 @@ -/// - -/////*1*/do -//// { var a/*2*/ -/////*3*/} while (1) -/////*4*/function f() { -/////*5*/ var s = 1 -/////*6*/ } -/////*7*/switch (t) { -/////*8*/ case 1: -/////*9*/{ -/////*10*/test -/////*11*/} -/////*12*/} -/////*13*/do{do{do{}while(a!==b)}while(a!==b)}while(a!==b) -/////*14*/do{ -/////*15*/do{ -/////*16*/do{ -/////*17*/}while(a!==b) -/////*18*/}while(a!==b) -/////*19*/}while(a!==b) -/////*20*/for(var i=0;i<10;i++){ -/////*21*/for(var j=0;j<10;j++){ -/////*22*/j-=i -/////*23*/}/*24*/} -/////*25*/function foo() { -/////*26*/try { -/////*27*/x+=2 -/////*28*/} -/////*29*/catch( e){ -/////*30*/x+=2 -/////*31*/}finally { -/////*32*/x+=2 -/////*33*/} -/////*34*/} -/////*35*/do { var a } while (1) -//// foo(function (file) {/*49*/ -//// return 0/*50*/ -//// }).then(function (doc) {/*51*/ -//// return 1/*52*/ -//// });/*53*/ -/////*54*/if(1) -/////*55*/if(1) -/////*56*/x++ -/////*57*/else -/////*58*/if(1) -/////*59*/x+=2 -/////*60*/else -/////*61*/x+=2 -//// -//// -//// -/////*62*/; -//// do do do do/*63*/ -//// test;/*64*/ -//// while (0)/*65*/ -//// while (0)/*66*/ -//// while (0)/*67*/ -//// while (0)/*68*/ -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("do {"); -goTo.marker("2"); -verify.currentLineContentIs(" var a"); -goTo.marker("3"); -verify.currentLineContentIs("} while (1)"); -goTo.marker("4"); -verify.currentLineContentIs("function f() {"); -goTo.marker("5"); -verify.currentLineContentIs(" var s = 1"); -goTo.marker("6"); -verify.currentLineContentIs("}"); -goTo.marker("7"); -verify.currentLineContentIs("switch (t) {"); -goTo.marker("8"); -verify.currentLineContentIs(" case 1:"); -goTo.marker("9"); -verify.currentLineContentIs(" {"); -goTo.marker("10"); -verify.currentLineContentIs(" test"); -goTo.marker("11"); -verify.currentLineContentIs(" }"); -goTo.marker("12"); -verify.currentLineContentIs("}"); -goTo.marker("13"); -verify.currentLineContentIs("do { do { do { } while (a !== b) } while (a !== b) } while (a !== b)"); -goTo.marker("14"); -verify.currentLineContentIs("do {"); -goTo.marker("15"); -verify.currentLineContentIs(" do {"); -goTo.marker("16"); -verify.currentLineContentIs(" do {"); -goTo.marker("17"); -verify.currentLineContentIs(" } while (a !== b)"); -goTo.marker("18"); -verify.currentLineContentIs(" } while (a !== b)"); -goTo.marker("19"); -verify.currentLineContentIs("} while (a !== b)"); -goTo.marker("20"); -verify.currentLineContentIs("for (var i = 0; i < 10; i++) {"); -goTo.marker("21"); -verify.currentLineContentIs(" for (var j = 0; j < 10; j++) {"); -goTo.marker("22"); -verify.currentLineContentIs(" j -= i"); -goTo.marker("23"); -verify.currentLineContentIs(" }"); -goTo.marker("24"); -verify.currentLineContentIs(" }"); -goTo.marker("25"); -verify.currentLineContentIs("function foo() {"); -goTo.marker("26"); -verify.currentLineContentIs(" try {"); -goTo.marker("27"); -verify.currentLineContentIs(" x += 2"); -goTo.marker("28"); -verify.currentLineContentIs(" }"); -goTo.marker("29"); -verify.currentLineContentIs(" catch (e) {"); -goTo.marker("30"); -verify.currentLineContentIs(" x += 2"); -goTo.marker("31"); -verify.currentLineContentIs(" } finally {"); -goTo.marker("32"); -verify.currentLineContentIs(" x += 2"); -goTo.marker("33"); -verify.currentLineContentIs(" }"); -goTo.marker("34"); -verify.currentLineContentIs("}"); -goTo.marker("35"); -verify.currentLineContentIs("do { var a } while (1)"); -goTo.marker("49"); -verify.currentLineContentIs("foo(function(file) {"); -goTo.marker("50"); -verify.currentLineContentIs(" return 0"); -goTo.marker("51"); -verify.currentLineContentIs("}).then(function(doc) {"); -goTo.marker("52"); -verify.currentLineContentIs(" return 1"); -goTo.marker("53"); -verify.currentLineContentIs("});"); -goTo.marker("54"); -verify.currentLineContentIs("if (1)"); -goTo.marker("55"); -verify.currentLineContentIs(" if (1)"); -goTo.marker("56"); -verify.currentLineContentIs(" x++"); -goTo.marker("57"); -verify.currentLineContentIs(" else"); -goTo.marker("58"); -verify.currentLineContentIs(" if (1)"); -goTo.marker("59"); -verify.currentLineContentIs(" x += 2"); -goTo.marker("60"); -verify.currentLineContentIs(" else"); -goTo.marker("61"); -verify.currentLineContentIs(" x += 2"); -goTo.marker("62"); -verify.currentLineContentIs(" ;"); -goTo.marker("63"); -verify.currentLineContentIs("do do do do"); -goTo.marker("64"); -verify.currentLineContentIs(" test;"); -goTo.marker("65"); -verify.currentLineContentIs("while (0)"); -goTo.marker("66"); -verify.currentLineContentIs("while (0)"); -goTo.marker("67"); -verify.currentLineContentIs("while (0)"); -goTo.marker("68"); -verify.currentLineContentIs("while (0)"); +/// + +/////*1*/do +//// { var a/*2*/ +/////*3*/} while (1) +/////*4*/function f() { +/////*5*/ var s = 1 +/////*6*/ } +/////*7*/switch (t) { +/////*8*/ case 1: +/////*9*/{ +/////*10*/test +/////*11*/} +/////*12*/} +/////*13*/do{do{do{}while(a!==b)}while(a!==b)}while(a!==b) +/////*14*/do{ +/////*15*/do{ +/////*16*/do{ +/////*17*/}while(a!==b) +/////*18*/}while(a!==b) +/////*19*/}while(a!==b) +/////*20*/for(var i=0;i<10;i++){ +/////*21*/for(var j=0;j<10;j++){ +/////*22*/j-=i +/////*23*/}/*24*/} +/////*25*/function foo() { +/////*26*/try { +/////*27*/x+=2 +/////*28*/} +/////*29*/catch( e){ +/////*30*/x+=2 +/////*31*/}finally { +/////*32*/x+=2 +/////*33*/} +/////*34*/} +/////*35*/do { var a } while (1) +//// foo(function (file) {/*49*/ +//// return 0/*50*/ +//// }).then(function (doc) {/*51*/ +//// return 1/*52*/ +//// });/*53*/ +/////*54*/if(1) +/////*55*/if(1) +/////*56*/x++ +/////*57*/else +/////*58*/if(1) +/////*59*/x+=2 +/////*60*/else +/////*61*/x+=2 +//// +//// +//// +/////*62*/; +//// do do do do/*63*/ +//// test;/*64*/ +//// while (0)/*65*/ +//// while (0)/*66*/ +//// while (0)/*67*/ +//// while (0)/*68*/ +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("do {"); +goTo.marker("2"); +verify.currentLineContentIs(" var a"); +goTo.marker("3"); +verify.currentLineContentIs("} while (1)"); +goTo.marker("4"); +verify.currentLineContentIs("function f() {"); +goTo.marker("5"); +verify.currentLineContentIs(" var s = 1"); +goTo.marker("6"); +verify.currentLineContentIs("}"); +goTo.marker("7"); +verify.currentLineContentIs("switch (t) {"); +goTo.marker("8"); +verify.currentLineContentIs(" case 1:"); +goTo.marker("9"); +verify.currentLineContentIs(" {"); +goTo.marker("10"); +verify.currentLineContentIs(" test"); +goTo.marker("11"); +verify.currentLineContentIs(" }"); +goTo.marker("12"); +verify.currentLineContentIs("}"); +goTo.marker("13"); +verify.currentLineContentIs("do { do { do { } while (a !== b) } while (a !== b) } while (a !== b)"); +goTo.marker("14"); +verify.currentLineContentIs("do {"); +goTo.marker("15"); +verify.currentLineContentIs(" do {"); +goTo.marker("16"); +verify.currentLineContentIs(" do {"); +goTo.marker("17"); +verify.currentLineContentIs(" } while (a !== b)"); +goTo.marker("18"); +verify.currentLineContentIs(" } while (a !== b)"); +goTo.marker("19"); +verify.currentLineContentIs("} while (a !== b)"); +goTo.marker("20"); +verify.currentLineContentIs("for (var i = 0; i < 10; i++) {"); +goTo.marker("21"); +verify.currentLineContentIs(" for (var j = 0; j < 10; j++) {"); +goTo.marker("22"); +verify.currentLineContentIs(" j -= i"); +goTo.marker("23"); +verify.currentLineContentIs(" }"); +goTo.marker("24"); +verify.currentLineContentIs(" }"); +goTo.marker("25"); +verify.currentLineContentIs("function foo() {"); +goTo.marker("26"); +verify.currentLineContentIs(" try {"); +goTo.marker("27"); +verify.currentLineContentIs(" x += 2"); +goTo.marker("28"); +verify.currentLineContentIs(" }"); +goTo.marker("29"); +verify.currentLineContentIs(" catch (e) {"); +goTo.marker("30"); +verify.currentLineContentIs(" x += 2"); +goTo.marker("31"); +verify.currentLineContentIs(" } finally {"); +goTo.marker("32"); +verify.currentLineContentIs(" x += 2"); +goTo.marker("33"); +verify.currentLineContentIs(" }"); +goTo.marker("34"); +verify.currentLineContentIs("}"); +goTo.marker("35"); +verify.currentLineContentIs("do { var a } while (1)"); +goTo.marker("49"); +verify.currentLineContentIs("foo(function(file) {"); +goTo.marker("50"); +verify.currentLineContentIs(" return 0"); +goTo.marker("51"); +verify.currentLineContentIs("}).then(function(doc) {"); +goTo.marker("52"); +verify.currentLineContentIs(" return 1"); +goTo.marker("53"); +verify.currentLineContentIs("});"); +goTo.marker("54"); +verify.currentLineContentIs("if (1)"); +goTo.marker("55"); +verify.currentLineContentIs(" if (1)"); +goTo.marker("56"); +verify.currentLineContentIs(" x++"); +goTo.marker("57"); +verify.currentLineContentIs(" else"); +goTo.marker("58"); +verify.currentLineContentIs(" if (1)"); +goTo.marker("59"); +verify.currentLineContentIs(" x += 2"); +goTo.marker("60"); +verify.currentLineContentIs(" else"); +goTo.marker("61"); +verify.currentLineContentIs(" x += 2"); +goTo.marker("62"); +verify.currentLineContentIs(" ;"); +goTo.marker("63"); +verify.currentLineContentIs("do do do do"); +goTo.marker("64"); +verify.currentLineContentIs(" test;"); +goTo.marker("65"); +verify.currentLineContentIs("while (0)"); +goTo.marker("66"); +verify.currentLineContentIs("while (0)"); +goTo.marker("67"); +verify.currentLineContentIs("while (0)"); +goTo.marker("68"); +verify.currentLineContentIs("while (0)"); diff --git a/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts b/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts index 2e7c344d225..e3d9490be03 100644 --- a/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts +++ b/tests/cases/fourslash/formattingOnTabAfterCloseCurly.ts @@ -1,32 +1,32 @@ -/// - -////module Tools {/*1*/ -//// export enum NodeType {/*2*/ -//// Error,/*3*/ -//// Comment,/*4*/ -//// } /*5*/ -//// export enum foob/*6*/ -//// { -//// Blah=1, Bleah=2/*7*/ -//// }/*8*/ -////}/*9*/ - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs("module Tools {"); -goTo.marker("2"); -verify.currentLineContentIs(" export enum NodeType {"); -goTo.marker("3"); -verify.currentLineContentIs(" Error,"); -goTo.marker("4"); -verify.currentLineContentIs(" Comment,"); -goTo.marker("5"); -verify.currentLineContentIs(" }"); -goTo.marker("6"); -verify.currentLineContentIs(" export enum foob {"); -goTo.marker("7"); -verify.currentLineContentIs(" Blah = 1, Bleah = 2"); -goTo.marker("8"); -verify.currentLineContentIs(" }"); -goTo.marker("9"); +/// + +////module Tools {/*1*/ +//// export enum NodeType {/*2*/ +//// Error,/*3*/ +//// Comment,/*4*/ +//// } /*5*/ +//// export enum foob/*6*/ +//// { +//// Blah=1, Bleah=2/*7*/ +//// }/*8*/ +////}/*9*/ + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs("module Tools {"); +goTo.marker("2"); +verify.currentLineContentIs(" export enum NodeType {"); +goTo.marker("3"); +verify.currentLineContentIs(" Error,"); +goTo.marker("4"); +verify.currentLineContentIs(" Comment,"); +goTo.marker("5"); +verify.currentLineContentIs(" }"); +goTo.marker("6"); +verify.currentLineContentIs(" export enum foob {"); +goTo.marker("7"); +verify.currentLineContentIs(" Blah = 1, Bleah = 2"); +goTo.marker("8"); +verify.currentLineContentIs(" }"); +goTo.marker("9"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingSkippedTokens.ts b/tests/cases/fourslash/formattingSkippedTokens.ts index 094612c8939..3b8ec47bf38 100644 --- a/tests/cases/fourslash/formattingSkippedTokens.ts +++ b/tests/cases/fourslash/formattingSkippedTokens.ts @@ -19,4 +19,4 @@ verify.currentLineContentIs('4 +:5'); goTo.marker('4'); verify.currentLineContentIs(' : T) { }'); goTo.marker('5'); -verify.currentLineContentIs('var x ='); +verify.currentLineContentIs('var x ='); diff --git a/tests/cases/fourslash/formattingSpacesAfterConstructor.ts b/tests/cases/fourslash/formattingSpacesAfterConstructor.ts index fa46feedb4c..8df762def20 100644 --- a/tests/cases/fourslash/formattingSpacesAfterConstructor.ts +++ b/tests/cases/fourslash/formattingSpacesAfterConstructor.ts @@ -1,6 +1,6 @@ -/// - -/////*1*/class test { constructor () { } } -format.document(); -goTo.marker("1"); +/// + +/////*1*/class test { constructor () { } } +format.document(); +goTo.marker("1"); verify.currentLineContentIs("class test { constructor() { } }"); \ No newline at end of file diff --git a/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts b/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts index 9c35768d865..e64c7be0492 100644 --- a/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts +++ b/tests/cases/fourslash/formattingWithEnterAfterMultilineString.ts @@ -1,15 +1,15 @@ -/// - -////class Greeter3 { -//// stop() { -//// /*2*/var s = "hello\ -////"/*1*/ -//// } -////} - -goTo.marker("1"); -edit.insert("\r\n"); -// We actually need to verify smart (virtual) identation here rather than actual identation. Fourslash support is required. -verify.indentationIs(8); -goTo.marker("2"); +/// + +////class Greeter3 { +//// stop() { +//// /*2*/var s = "hello\ +////"/*1*/ +//// } +////} + +goTo.marker("1"); +edit.insert("\r\n"); +// We actually need to verify smart (virtual) identation here rather than actual identation. Fourslash support is required. +verify.indentationIs(8); +goTo.marker("2"); verify.currentLineContentIs(" var s = \"hello\\"); \ No newline at end of file diff --git a/tests/cases/fourslash/functionOverloadCount.ts b/tests/cases/fourslash/functionOverloadCount.ts index 00856dcb24a..71dad1d9d72 100644 --- a/tests/cases/fourslash/functionOverloadCount.ts +++ b/tests/cases/fourslash/functionOverloadCount.ts @@ -9,7 +9,7 @@ //// } ////} ////var i = new C1; -////i.attr(/*1*/ - -goTo.marker('1'); +////i.attr(/*1*/ + +goTo.marker('1'); verify.signatureHelpCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/functionRenamingErrorRecovery.ts b/tests/cases/fourslash/functionRenamingErrorRecovery.ts index 0c393560933..0a120022ee9 100644 --- a/tests/cases/fourslash/functionRenamingErrorRecovery.ts +++ b/tests/cases/fourslash/functionRenamingErrorRecovery.ts @@ -1,9 +1,9 @@ -/// - -////class Foo { public bar/*1*//*2*/() { } } - -goTo.marker("1"); -edit.backspace(3); -edit.insert("Pizza"); -verify.currentLineContentIs("class Foo { public Pizza() { } }"); +/// + +////class Foo { public bar/*1*//*2*/() { } } + +goTo.marker("1"); +edit.backspace(3); +edit.insert("Pizza"); +verify.currentLineContentIs("class Foo { public Pizza() { } }"); verify.not.errorExistsAfterMarker("2"); \ No newline at end of file diff --git a/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts b/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts index 899a4387f91..5b107e3779e 100644 --- a/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts +++ b/tests/cases/fourslash/genericArityEnforcementAfterEdit.ts @@ -1,10 +1,10 @@ -/// - -//// interface G { } -//// /**/ -//// var v4: G, any>; - -verify.numberOfErrorsInCurrentFile(1); -goTo.marker(); -edit.insert(' '); -verify.numberOfErrorsInCurrentFile(1); +/// + +//// interface G { } +//// /**/ +//// var v4: G, any>; + +verify.numberOfErrorsInCurrentFile(1); +goTo.marker(); +edit.insert(' '); +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/genericRespecialization1.ts b/tests/cases/fourslash/genericRespecialization1.ts index 34eff798060..e8db5eafc4a 100644 --- a/tests/cases/fourslash/genericRespecialization1.ts +++ b/tests/cases/fourslash/genericRespecialization1.ts @@ -1,75 +1,75 @@ -/// - -//// class Food { -//// private amount: number; -//// constructor(public name: string) { -//// this.amount = 100; -//// } -//// public eat(amountToEat: number): boolean { -//// this.amount -= amountToEat; -//// if (this.amount <= 0) { -//// this.amount = 0; -//// return false; -//// } -//// else { -//// return true; -//// } -//// } -//// } -//// class IceCream extends Food { -//// private isDairyFree: boolean; -//// constructor(public flavor: string) { -//// super("Ice Cream"); -//// } -//// } -//// class Cookie extends Food { -//// constructor(public flavor: string, public isGlutenFree: boolean) { -//// super("Cookie"); -//// } -//// } -//// class Slug { -//// // This is NOT a food!!! -//// } -//// class GenericMonster { -//// private name: string; -//// private age: number; -//// private isFriendly: boolean; -//// constructor(name: string, age: number, isFriendly: boolean, private food: T, public variant: V) { -//// this.name = name; -//// this.age = age; -//// this.isFriendly = isFriendly; -//// } -//// public getFood(): T { -//// return this.food; -//// } -//// public getVariant(): V { -//// return this.variant; -//// } -//// public eatFood(amountToEat: number): boolean { -//// return this.food.eat(amountToEat); -//// } -//// public sayGreeting(): string { -//// return ("My name is " + this.name + ", and my age is " + this.age + ". I enjoy eating " + this.food.name + " and my variant is " + this.variant); -//// } -//// } -//// class GenericPlanet> { -//// constructor(public name: string, public solarSystem: string, public species: T) { } -//// } -//// var cookie = new Cookie("Chocolate Chip", false); -//// var cookieMonster = new GenericMonster("Cookie Monster", 50, true, cookie, "hello"); -//// var sesameStreet = new GenericPlanet>("Sesame Street", "Alpha Centuri", cookieMonster); -//// class GenericPlanet2{ -//// constructor(public name: string, public solarSystem: string, public species: GenericMonster) { } -//// } -//// /*1*/ - -verify.numberOfErrorsInCurrentFile(0); -goTo.marker('1'); -edit.insertLine(''); -edit.insertLine(''); -verify.numberOfErrorsInCurrentFile(0); -goTo.marker('2'); -edit.deleteAtCaret("Cookie".length); -edit.insert("any"); -verify.numberOfErrorsInCurrentFile(0); +/// + +//// class Food { +//// private amount: number; +//// constructor(public name: string) { +//// this.amount = 100; +//// } +//// public eat(amountToEat: number): boolean { +//// this.amount -= amountToEat; +//// if (this.amount <= 0) { +//// this.amount = 0; +//// return false; +//// } +//// else { +//// return true; +//// } +//// } +//// } +//// class IceCream extends Food { +//// private isDairyFree: boolean; +//// constructor(public flavor: string) { +//// super("Ice Cream"); +//// } +//// } +//// class Cookie extends Food { +//// constructor(public flavor: string, public isGlutenFree: boolean) { +//// super("Cookie"); +//// } +//// } +//// class Slug { +//// // This is NOT a food!!! +//// } +//// class GenericMonster { +//// private name: string; +//// private age: number; +//// private isFriendly: boolean; +//// constructor(name: string, age: number, isFriendly: boolean, private food: T, public variant: V) { +//// this.name = name; +//// this.age = age; +//// this.isFriendly = isFriendly; +//// } +//// public getFood(): T { +//// return this.food; +//// } +//// public getVariant(): V { +//// return this.variant; +//// } +//// public eatFood(amountToEat: number): boolean { +//// return this.food.eat(amountToEat); +//// } +//// public sayGreeting(): string { +//// return ("My name is " + this.name + ", and my age is " + this.age + ". I enjoy eating " + this.food.name + " and my variant is " + this.variant); +//// } +//// } +//// class GenericPlanet> { +//// constructor(public name: string, public solarSystem: string, public species: T) { } +//// } +//// var cookie = new Cookie("Chocolate Chip", false); +//// var cookieMonster = new GenericMonster("Cookie Monster", 50, true, cookie, "hello"); +//// var sesameStreet = new GenericPlanet>("Sesame Street", "Alpha Centuri", cookieMonster); +//// class GenericPlanet2{ +//// constructor(public name: string, public solarSystem: string, public species: GenericMonster) { } +//// } +//// /*1*/ + +verify.numberOfErrorsInCurrentFile(0); +goTo.marker('1'); +edit.insertLine(''); +edit.insertLine(''); +verify.numberOfErrorsInCurrentFile(0); +goTo.marker('2'); +edit.deleteAtCaret("Cookie".length); +edit.insert("any"); +verify.numberOfErrorsInCurrentFile(0); edit.insertLine('var narnia = new GenericPlanet2('); // shouldn't crash at this point \ No newline at end of file diff --git a/tests/cases/fourslash/getDeclarationDiagnostics.ts b/tests/cases/fourslash/getDeclarationDiagnostics.ts index 693261d62b4..0dcc9fea6a6 100644 --- a/tests/cases/fourslash/getDeclarationDiagnostics.ts +++ b/tests/cases/fourslash/getDeclarationDiagnostics.ts @@ -1,19 +1,19 @@ -/// - -// @declaration: true -// @out: true - -// @Filename: inputFile1.ts -//// module m { -//// export class C implements I { } -//// interface I { } -//// } /*1*/ - -// @Filename: input2.ts -//// var x = "hello world"; /*2*/ - -goTo.marker("1"); -verify.numberOfErrorsInCurrentFile(1); - -goTo.marker("2"); -verify.numberOfErrorsInCurrentFile(0); +/// + +// @declaration: true +// @out: true + +// @Filename: inputFile1.ts +//// module m { +//// export class C implements I { } +//// interface I { } +//// } /*1*/ + +// @Filename: input2.ts +//// var x = "hello world"; /*2*/ + +goTo.marker("1"); +verify.numberOfErrorsInCurrentFile(1); + +goTo.marker("2"); +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/getEmitOutputDeclarationMultiFiles.ts b/tests/cases/fourslash/getEmitOutputDeclarationMultiFiles.ts index b9c7f5a0db9..8148dd3960d 100644 --- a/tests/cases/fourslash/getEmitOutputDeclarationMultiFiles.ts +++ b/tests/cases/fourslash/getEmitOutputDeclarationMultiFiles.ts @@ -1,22 +1,22 @@ -/// - -// @BaselineFile: getEmitOutputDeclarationMultiFiles.baseline -// @declaration: true - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x1: string = "hello world"; -//// class Foo{ -//// x : string; -//// y : number; -//// } - +/// + +// @BaselineFile: getEmitOutputDeclarationMultiFiles.baseline +// @declaration: true + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x1: string = "hello world"; +//// class Foo{ +//// x : string; +//// y : number; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputDeclarationSingleFile.ts b/tests/cases/fourslash/getEmitOutputDeclarationSingleFile.ts index b8e9c58f5b0..502e3903d75 100644 --- a/tests/cases/fourslash/getEmitOutputDeclarationSingleFile.ts +++ b/tests/cases/fourslash/getEmitOutputDeclarationSingleFile.ts @@ -1,22 +1,22 @@ -/// - -// @BaselineFile: getEmitOutputDeclarationSingleFile.baseline -// @declaration: true -// @out: declSingleFile.js - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -//// var x1: string = "hello world"; -//// class Foo{ -//// x : string; -//// y : number; -//// } - +/// + +// @BaselineFile: getEmitOutputDeclarationSingleFile.baseline +// @declaration: true +// @out: declSingleFile.js + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +//// var x1: string = "hello world"; +//// class Foo{ +//// x : string; +//// y : number; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputExternalModule.ts b/tests/cases/fourslash/getEmitOutputExternalModule.ts index ef9fb348c57..080cd56e976 100644 --- a/tests/cases/fourslash/getEmitOutputExternalModule.ts +++ b/tests/cases/fourslash/getEmitOutputExternalModule.ts @@ -1,19 +1,19 @@ -/// - -// @BaselineFile: getEmitOutputExternalModule.baseline -// @out: declSingleFile.js - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -//// export module M { -//// class C {c} -//// } - +/// + +// @BaselineFile: getEmitOutputExternalModule.baseline +// @out: declSingleFile.js + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +//// export module M { +//// class C {c} +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputExternalModule2.ts b/tests/cases/fourslash/getEmitOutputExternalModule2.ts index abecc219698..f4b55abc2ea 100644 --- a/tests/cases/fourslash/getEmitOutputExternalModule2.ts +++ b/tests/cases/fourslash/getEmitOutputExternalModule2.ts @@ -1,26 +1,26 @@ -/// - -// @BaselineFile: getEmitOutputExternalModule2.baseline -// @out: declSingleFile.js - -// @Filename: inputFile1.ts -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x: string = "world"; -//// class Bar2 { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile3.ts -//// export module M { -//// class C {c} -//// } - +/// + +// @BaselineFile: getEmitOutputExternalModule2.baseline +// @out: declSingleFile.js + +// @Filename: inputFile1.ts +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x: string = "world"; +//// class Bar2 { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile3.ts +//// export module M { +//// class C {c} +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputMapRoot.ts b/tests/cases/fourslash/getEmitOutputMapRoot.ts index 15932d41c32..7cbaf5d60b1 100644 --- a/tests/cases/fourslash/getEmitOutputMapRoot.ts +++ b/tests/cases/fourslash/getEmitOutputMapRoot.ts @@ -1,17 +1,17 @@ -/// - -// @BaselineFile: getEmitOutputMapRoots.baseline -// @out: declSingleFile.js -// @sourceMap: true -// @mapRoot: mapRootDir/ - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x = 109; -//// var foo = "hello world"; -//// class M { -//// x: number; -//// y: string; -//// } - +/// + +// @BaselineFile: getEmitOutputMapRoots.baseline +// @out: declSingleFile.js +// @sourceMap: true +// @mapRoot: mapRootDir/ + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x = 109; +//// var foo = "hello world"; +//// class M { +//// x: number; +//// y: string; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputNoErrors.ts b/tests/cases/fourslash/getEmitOutputNoErrors.ts index b48a86a03ab..6ef4f34da51 100644 --- a/tests/cases/fourslash/getEmitOutputNoErrors.ts +++ b/tests/cases/fourslash/getEmitOutputNoErrors.ts @@ -1,12 +1,12 @@ -/// - -// @BaselineFile: getEmitOutputNoErrors.baseline -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x; -//// class M { -//// x: number; -//// y: string; -//// } - +/// + +// @BaselineFile: getEmitOutputNoErrors.baseline +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x; +//// class M { +//// x: number; +//// y: string; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputOnlyOneFile.ts b/tests/cases/fourslash/getEmitOutputOnlyOneFile.ts index 2ad822741f2..ecf042f9184 100644 --- a/tests/cases/fourslash/getEmitOutputOnlyOneFile.ts +++ b/tests/cases/fourslash/getEmitOutputOnlyOneFile.ts @@ -1,20 +1,20 @@ -/// - -// @BaselineFile: getEmitOutputOnlyOneFile.baseline - -// @Filename: inputFile1.ts -//// var x: any; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x: any; -//// class Foo{ -//// x : string; -//// y : number -//// } - +/// + +// @BaselineFile: getEmitOutputOnlyOneFile.baseline + +// @Filename: inputFile1.ts +//// var x: any; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x: any; +//// class Foo{ +//// x : string; +//// y : number +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSingleFile.ts b/tests/cases/fourslash/getEmitOutputSingleFile.ts index ec774149f4b..babeb8dee14 100644 --- a/tests/cases/fourslash/getEmitOutputSingleFile.ts +++ b/tests/cases/fourslash/getEmitOutputSingleFile.ts @@ -1,21 +1,21 @@ -/// - -// @BaselineFile: getEmitOutputSingleFile.baseline -// @out: outputDir/singleFile.js - -// @Filename: inputFile1.ts -//// var x: any; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x: any; -//// class Foo{ -//// x : string; -//// y : number -//// } - +/// + +// @BaselineFile: getEmitOutputSingleFile.baseline +// @out: outputDir/singleFile.js + +// @Filename: inputFile1.ts +//// var x: any; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x: any; +//// class Foo{ +//// x : string; +//// y : number +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSingleFile2.ts b/tests/cases/fourslash/getEmitOutputSingleFile2.ts index 8bf4f7f4af7..5dd0276a936 100644 --- a/tests/cases/fourslash/getEmitOutputSingleFile2.ts +++ b/tests/cases/fourslash/getEmitOutputSingleFile2.ts @@ -1,28 +1,28 @@ -/// - -// @BaselineFile: getEmitOutputSingleFile2.baseline -// @module: CommonJS -// @declaration: true -// @out: declSingleFile.js -// @outDir: tests/cases/fourslash/ - -// @Filename: inputFile1.ts -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -//// var x1: string = "hello world"; -//// class Foo{ -//// x : string; -//// y : number; -//// } - -// @Filename: inputFile3.ts -// @emitThisFile: true -////export var foo = 10; -////export var bar = "hello world" - +/// + +// @BaselineFile: getEmitOutputSingleFile2.baseline +// @module: CommonJS +// @declaration: true +// @out: declSingleFile.js +// @outDir: tests/cases/fourslash/ + +// @Filename: inputFile1.ts +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +//// var x1: string = "hello world"; +//// class Foo{ +//// x : string; +//// y : number; +//// } + +// @Filename: inputFile3.ts +// @emitThisFile: true +////export var foo = 10; +////export var bar = "hello world" + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSourceMap.ts b/tests/cases/fourslash/getEmitOutputSourceMap.ts index df02af35ec3..24e37648064 100644 --- a/tests/cases/fourslash/getEmitOutputSourceMap.ts +++ b/tests/cases/fourslash/getEmitOutputSourceMap.ts @@ -1,15 +1,15 @@ -/// - -// @BaselineFile: getEmitOutputSourceMap.baseline -// @sourceMap: true - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x = 109; -//// var foo = "hello world"; -//// class M { -//// x: number; -//// y: string; -//// } - +/// + +// @BaselineFile: getEmitOutputSourceMap.baseline +// @sourceMap: true + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x = 109; +//// var foo = "hello world"; +//// class M { +//// x: number; +//// y: string; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSourceMap2.ts b/tests/cases/fourslash/getEmitOutputSourceMap2.ts index a8b43328ea5..4b4b1185c7a 100644 --- a/tests/cases/fourslash/getEmitOutputSourceMap2.ts +++ b/tests/cases/fourslash/getEmitOutputSourceMap2.ts @@ -1,23 +1,23 @@ -/// - -// @BaselineFile: getEmitOutputSourceMap2.baseline -// @sourceMap: true -// @outDir: sample/outDir - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x = 109; -//// var foo = "hello world"; -//// class M { -//// x: number; -//// y: string; -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var intro = "hello world"; -//// if (intro !== undefined) { -//// var k = 10; -//// } - +/// + +// @BaselineFile: getEmitOutputSourceMap2.baseline +// @sourceMap: true +// @outDir: sample/outDir + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x = 109; +//// var foo = "hello world"; +//// class M { +//// x: number; +//// y: string; +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var intro = "hello world"; +//// if (intro !== undefined) { +//// var k = 10; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSourceRoot.ts b/tests/cases/fourslash/getEmitOutputSourceRoot.ts index b260e593098..ac7d63558e4 100644 --- a/tests/cases/fourslash/getEmitOutputSourceRoot.ts +++ b/tests/cases/fourslash/getEmitOutputSourceRoot.ts @@ -1,16 +1,16 @@ -/// - -// @BaselineFile: getEmitOutputSourceRoot.baseline -// @sourceMap: true -// @sourceRoot: sourceRootDir/ - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x = 109; -//// var foo = "hello world"; -//// class M { -//// x: number; -//// y: string; -//// } - +/// + +// @BaselineFile: getEmitOutputSourceRoot.baseline +// @sourceMap: true +// @sourceRoot: sourceRootDir/ + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x = 109; +//// var foo = "hello world"; +//// class M { +//// x: number; +//// y: string; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputSourceRootMultiFiles.ts b/tests/cases/fourslash/getEmitOutputSourceRootMultiFiles.ts index bddf9e423ce..7360f9f27ef 100644 --- a/tests/cases/fourslash/getEmitOutputSourceRootMultiFiles.ts +++ b/tests/cases/fourslash/getEmitOutputSourceRootMultiFiles.ts @@ -1,24 +1,24 @@ -/// - -// @BaselineFile: getEmitOutputSourceRootMultiFiles.baseline -// @sourceMap: true -// @sourceRoot: sourceRootDir/ - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x = 109; -//// var foo = "hello world"; -//// class M { -//// x: number; -//// y: string; -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var bar = "hello world Typescript"; -//// class C { -//// x: number; -//// y: string[]; -//// } - +/// + +// @BaselineFile: getEmitOutputSourceRootMultiFiles.baseline +// @sourceMap: true +// @sourceRoot: sourceRootDir/ + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x = 109; +//// var foo = "hello world"; +//// class M { +//// x: number; +//// y: string; +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var bar = "hello world Typescript"; +//// class C { +//// x: number; +//// y: string[]; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithDeclarationFile.ts b/tests/cases/fourslash/getEmitOutputWithDeclarationFile.ts index d15b49755d3..9e73a8490da 100644 --- a/tests/cases/fourslash/getEmitOutputWithDeclarationFile.ts +++ b/tests/cases/fourslash/getEmitOutputWithDeclarationFile.ts @@ -1,17 +1,17 @@ -/// - -// @BaselineFile: getEmitOutputWithDeclarationFile.baseline - -// @Filename: decl.d.ts -// @emitThisFile: true -//// interface I { a: string; } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x1: string = "hello world"; -//// class Foo{ -//// x : string; -//// y : number; -//// } - +/// + +// @BaselineFile: getEmitOutputWithDeclarationFile.baseline + +// @Filename: decl.d.ts +// @emitThisFile: true +//// interface I { a: string; } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x1: string = "hello world"; +//// class Foo{ +//// x : string; +//// y : number; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithDeclarationFile2.ts b/tests/cases/fourslash/getEmitOutputWithDeclarationFile2.ts index ac68611246b..8f8e21cbcbb 100644 --- a/tests/cases/fourslash/getEmitOutputWithDeclarationFile2.ts +++ b/tests/cases/fourslash/getEmitOutputWithDeclarationFile2.ts @@ -1,18 +1,18 @@ -/// - -// @BaselineFile: getEmitOutputWithDeclarationFile2.baseline -// @module: CommonJS - -// @Filename: decl.d.ts -// @emitThisFile: true -//// interface I { a: string; } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// export class Foo { } - -// @Filename: inputFile3.ts -// @emitThisFile: true -//// var x:string = "hello"; - +/// + +// @BaselineFile: getEmitOutputWithDeclarationFile2.baseline +// @module: CommonJS + +// @Filename: decl.d.ts +// @emitThisFile: true +//// interface I { a: string; } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// export class Foo { } + +// @Filename: inputFile3.ts +// @emitThisFile: true +//// var x:string = "hello"; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithDeclarationFile3.ts b/tests/cases/fourslash/getEmitOutputWithDeclarationFile3.ts index 266edaf23e1..60f7b433149 100644 --- a/tests/cases/fourslash/getEmitOutputWithDeclarationFile3.ts +++ b/tests/cases/fourslash/getEmitOutputWithDeclarationFile3.ts @@ -1,22 +1,22 @@ -/// - -// @BaselineFile: getEmitOutputWithDeclarationFile3.baseline -// @out: declSingle.js - -// @Filename: decl.d.ts -//// interface I { a: string; } - -// @Filename: inputFile2.ts -//// export class Foo { } - -// @Filename: inputFile3.ts -// @emitThisFile: true -//// var x:string = "hello"; - -// @Filename: inputFile4.ts -//// var x1:number = 1000; - -// @Filename: inputFile5.js -//// var x2 = 1000; -debugger; +/// + +// @BaselineFile: getEmitOutputWithDeclarationFile3.baseline +// @out: declSingle.js + +// @Filename: decl.d.ts +//// interface I { a: string; } + +// @Filename: inputFile2.ts +//// export class Foo { } + +// @Filename: inputFile3.ts +// @emitThisFile: true +//// var x:string = "hello"; + +// @Filename: inputFile4.ts +//// var x1:number = 1000; + +// @Filename: inputFile5.js +//// var x2 = 1000; +debugger; verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithEarlySemanticErrors.ts b/tests/cases/fourslash/getEmitOutputWithEarlySemanticErrors.ts index 2946fffb808..58d6ce19ed1 100644 --- a/tests/cases/fourslash/getEmitOutputWithEarlySemanticErrors.ts +++ b/tests/cases/fourslash/getEmitOutputWithEarlySemanticErrors.ts @@ -1,10 +1,10 @@ -/// - -// @BaselineFile: getEmitOutputWithEarlySyntacticErrors.baseline - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// // File contains early errors. All outputs should be skipped. -//// const uninitialized_const_error; - +/// + +// @BaselineFile: getEmitOutputWithEarlySyntacticErrors.baseline + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// // File contains early errors. All outputs should be skipped. +//// const uninitialized_const_error; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts b/tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts index ba643f996d7..0d2f488e433 100644 --- a/tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts +++ b/tests/cases/fourslash/getEmitOutputWithEmitterErrors.ts @@ -1,15 +1,15 @@ -/// - -// @BaselineFile: getEmitOutputWithEmitterErrors.baseline -// @declaration: true - -// @Filename: inputFile.ts -// @emitThisFile: true -////module M { -//// class C { } -//// export var foo = new C(); -////} - - -// Only generate javscript file. The semantic error should not affect it +/// + +// @BaselineFile: getEmitOutputWithEmitterErrors.baseline +// @declaration: true + +// @Filename: inputFile.ts +// @emitThisFile: true +////module M { +//// class C { } +//// export var foo = new C(); +////} + + +// Only generate javscript file. The semantic error should not affect it verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts b/tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts index 5240a102a28..865c94adcae 100644 --- a/tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts +++ b/tests/cases/fourslash/getEmitOutputWithEmitterErrors2.ts @@ -1,14 +1,14 @@ -/// - -// @BaselineFile: getEmitOutputWithEmitterErrors2.baseline -// @declaration: true -// @module: AMD - -// @Filename: inputFile.ts -// @emitThisFile: true -////class C { } -////export module M { -//// export var foo = new C(); -////} - +/// + +// @BaselineFile: getEmitOutputWithEmitterErrors2.baseline +// @declaration: true +// @module: AMD + +// @Filename: inputFile.ts +// @emitThisFile: true +////class C { } +////export module M { +//// export var foo = new C(); +////} + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSemanticErrors.ts b/tests/cases/fourslash/getEmitOutputWithSemanticErrors.ts index b4e3a50b0e8..13aeda82cc8 100644 --- a/tests/cases/fourslash/getEmitOutputWithSemanticErrors.ts +++ b/tests/cases/fourslash/getEmitOutputWithSemanticErrors.ts @@ -1,9 +1,9 @@ -/// - -// @BaselineFile: getEmitOutputWithSemanticErrors.baseline - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x:number = "hello world"; - +/// + +// @BaselineFile: getEmitOutputWithSemanticErrors.baseline + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x:number = "hello world"; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSemanticErrors2.ts b/tests/cases/fourslash/getEmitOutputWithSemanticErrors2.ts index c67ef0fd29d..174b42bb37e 100644 --- a/tests/cases/fourslash/getEmitOutputWithSemanticErrors2.ts +++ b/tests/cases/fourslash/getEmitOutputWithSemanticErrors2.ts @@ -1,10 +1,10 @@ -/// - -// @BaselineFile: getEmitOutputWithSemanticErrors2.baseline -// @declaration: true - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x:number = "hello world"; - +/// + +// @BaselineFile: getEmitOutputWithSemanticErrors2.baseline +// @declaration: true + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x:number = "hello world"; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles.ts b/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles.ts index 69f8b8a8b41..d24bcfbf504 100644 --- a/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles.ts +++ b/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles.ts @@ -1,16 +1,16 @@ -/// - -// @BaselineFile: getEmitOutputWithSemanticErrorsForMultipleFiles.baseline -// @declaration: true - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// // File to emit, does not contain semantic errors -//// // expected to be emitted correctelly regardless of the semantic errors in the other file -//// var noErrors = true; - -// @Filename: inputFile2.ts -//// // File not emitted, and contains semantic errors -//// var semanticError: boolean = "string"; -debugger; +/// + +// @BaselineFile: getEmitOutputWithSemanticErrorsForMultipleFiles.baseline +// @declaration: true + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// // File to emit, does not contain semantic errors +//// // expected to be emitted correctelly regardless of the semantic errors in the other file +//// var noErrors = true; + +// @Filename: inputFile2.ts +//// // File not emitted, and contains semantic errors +//// var semanticError: boolean = "string"; +debugger; verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles2.ts b/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles2.ts index d5cfd1346ca..95a4ac78a88 100644 --- a/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles2.ts +++ b/tests/cases/fourslash/getEmitOutputWithSemanticErrorsForMultipleFiles2.ts @@ -1,17 +1,17 @@ -/// - -// @BaselineFile: getEmitOutputWithSemanticErrorsForMultipleFiles2.baseline -// @declaration: true -// @out: out.js - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// // File to emit, does not contain semantic errors, but --out is passed -//// // expected to not generate declarations because of the semantic errors in the other file -//// var noErrors = true; - -// @Filename: inputFile2.ts -//// // File not emitted, and contains semantic errors -//// var semanticError: boolean = "string"; - +/// + +// @BaselineFile: getEmitOutputWithSemanticErrorsForMultipleFiles2.baseline +// @declaration: true +// @out: out.js + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// // File to emit, does not contain semantic errors, but --out is passed +//// // expected to not generate declarations because of the semantic errors in the other file +//// var noErrors = true; + +// @Filename: inputFile2.ts +//// // File not emitted, and contains semantic errors +//// var semanticError: boolean = "string"; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles.ts b/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles.ts index 3b3d01eaac8..c2ddd3ea004 100644 --- a/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles.ts +++ b/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles.ts @@ -1,15 +1,15 @@ -/// - -// @BaselineFile: getEmitOutputWithSyntacticErrorsForMultipleFiles.baseline - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// // File to emit, does not contain syntactic errors -//// // expected to be emitted correctelly regardless of the syntactic errors in the other file -//// var noErrors = true; - -// @Filename: inputFile2.ts -//// // File not emitted, and contains syntactic errors -//// var syntactic Error; - +/// + +// @BaselineFile: getEmitOutputWithSyntacticErrorsForMultipleFiles.baseline + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// // File to emit, does not contain syntactic errors +//// // expected to be emitted correctelly regardless of the syntactic errors in the other file +//// var noErrors = true; + +// @Filename: inputFile2.ts +//// // File not emitted, and contains syntactic errors +//// var syntactic Error; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles2.ts b/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles2.ts index ce82f958b91..f66e6563c81 100644 --- a/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles2.ts +++ b/tests/cases/fourslash/getEmitOutputWithSyntacticErrorsForMultipleFiles2.ts @@ -1,16 +1,16 @@ -/// - -// @BaselineFile: getEmitOutputWithSyntacticErrorsForMultipleFiles2.baseline -// @out: out.js - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// // File to emit, does not contain syntactic errors, but --out is passed -//// // expected to not generate outputs because of the syntactic errors in the other file. -//// var noErrors = true; - -// @Filename: inputFile2.ts -//// // File not emitted, and contains syntactic errors -//// var syntactic Error; - +/// + +// @BaselineFile: getEmitOutputWithSyntacticErrorsForMultipleFiles2.baseline +// @out: out.js + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// // File to emit, does not contain syntactic errors, but --out is passed +//// // expected to not generate outputs because of the syntactic errors in the other file. +//// var noErrors = true; + +// @Filename: inputFile2.ts +//// // File not emitted, and contains syntactic errors +//// var syntactic Error; + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getEmitOutputWithSyntaxErrors.ts b/tests/cases/fourslash/getEmitOutputWithSyntaxErrors.ts index 87e9bb076a5..4d094f463d1 100644 --- a/tests/cases/fourslash/getEmitOutputWithSyntaxErrors.ts +++ b/tests/cases/fourslash/getEmitOutputWithSyntaxErrors.ts @@ -1,9 +1,9 @@ -/// - -// @BaselineFile: getEmitOutputWithSyntaxErrors.baseline - -// @Filename: inputFile.ts -// @emitThisFile: true -//// var x: - +/// + +// @BaselineFile: getEmitOutputWithSyntaxErrors.baseline + +// @Filename: inputFile.ts +// @emitThisFile: true +//// var x: + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/getMatchingBracesAdjacentBraces.ts b/tests/cases/fourslash/getMatchingBracesAdjacentBraces.ts index 8dd997ebe73..0dbd5630a5f 100644 --- a/tests/cases/fourslash/getMatchingBracesAdjacentBraces.ts +++ b/tests/cases/fourslash/getMatchingBracesAdjacentBraces.ts @@ -1,4 +1,4 @@ -////function f[||][|(x: T)|][|{ +////function f[||][|(x: T)|][|{ //// return x; ////}|] diff --git a/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts b/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts index ac74fc2192f..51d5907a5d6 100644 --- a/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts +++ b/tests/cases/fourslash/getOccurrencesModifiersNegatives1.ts @@ -1,4 +1,4 @@ -/// +/// ////class C { //// [|export|] foo; diff --git a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts index f9d47b07478..53840fc3bd9 100644 --- a/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts +++ b/tests/cases/fourslash/getOccurrencesPropertyInAliasedInterface.ts @@ -1,4 +1,4 @@ -////module m { +////module m { //// export interface Foo { //// [|abc|] //// } diff --git a/tests/cases/fourslash/getOccurrencesSetAndGet.ts b/tests/cases/fourslash/getOccurrencesSetAndGet.ts index b1ab6f44c6b..ddeaf8f26ff 100644 --- a/tests/cases/fourslash/getOccurrencesSetAndGet.ts +++ b/tests/cases/fourslash/getOccurrencesSetAndGet.ts @@ -1,34 +1,34 @@ -/// - -////class Foo { -//// [|set|] bar(b: any) { -//// } -//// -//// public [|get|] bar(): any { -//// return undefined; -//// } -//// -//// public set set(s: any) { -//// } -//// -//// public get set(): any { -//// return undefined; -//// } -//// -//// public set get(g: any) { -//// } -//// -//// public get get(): any { -//// return undefined; -//// } -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); +/// + +////class Foo { +//// [|set|] bar(b: any) { +//// } +//// +//// public [|get|] bar(): any { +//// return undefined; +//// } +//// +//// public set set(s: any) { +//// } +//// +//// public get set(): any { +//// return undefined; +//// } +//// +//// public set get(g: any) { +//// } +//// +//// public get get(): any { +//// return undefined; +//// } +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); diff --git a/tests/cases/fourslash/getOccurrencesSetAndGet2.ts b/tests/cases/fourslash/getOccurrencesSetAndGet2.ts index 1345394b8ee..3e05f511efc 100644 --- a/tests/cases/fourslash/getOccurrencesSetAndGet2.ts +++ b/tests/cases/fourslash/getOccurrencesSetAndGet2.ts @@ -1,34 +1,34 @@ -/// - -////class Foo { -//// set bar(b: any) { -//// } -//// -//// public get bar(): any { -//// return undefined; -//// } -//// -//// public [|set|] set(s: any) { -//// } -//// -//// public [|get|] set(): any { -//// return undefined; -//// } -//// -//// public set get(g: any) { -//// } -//// -//// public get get(): any { -//// return undefined; -//// } -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); +/// + +////class Foo { +//// set bar(b: any) { +//// } +//// +//// public get bar(): any { +//// return undefined; +//// } +//// +//// public [|set|] set(s: any) { +//// } +//// +//// public [|get|] set(): any { +//// return undefined; +//// } +//// +//// public set get(g: any) { +//// } +//// +//// public get get(): any { +//// return undefined; +//// } +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); diff --git a/tests/cases/fourslash/getOccurrencesSetAndGet3.ts b/tests/cases/fourslash/getOccurrencesSetAndGet3.ts index 4105a407571..777a62db6a5 100644 --- a/tests/cases/fourslash/getOccurrencesSetAndGet3.ts +++ b/tests/cases/fourslash/getOccurrencesSetAndGet3.ts @@ -1,34 +1,34 @@ -/// - -////class Foo { -//// set bar(b: any) { -//// } -//// -//// public get bar(): any { -//// return undefined; -//// } -//// -//// public set set(s: any) { -//// } -//// -//// public get set(): any { -//// return undefined; -//// } -//// -//// public [|set|] get(g: any) { -//// } -//// -//// public [|get|] get(): any { -//// return undefined; -//// } -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); +/// + +////class Foo { +//// set bar(b: any) { +//// } +//// +//// public get bar(): any { +//// return undefined; +//// } +//// +//// public set set(s: any) { +//// } +//// +//// public get set(): any { +//// return undefined; +//// } +//// +//// public [|set|] get(g: any) { +//// } +//// +//// public [|get|] get(): any { +//// return undefined; +//// } +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow.ts b/tests/cases/fourslash/getOccurrencesThrow.ts index c25551db92e..19f10dbfb9f 100644 --- a/tests/cases/fourslash/getOccurrencesThrow.ts +++ b/tests/cases/fourslash/getOccurrencesThrow.ts @@ -1,58 +1,58 @@ -/// - -////function f(a: number) { -//// try { -//// throw "Hello"; -//// -//// try { -//// throw 10; -//// } -//// catch (x) { -//// [|return|] 100; -//// } -//// finally { -//// throw 10; -//// } -//// } -//// catch (x) { -//// [|throw|] "Something"; -//// } -//// finally { -//// [|throw|] "Also something"; -//// } -//// if (a > 0) { -//// [|return|] (function () { -//// return; -//// return; -//// return; -//// -//// if (false) { -//// return true; -//// } -//// throw "Hello!"; -//// })() || true; -//// } -//// -//// [|th/**/row|] 10; -//// -//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) -//// -//// [|return|]; -//// [|return|] true; -//// [|throw|] false; -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - -goTo.marker(); -test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); -}); +/// + +////function f(a: number) { +//// try { +//// throw "Hello"; +//// +//// try { +//// throw 10; +//// } +//// catch (x) { +//// [|return|] 100; +//// } +//// finally { +//// throw 10; +//// } +//// } +//// catch (x) { +//// [|throw|] "Something"; +//// } +//// finally { +//// [|throw|] "Also something"; +//// } +//// if (a > 0) { +//// [|return|] (function () { +//// return; +//// return; +//// return; +//// +//// if (false) { +//// return true; +//// } +//// throw "Hello!"; +//// })() || true; +//// } +//// +//// [|th/**/row|] 10; +//// +//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) +//// +//// [|return|]; +//// [|return|] true; +//// [|throw|] false; +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + +goTo.marker(); +test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow2.ts b/tests/cases/fourslash/getOccurrencesThrow2.ts index 99e18020396..9bd2f82e638 100644 --- a/tests/cases/fourslash/getOccurrencesThrow2.ts +++ b/tests/cases/fourslash/getOccurrencesThrow2.ts @@ -1,58 +1,58 @@ -/// - -////function f(a: number) { -//// try { -//// throw "Hello"; -//// -//// try { -//// [|t/**/hrow|] 10; -//// } -//// catch (x) { -//// return 100; -//// } -//// finally { -//// throw 10; -//// } -//// } -//// catch (x) { -//// throw "Something"; -//// } -//// finally { -//// throw "Also something"; -//// } -//// if (a > 0) { -//// return (function () { -//// return; -//// return; -//// return; -//// -//// if (false) { -//// return true; -//// } -//// throw "Hello!"; -//// })() || true; -//// } -//// -//// throw 10; -//// -//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) -//// -//// return; -//// return true; -//// throw false; -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - -goTo.marker(); -test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); -}); +/// + +////function f(a: number) { +//// try { +//// throw "Hello"; +//// +//// try { +//// [|t/**/hrow|] 10; +//// } +//// catch (x) { +//// return 100; +//// } +//// finally { +//// throw 10; +//// } +//// } +//// catch (x) { +//// throw "Something"; +//// } +//// finally { +//// throw "Also something"; +//// } +//// if (a > 0) { +//// return (function () { +//// return; +//// return; +//// return; +//// +//// if (false) { +//// return true; +//// } +//// throw "Hello!"; +//// })() || true; +//// } +//// +//// throw 10; +//// +//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) +//// +//// return; +//// return true; +//// throw false; +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + +goTo.marker(); +test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow3.ts b/tests/cases/fourslash/getOccurrencesThrow3.ts index 313d04b8e38..359b783df07 100644 --- a/tests/cases/fourslash/getOccurrencesThrow3.ts +++ b/tests/cases/fourslash/getOccurrencesThrow3.ts @@ -1,58 +1,58 @@ -/// - -////function f(a: number) { -//// try { -//// [|throw|] "Hello"; -//// -//// try { -//// throw 10; -//// } -//// catch (x) { -//// return 100; -//// } -//// finally { -//// [|thr/**/ow|] 10; -//// } -//// } -//// catch (x) { -//// throw "Something"; -//// } -//// finally { -//// throw "Also something"; -//// } -//// if (a > 0) { -//// return (function () { -//// return; -//// return; -//// return; -//// -//// if (false) { -//// return true; -//// } -//// throw "Hello!"; -//// })() || true; -//// } -//// -//// throw 10; -//// -//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) -//// -//// return; -//// return true; -//// throw false; -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - -goTo.marker(); -test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); -}); +/// + +////function f(a: number) { +//// try { +//// [|throw|] "Hello"; +//// +//// try { +//// throw 10; +//// } +//// catch (x) { +//// return 100; +//// } +//// finally { +//// [|thr/**/ow|] 10; +//// } +//// } +//// catch (x) { +//// throw "Something"; +//// } +//// finally { +//// throw "Also something"; +//// } +//// if (a > 0) { +//// return (function () { +//// return; +//// return; +//// return; +//// +//// if (false) { +//// return true; +//// } +//// throw "Hello!"; +//// })() || true; +//// } +//// +//// throw 10; +//// +//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) +//// +//// return; +//// return true; +//// throw false; +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + +goTo.marker(); +test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow4.ts b/tests/cases/fourslash/getOccurrencesThrow4.ts index adf321526af..ab2375907ee 100644 --- a/tests/cases/fourslash/getOccurrencesThrow4.ts +++ b/tests/cases/fourslash/getOccurrencesThrow4.ts @@ -1,58 +1,58 @@ -/// - -////function f(a: number) { -//// try { -//// throw "Hello"; -//// -//// try { -//// throw 10; -//// } -//// catch (x) { -//// return 100; -//// } -//// finally { -//// throw 10; -//// } -//// } -//// catch (x) { -//// throw "Something"; -//// } -//// finally { -//// throw "Also something"; -//// } -//// if (a > 0) { -//// return (function () { -//// [|return|]; -//// [|return|]; -//// [|return|]; -//// -//// if (false) { -//// [|return|] true; -//// } -//// [|th/**/row|] "Hello!"; -//// })() || true; -//// } -//// -//// throw 10; -//// -//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) -//// -//// return; -//// return true; -//// throw false; -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - -goTo.marker(); -test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); -}); +/// + +////function f(a: number) { +//// try { +//// throw "Hello"; +//// +//// try { +//// throw 10; +//// } +//// catch (x) { +//// return 100; +//// } +//// finally { +//// throw 10; +//// } +//// } +//// catch (x) { +//// throw "Something"; +//// } +//// finally { +//// throw "Also something"; +//// } +//// if (a > 0) { +//// return (function () { +//// [|return|]; +//// [|return|]; +//// [|return|]; +//// +//// if (false) { +//// [|return|] true; +//// } +//// [|th/**/row|] "Hello!"; +//// })() || true; +//// } +//// +//// throw 10; +//// +//// var unusued = [1, 2, 3, 4].map(x => { throw 4 }) +//// +//// return; +//// return true; +//// throw false; +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + +goTo.marker(); +test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow5.ts b/tests/cases/fourslash/getOccurrencesThrow5.ts index 3e5ba4bca13..9ba28191752 100644 --- a/tests/cases/fourslash/getOccurrencesThrow5.ts +++ b/tests/cases/fourslash/getOccurrencesThrow5.ts @@ -1,58 +1,58 @@ -/// - -////function f(a: number) { -//// try { -//// throw "Hello"; -//// -//// try { -//// throw 10; -//// } -//// catch (x) { -//// return 100; -//// } -//// finally { -//// throw 10; -//// } -//// } -//// catch (x) { -//// throw "Something"; -//// } -//// finally { -//// throw "Also something"; -//// } -//// if (a > 0) { -//// return (function () { -//// return; -//// return; -//// return; -//// -//// if (false) { -//// return true; -//// } -//// throw "Hello!"; -//// })() || true; -//// } -//// -//// throw 10; -//// -//// var unusued = [1, 2, 3, 4].map(x => { [|thr/**/ow|] 4 }) -//// -//// return; -//// return true; -//// throw false; -////} - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - -goTo.marker(); -test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); -}); +/// + +////function f(a: number) { +//// try { +//// throw "Hello"; +//// +//// try { +//// throw 10; +//// } +//// catch (x) { +//// return 100; +//// } +//// finally { +//// throw 10; +//// } +//// } +//// catch (x) { +//// throw "Something"; +//// } +//// finally { +//// throw "Also something"; +//// } +//// if (a > 0) { +//// return (function () { +//// return; +//// return; +//// return; +//// +//// if (false) { +//// return true; +//// } +//// throw "Hello!"; +//// })() || true; +//// } +//// +//// throw 10; +//// +//// var unusued = [1, 2, 3, 4].map(x => { [|thr/**/ow|] 4 }) +//// +//// return; +//// return true; +//// throw false; +////} + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + +goTo.marker(); +test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); +}); diff --git a/tests/cases/fourslash/getOccurrencesThrow6.ts b/tests/cases/fourslash/getOccurrencesThrow6.ts index 2769c9933db..8b58347ed8a 100644 --- a/tests/cases/fourslash/getOccurrencesThrow6.ts +++ b/tests/cases/fourslash/getOccurrencesThrow6.ts @@ -1,28 +1,28 @@ -/// - -////[|throw|] 100; -//// -////try { -//// throw 0; -//// var x = () => { throw 0; }; -////} -////catch (y) { -//// var x = () => { throw 0; }; -//// [|throw|] 200; -////} -////finally { -//// [|throw|] 300; -////} - - - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - +/// + +////[|throw|] 100; +//// +////try { +//// throw 0; +//// var x = () => { throw 0; }; +////} +////catch (y) { +//// var x = () => { throw 0; }; +//// [|throw|] 200; +////} +////finally { +//// [|throw|] 300; +////} + + + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + diff --git a/tests/cases/fourslash/getOccurrencesThrow7.ts b/tests/cases/fourslash/getOccurrencesThrow7.ts index 46e899a891b..48ab981d762 100644 --- a/tests/cases/fourslash/getOccurrencesThrow7.ts +++ b/tests/cases/fourslash/getOccurrencesThrow7.ts @@ -1,31 +1,31 @@ -/// - -////try { -//// [|throw|] 10; -//// -//// try { -//// throw 10; -//// } -//// catch (x) { -//// [|throw|] 10; -//// } -//// finally { -//// [|throw|] 10; -//// } -////} -////finally { -//// [|throw|] 10; -////} -//// -////[|throw|] 10; - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - +/// + +////try { +//// [|throw|] 10; +//// +//// try { +//// throw 10; +//// } +//// catch (x) { +//// [|throw|] 10; +//// } +//// finally { +//// [|throw|] 10; +//// } +////} +////finally { +//// [|throw|] 10; +////} +//// +////[|throw|] 10; + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + diff --git a/tests/cases/fourslash/getOccurrencesThrow8.ts b/tests/cases/fourslash/getOccurrencesThrow8.ts index 679e13c8d5a..cc527720dc4 100644 --- a/tests/cases/fourslash/getOccurrencesThrow8.ts +++ b/tests/cases/fourslash/getOccurrencesThrow8.ts @@ -1,31 +1,31 @@ -/// - -////try { -//// throw 10; -//// -//// try { -//// [|throw|] 10; -//// } -//// catch (x) { -//// throw 10; -//// } -//// finally { -//// throw 10; -//// } -////} -////finally { -//// throw 10; -////} -//// -////throw 10; - -test.ranges().forEach(r => { - goTo.position(r.start); - - test.ranges().forEach(range => { - verify.occurrencesAtPositionContains(range, false); - }); - - verify.occurrencesAtPositionCount(test.ranges().length); -}); - +/// + +////try { +//// throw 10; +//// +//// try { +//// [|throw|] 10; +//// } +//// catch (x) { +//// throw 10; +//// } +//// finally { +//// throw 10; +//// } +////} +////finally { +//// throw 10; +////} +//// +////throw 10; + +test.ranges().forEach(r => { + goTo.position(r.start); + + test.ranges().forEach(range => { + verify.occurrencesAtPositionContains(range, false); + }); + + verify.occurrencesAtPositionCount(test.ranges().length); +}); + diff --git a/tests/cases/fourslash/getSemanticDiagnosticForDeclaration.ts b/tests/cases/fourslash/getSemanticDiagnosticForDeclaration.ts index 6345c464213..804abbde33b 100644 --- a/tests/cases/fourslash/getSemanticDiagnosticForDeclaration.ts +++ b/tests/cases/fourslash/getSemanticDiagnosticForDeclaration.ts @@ -1,11 +1,11 @@ -/// - -// @module: CommonJS -// @declaration: true -//// interface privateInterface {} -//// export class Bar implements /*1*/privateInterface/*2*/{ } - -verify.errorExistsBetweenMarkers("1", "2"); -verify.numberOfErrorsInCurrentFile(1); - - +/// + +// @module: CommonJS +// @declaration: true +//// interface privateInterface {} +//// export class Bar implements /*1*/privateInterface/*2*/{ } + +verify.errorExistsBetweenMarkers("1", "2"); +verify.numberOfErrorsInCurrentFile(1); + + diff --git a/tests/cases/fourslash/getSemanticDiagnosticForNoDeclaration.ts b/tests/cases/fourslash/getSemanticDiagnosticForNoDeclaration.ts index dc351a21f2c..cdcde01054e 100644 --- a/tests/cases/fourslash/getSemanticDiagnosticForNoDeclaration.ts +++ b/tests/cases/fourslash/getSemanticDiagnosticForNoDeclaration.ts @@ -1,10 +1,10 @@ -/// - -// @module: CommonJS - -//// interface privateInterface {} -//// export class Bar implements /*1*/privateInterface/*2*/{ } - -verify.numberOfErrorsInCurrentFile(0); - - +/// + +// @module: CommonJS + +//// interface privateInterface {} +//// export class Bar implements /*1*/privateInterface/*2*/{ } + +verify.numberOfErrorsInCurrentFile(0); + + diff --git a/tests/cases/fourslash/globalCompletionListInsideObjectLiterals.ts b/tests/cases/fourslash/globalCompletionListInsideObjectLiterals.ts index 3f80f3d9c25..af7bc075f8c 100644 --- a/tests/cases/fourslash/globalCompletionListInsideObjectLiterals.ts +++ b/tests/cases/fourslash/globalCompletionListInsideObjectLiterals.ts @@ -1,49 +1,49 @@ -/// - -////module ObjectLiterals { -//// interface MyPoint { -//// x1: number; -//// y1: number; -//// } -//// -//// // Negative cases (global completion) -//// var p1: MyPoint = /*1*/{ -//// }; -//// -//// var p2: MyPoint = { -//// x1: /*2*/ -//// /*3*/}; -//// -//// var p3: MyPoint = { -//// y1 /*4*/ -//// }; -//// -//// var p4: MyPoint = { -//// x1: /*5*/ /*6*/, -//// }; -////} - -function VerifyGlobalCompletionList() { - verify.completionListItemsCountIsGreaterThan(10); -} - -// Completion on '{' location. -goTo.marker("1"); -VerifyGlobalCompletionList(); - -// Literal member completion after member name with empty member expression and missing colon. -goTo.marker("2"); -VerifyGlobalCompletionList(); - -goTo.marker("3"); -VerifyGlobalCompletionList(); - -goTo.marker("4"); -VerifyGlobalCompletionList(); - -// Literal member completion after member name with empty member expression. -goTo.marker("5"); -VerifyGlobalCompletionList(); - -goTo.marker("6"); +/// + +////module ObjectLiterals { +//// interface MyPoint { +//// x1: number; +//// y1: number; +//// } +//// +//// // Negative cases (global completion) +//// var p1: MyPoint = /*1*/{ +//// }; +//// +//// var p2: MyPoint = { +//// x1: /*2*/ +//// /*3*/}; +//// +//// var p3: MyPoint = { +//// y1 /*4*/ +//// }; +//// +//// var p4: MyPoint = { +//// x1: /*5*/ /*6*/, +//// }; +////} + +function VerifyGlobalCompletionList() { + verify.completionListItemsCountIsGreaterThan(10); +} + +// Completion on '{' location. +goTo.marker("1"); +VerifyGlobalCompletionList(); + +// Literal member completion after member name with empty member expression and missing colon. +goTo.marker("2"); +VerifyGlobalCompletionList(); + +goTo.marker("3"); +VerifyGlobalCompletionList(); + +goTo.marker("4"); +VerifyGlobalCompletionList(); + +// Literal member completion after member name with empty member expression. +goTo.marker("5"); +VerifyGlobalCompletionList(); + +goTo.marker("6"); VerifyGlobalCompletionList(); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionConstructorOverloads.ts b/tests/cases/fourslash/goToDefinitionConstructorOverloads.ts index 0c1248a0422..a1fda8886db 100644 --- a/tests/cases/fourslash/goToDefinitionConstructorOverloads.ts +++ b/tests/cases/fourslash/goToDefinitionConstructorOverloads.ts @@ -1,22 +1,22 @@ -/// - -////class ConstructorOverload { -//// /*constructorOverload1*/constructor(); -//// /*constructorOverload2*/constructor(foo: string); -//// /*constructorDefinition*/constructor(foo: any) { } -////} -//// -////var constructorOverload = new /*constructorOverloadReference1*/ConstructorOverload(); -////var constructorOverload = new /*constructorOverloadReference2*/ConstructorOverload("foo"); - -goTo.marker('constructorOverloadReference1'); -goTo.definition(); -verify.caretAtMarker('constructorDefinition'); - -goTo.marker('constructorOverloadReference2'); -goTo.definition(); -verify.caretAtMarker('constructorDefinition'); - -goTo.marker('constructorOverload1'); -goTo.definition(); -verify.caretAtMarker('constructorDefinition'); +/// + +////class ConstructorOverload { +//// /*constructorOverload1*/constructor(); +//// /*constructorOverload2*/constructor(foo: string); +//// /*constructorDefinition*/constructor(foo: any) { } +////} +//// +////var constructorOverload = new /*constructorOverloadReference1*/ConstructorOverload(); +////var constructorOverload = new /*constructorOverloadReference2*/ConstructorOverload("foo"); + +goTo.marker('constructorOverloadReference1'); +goTo.definition(); +verify.caretAtMarker('constructorDefinition'); + +goTo.marker('constructorOverloadReference2'); +goTo.definition(); +verify.caretAtMarker('constructorDefinition'); + +goTo.marker('constructorOverload1'); +goTo.definition(); +verify.caretAtMarker('constructorDefinition'); diff --git a/tests/cases/fourslash/goToDefinitionDifferentFile.ts b/tests/cases/fourslash/goToDefinitionDifferentFile.ts index 54b799ba65f..3aa31d1556c 100644 --- a/tests/cases/fourslash/goToDefinitionDifferentFile.ts +++ b/tests/cases/fourslash/goToDefinitionDifferentFile.ts @@ -1,29 +1,29 @@ -/// - -// @Filename: goToDefinitionDifferentFile_Definition.ts -////var /*remoteVariableDefinition*/remoteVariable; -/////*remoteFunctionDefinition*/function remoteFunction() { } -/////*remoteClassDefinition*/class remoteClass { } -/////*remoteInterfaceDefinition*/interface remoteInterface{ } -/////*remoteModuleDefinition*/module remoteModule{ export var foo = 1;} - -// @Filename: goToDefinitionDifferentFile_Consumption.ts -/////*remoteVariableReference*/remoteVariable = 1; -/////*remoteFunctionReference*/remoteFunction(); -////var foo = new /*remoteClassReference*/remoteClass(); -////class fooCls implements /*remoteInterfaceReference*/remoteInterface { } -////var fooVar = /*remoteModuleReference*/remoteModule.foo; - -var markerList = [ - "remoteVariable", - "remoteFunction", - "remoteClass", - "remoteInterface", - "remoteModule", -]; - -markerList.forEach((marker) => { - goTo.marker(marker + 'Reference'); - goTo.definition(); - verify.caretAtMarker(marker + 'Definition'); -}); +/// + +// @Filename: goToDefinitionDifferentFile_Definition.ts +////var /*remoteVariableDefinition*/remoteVariable; +/////*remoteFunctionDefinition*/function remoteFunction() { } +/////*remoteClassDefinition*/class remoteClass { } +/////*remoteInterfaceDefinition*/interface remoteInterface{ } +/////*remoteModuleDefinition*/module remoteModule{ export var foo = 1;} + +// @Filename: goToDefinitionDifferentFile_Consumption.ts +/////*remoteVariableReference*/remoteVariable = 1; +/////*remoteFunctionReference*/remoteFunction(); +////var foo = new /*remoteClassReference*/remoteClass(); +////class fooCls implements /*remoteInterfaceReference*/remoteInterface { } +////var fooVar = /*remoteModuleReference*/remoteModule.foo; + +var markerList = [ + "remoteVariable", + "remoteFunction", + "remoteClass", + "remoteInterface", + "remoteModule", +]; + +markerList.forEach((marker) => { + goTo.marker(marker + 'Reference'); + goTo.definition(); + verify.caretAtMarker(marker + 'Definition'); +}); diff --git a/tests/cases/fourslash/goToDefinitionDifferentFileIndirectly.ts b/tests/cases/fourslash/goToDefinitionDifferentFileIndirectly.ts index c0675b29d23..7287fde2d1d 100644 --- a/tests/cases/fourslash/goToDefinitionDifferentFileIndirectly.ts +++ b/tests/cases/fourslash/goToDefinitionDifferentFileIndirectly.ts @@ -1,36 +1,36 @@ -/// - -// @Filename: Remote2.ts -////var /*remoteVariableDefinition*/rem2Var; -/////*remoteFunctionDefinition*/function rem2Fn() { } -/////*remoteClassDefinition*/class rem2Cls { } -/////*remoteInterfaceDefinition*/interface rem2Int{} -/////*remoteModuleDefinition*/module rem2Mod { export var foo; } - -// @Filename: Remote1.ts -////var remVar; -////function remFn() { } -////class remCls { } -////interface remInt{} -////module remMod { export var foo; } - -// @Filename: Definition.ts -/////*remoteVariableReference*/rem2Var = 1; -/////*remoteFunctionReference*/rem2Fn(); -////var rem2foo = new /*remoteClassReference*/rem2Cls(); -////class rem2fooCls implements /*remoteInterfaceReference*/rem2Int { } -////var rem2fooVar = /*remoteModuleReference*/rem2Mod.foo; - -var markerList = [ - "remoteVariable", - "remoteFunction", - "remoteClass", - "remoteInterface", - "remoteModule", -]; - -markerList.forEach((marker) => { - goTo.marker(marker + 'Reference'); - goTo.definition(); - verify.caretAtMarker(marker + 'Definition'); +/// + +// @Filename: Remote2.ts +////var /*remoteVariableDefinition*/rem2Var; +/////*remoteFunctionDefinition*/function rem2Fn() { } +/////*remoteClassDefinition*/class rem2Cls { } +/////*remoteInterfaceDefinition*/interface rem2Int{} +/////*remoteModuleDefinition*/module rem2Mod { export var foo; } + +// @Filename: Remote1.ts +////var remVar; +////function remFn() { } +////class remCls { } +////interface remInt{} +////module remMod { export var foo; } + +// @Filename: Definition.ts +/////*remoteVariableReference*/rem2Var = 1; +/////*remoteFunctionReference*/rem2Fn(); +////var rem2foo = new /*remoteClassReference*/rem2Cls(); +////class rem2fooCls implements /*remoteInterfaceReference*/rem2Int { } +////var rem2fooVar = /*remoteModuleReference*/rem2Mod.foo; + +var markerList = [ + "remoteVariable", + "remoteFunction", + "remoteClass", + "remoteInterface", + "remoteModule", +]; + +markerList.forEach((marker) => { + goTo.marker(marker + 'Reference'); + goTo.definition(); + verify.caretAtMarker(marker + 'Definition'); }); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionExternamModuleName.ts b/tests/cases/fourslash/goToDefinitionExternamModuleName.ts index 531e4562843..f403965fe12 100644 --- a/tests/cases/fourslash/goToDefinitionExternamModuleName.ts +++ b/tests/cases/fourslash/goToDefinitionExternamModuleName.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/goToDefinitionExternamModuleName2.ts b/tests/cases/fourslash/goToDefinitionExternamModuleName2.ts index 3ef9c2555ef..df7b3310394 100644 --- a/tests/cases/fourslash/goToDefinitionExternamModuleName2.ts +++ b/tests/cases/fourslash/goToDefinitionExternamModuleName2.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/goToDefinitionExternamModuleName3.ts b/tests/cases/fourslash/goToDefinitionExternamModuleName3.ts index ace3851e5bc..cd31f027895 100644 --- a/tests/cases/fourslash/goToDefinitionExternamModuleName3.ts +++ b/tests/cases/fourslash/goToDefinitionExternamModuleName3.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('e/*1*/'); diff --git a/tests/cases/fourslash/goToDefinitionInterfaceAfterImplement.ts b/tests/cases/fourslash/goToDefinitionInterfaceAfterImplement.ts index 8867b674014..e6a763a98f1 100644 --- a/tests/cases/fourslash/goToDefinitionInterfaceAfterImplement.ts +++ b/tests/cases/fourslash/goToDefinitionInterfaceAfterImplement.ts @@ -1,16 +1,16 @@ -/// - -/////*interfaceDefinition*/interface sInt { -//// sVar: number; -//// sFn: () => void; -////} -//// -////class iClass implements /*interfaceReference*/sInt { -//// public sVar = 1; -//// public sFn() { -//// } -////} - -goTo.marker('interfaceReference'); -goTo.definition(); +/// + +/////*interfaceDefinition*/interface sInt { +//// sVar: number; +//// sFn: () => void; +////} +//// +////class iClass implements /*interfaceReference*/sInt { +//// public sVar = 1; +//// public sFn() { +//// } +////} + +goTo.marker('interfaceReference'); +goTo.definition(); verify.caretAtMarker('interfaceDefinition'); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionShadowVariableInsideModule.ts b/tests/cases/fourslash/goToDefinitionShadowVariableInsideModule.ts index dd073ccb6c4..92f2761b61a 100644 --- a/tests/cases/fourslash/goToDefinitionShadowVariableInsideModule.ts +++ b/tests/cases/fourslash/goToDefinitionShadowVariableInsideModule.ts @@ -1,10 +1,10 @@ -/// - -////module shdModule { -//// var /*shadowVariableDefinition*/shdVar; -//// /*shadowVariableReference*/shdVar = 1; -////} - -goTo.marker('shadowVariableReference'); -goTo.definition(); +/// + +////module shdModule { +//// var /*shadowVariableDefinition*/shdVar; +//// /*shadowVariableReference*/shdVar = 1; +////} + +goTo.marker('shadowVariableReference'); +goTo.definition(); verify.caretAtMarker('shadowVariableDefinition'); \ No newline at end of file diff --git a/tests/cases/fourslash/goToDefinitionShorthandProperty.ts b/tests/cases/fourslash/goToDefinitionShorthandProperty.ts index 07ea82c03e1..5e906893719 100644 --- a/tests/cases/fourslash/goToDefinitionShorthandProperty.ts +++ b/tests/cases/fourslash/goToDefinitionShorthandProperty.ts @@ -1,4 +1,4 @@ -/// +/// //// var /*valueDeclaration1*/name = "hello"; //// var /*valueDeclaration2*/id = 100000; diff --git a/tests/cases/fourslash/goToDefinitionSourceUnit.ts b/tests/cases/fourslash/goToDefinitionSourceUnit.ts index 5a310d3ffc8..09900ff41be 100644 --- a/tests/cases/fourslash/goToDefinitionSourceUnit.ts +++ b/tests/cases/fourslash/goToDefinitionSourceUnit.ts @@ -1,24 +1,24 @@ -/// - -// @Filename: a.ts -//// //MyFile Comments -//// //more comments -//// /// -//// /// -//// -//// class clsInOverload { -//// static fnOverload(); -//// static fnOverload(foo: string); -//// static fnOverload(foo: any) { } -//// } -//// - -// @Filename: b.ts -/////*fileB*/ - -goTo.marker("unknownFile"); -verify.not.definitionLocationExists(); - -goTo.marker("knownFile"); -goTo.definition(); -verify.caretAtMarker('fileB'); +/// + +// @Filename: a.ts +//// //MyFile Comments +//// //more comments +//// /// +//// /// +//// +//// class clsInOverload { +//// static fnOverload(); +//// static fnOverload(foo: string); +//// static fnOverload(foo: any) { } +//// } +//// + +// @Filename: b.ts +/////*fileB*/ + +goTo.marker("unknownFile"); +verify.not.definitionLocationExists(); + +goTo.marker("knownFile"); +goTo.definition(); +verify.caretAtMarker('fileB'); diff --git a/tests/cases/fourslash/importDeclPaste0.ts b/tests/cases/fourslash/importDeclPaste0.ts index 6bb8eb6894e..f86920cdfde 100644 --- a/tests/cases/fourslash/importDeclPaste0.ts +++ b/tests/cases/fourslash/importDeclPaste0.ts @@ -1,18 +1,18 @@ -/// - -//// // @Filename: exportEqualsInterface_A.ts -//// interface A { -//// p1: number; -//// } -//// -//// export = A; -//// /*1*/ -//// var i: I1; -//// -//// var n: number = i.p1; - -edit.disableFormatting(); - -goTo.marker('1'); - -//edit.insert("\nimport I1 = module(\"exportEqualsInterface_A\");\n"); +/// + +//// // @Filename: exportEqualsInterface_A.ts +//// interface A { +//// p1: number; +//// } +//// +//// export = A; +//// /*1*/ +//// var i: I1; +//// +//// var n: number = i.p1; + +edit.disableFormatting(); + +goTo.marker('1'); + +//edit.insert("\nimport I1 = module(\"exportEqualsInterface_A\");\n"); diff --git a/tests/cases/fourslash/importValueUsedAsType.ts b/tests/cases/fourslash/importValueUsedAsType.ts index e2b881eb9bf..f3e5fb54860 100644 --- a/tests/cases/fourslash/importValueUsedAsType.ts +++ b/tests/cases/fourslash/importValueUsedAsType.ts @@ -1,12 +1,12 @@ -/// - -//// /**/ -//// module A { -//// export var X; -//// import Z = A.X; -//// var v: Z; -//// } - -goTo.marker(); -// Used to crash here -edit.insert(' '); +/// + +//// /**/ +//// module A { +//// export var X; +//// import Z = A.X; +//// var v: Z; +//// } + +goTo.marker(); +// Used to crash here +edit.insert(' '); diff --git a/tests/cases/fourslash/incrementalUpdateToClassImplementingGenericClass.ts b/tests/cases/fourslash/incrementalUpdateToClassImplementingGenericClass.ts index 8bb6cf489d6..f8dcc0a1f39 100644 --- a/tests/cases/fourslash/incrementalUpdateToClassImplementingGenericClass.ts +++ b/tests/cases/fourslash/incrementalUpdateToClassImplementingGenericClass.ts @@ -12,7 +12,7 @@ //// /*1*/get name2() { return this.name; } ////} ////var a = new Animal2('eprst'); - + goTo.marker('1'); diff --git a/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts b/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts index 4247b0e5e47..3b686285b99 100644 --- a/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts +++ b/tests/cases/fourslash/indentionsOfCommentBlockAfterFormatting.ts @@ -1,43 +1,43 @@ -/// - -////// This is a test case of formatting. -////class TestClass { -////private foo: string; -////public bar: string; -////constructor(foo: string, bar: string) { -////this.foo = foo; -////this.bar = bar; -////} -/////** /*1*/ -////* This document is to be formatted./*2*/ -////* /*3*/ -////* After formatting, each line of this comment block should have indent consistent with the method./*4*/ -////* -//// */ -/////*5*/public testMethod() { -////} -////} -////var cookieMonster: TestClass; -////cookieMonster = new TestClass("FOO", "BAR"); - - -format.document(); -goTo.marker("1"); -verify.indentationIs(4); -goTo.marker("2"); -verify.indentationIs(4); -goTo.marker("3"); -verify.indentationIs(4); -goTo.marker("4"); -verify.indentationIs(4); -// Putting a marker in line "*" would bring some error when parsing code in automation. -// So move right by 1 offset from marker 4 to locate the caret in this line. -edit.moveRight(1); -verify.indentationIs(4); -// Putting a marker in line " */" would bring some error when parsing code in automation. -// So move left by 1 offset from marker 5 to locate the caret in this line. -goTo.marker("5"); -edit.moveLeft(1); -verify.indentationIs(4); -goTo.marker("5"); +/// + +////// This is a test case of formatting. +////class TestClass { +////private foo: string; +////public bar: string; +////constructor(foo: string, bar: string) { +////this.foo = foo; +////this.bar = bar; +////} +/////** /*1*/ +////* This document is to be formatted./*2*/ +////* /*3*/ +////* After formatting, each line of this comment block should have indent consistent with the method./*4*/ +////* +//// */ +/////*5*/public testMethod() { +////} +////} +////var cookieMonster: TestClass; +////cookieMonster = new TestClass("FOO", "BAR"); + + +format.document(); +goTo.marker("1"); +verify.indentationIs(4); +goTo.marker("2"); +verify.indentationIs(4); +goTo.marker("3"); +verify.indentationIs(4); +goTo.marker("4"); +verify.indentationIs(4); +// Putting a marker in line "*" would bring some error when parsing code in automation. +// So move right by 1 offset from marker 4 to locate the caret in this line. +edit.moveRight(1); +verify.indentationIs(4); +// Putting a marker in line " */" would bring some error when parsing code in automation. +// So move left by 1 offset from marker 5 to locate the caret in this line. +goTo.marker("5"); +edit.moveLeft(1); +verify.indentationIs(4); +goTo.marker("5"); verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/indexSignatureWithoutAnnotation.ts b/tests/cases/fourslash/indexSignatureWithoutAnnotation.ts index bc7449ece7c..af5fe9010fc 100644 --- a/tests/cases/fourslash/indexSignatureWithoutAnnotation.ts +++ b/tests/cases/fourslash/indexSignatureWithoutAnnotation.ts @@ -1,5 +1,5 @@ -/// - +/// + //// interface B { //// 1: any; //// } @@ -8,6 +8,6 @@ //// } //// interface D extends B, C /**/ { //// } - -goTo.marker(); -edit.insert(" "); + +goTo.marker(); +edit.insert(" "); diff --git a/tests/cases/fourslash/insertArgumentBeforeOverloadedConstructor.ts b/tests/cases/fourslash/insertArgumentBeforeOverloadedConstructor.ts index 659a3fb0354..7c8b9571c45 100644 --- a/tests/cases/fourslash/insertArgumentBeforeOverloadedConstructor.ts +++ b/tests/cases/fourslash/insertArgumentBeforeOverloadedConstructor.ts @@ -1,11 +1,11 @@ -/// - -//// alert(/**/100); -//// -//// class OverloadedMonster { -//// constructor(); -//// constructor(name) { } -//// } - -goTo.marker(); -edit.insert("'1', "); +/// + +//// alert(/**/100); +//// +//// class OverloadedMonster { +//// constructor(); +//// constructor(name) { } +//// } + +goTo.marker(); +edit.insert("'1', "); diff --git a/tests/cases/fourslash/insertInterfaceAndCheckTypeLiteralField.ts b/tests/cases/fourslash/insertInterfaceAndCheckTypeLiteralField.ts index 0cb5db908e2..d941421b129 100644 --- a/tests/cases/fourslash/insertInterfaceAndCheckTypeLiteralField.ts +++ b/tests/cases/fourslash/insertInterfaceAndCheckTypeLiteralField.ts @@ -1,11 +1,11 @@ -/// - -//// /*addC*/ -//// interface G { } -//// var v2: G<{ a: /*checkParam*/C }, C>; - -goTo.marker('addC'); -edit.insert('interface C { }'); - -goTo.marker('checkParam'); -verify.quickInfoExists(); +/// + +//// /*addC*/ +//// interface G { } +//// var v2: G<{ a: /*checkParam*/C }, C>; + +goTo.marker('addC'); +edit.insert('interface C { }'); + +goTo.marker('checkParam'); +verify.quickInfoExists(); diff --git a/tests/cases/fourslash/insertMethodCallAboveOthers.ts b/tests/cases/fourslash/insertMethodCallAboveOthers.ts index 4f7e1cf0e6c..5b8fe45d94f 100644 --- a/tests/cases/fourslash/insertMethodCallAboveOthers.ts +++ b/tests/cases/fourslash/insertMethodCallAboveOthers.ts @@ -1,8 +1,8 @@ -/// - -//// /**/ -//// paired.reduce(); -//// paired.map(() => undefined); - -goTo.marker(); -edit.insert("paired.reduce();"); +/// + +//// /**/ +//// paired.reduce(); +//// paired.map(() => undefined); + +goTo.marker(); +edit.insert("paired.reduce();"); diff --git a/tests/cases/fourslash/insertPublicBeforeSetter.ts b/tests/cases/fourslash/insertPublicBeforeSetter.ts index ca83d3ce054..1fb0b40e019 100644 --- a/tests/cases/fourslash/insertPublicBeforeSetter.ts +++ b/tests/cases/fourslash/insertPublicBeforeSetter.ts @@ -1,9 +1,9 @@ -/// - -//// class C { -//// /**/set Bar(bar:string) {} -//// } -//// var o2 = { set Foo(val:number) { } }; - -goTo.marker(); -edit.insert("public "); +/// + +//// class C { +//// /**/set Bar(bar:string) {} +//// } +//// var o2 = { set Foo(val:number) { } }; + +goTo.marker(); +edit.insert("public "); diff --git a/tests/cases/fourslash/insertSecondTryCatchBlock.ts b/tests/cases/fourslash/insertSecondTryCatchBlock.ts index 1d6f1963ad9..89bf0f0267e 100644 --- a/tests/cases/fourslash/insertSecondTryCatchBlock.ts +++ b/tests/cases/fourslash/insertSecondTryCatchBlock.ts @@ -1,7 +1,7 @@ -/// - -//// try {} catch(e) { } -//// /**/ - -goTo.marker(); -edit.insert('try {} catch(e) { }'); +/// + +//// try {} catch(e) { } +//// /**/ + +goTo.marker(); +edit.insert('try {} catch(e) { }'); diff --git a/tests/cases/fourslash/localGetReferences.ts b/tests/cases/fourslash/localGetReferences.ts index b390f9bef8b..6d5f541dd51 100644 --- a/tests/cases/fourslash/localGetReferences.ts +++ b/tests/cases/fourslash/localGetReferences.ts @@ -1,238 +1,238 @@ -/// - -// @Filename: localGetReferences_1.ts -////// Comment Refence Test: g/*1*/lobalVar -////var g/*3*/lobalVar: n/*2*/umber = 2; -//// -////class fooCls { -//// static clsS/*5*/Var = 1; -//// //Declare -//// cls/*4*/Var = 1; -//// -//// constructor (public clsParam: number) { -//// //Increments -//// globalVar++; -//// this.clsVar++; -//// fooCls.clsSVar++; -//// this.cls/*7*/Param++; -//// modTest.modVar++; -//// } -////} -//// -////function foo(/*8*/x: number) { -//// //Declare -//// var fn/*6*/Var = 1; -//// -//// //Increments -//// fooCls.clsSVar++; -//// globalVar++; -//// modTest.modVar++; -//// fnVar++; -//// -//// //Return -//// return x++; -////} -//// -////module modTest { -//// //Declare -//// export var modVar:number; -//// -//// //Increments -//// globalVar++; -//// fooCls.clsSVar++; -//// modVar++; -//// -//// class testCls { -//// static boo = foo; -//// } -//// -//// function testFn(){ -//// static boo = foo; -//// -//// //Increments -//// globalVar++; -//// fooCls.clsSVar++; -//// modVar++; -//// } -//// -//// module testMod { -//// var boo = foo; -//// } -////} -//// -//////Type test -////var clsTest: fooCls; -//// -//////Arguments -////clsTest = new fooCls(globalV/*10*/ar); -////foo(glo/*9*/balVar); -//// -//////Increments -////fooCls.clsSVar++; -////modTest.modVar++; -////globalVar = globalVar + globalVar; -//// -//////ETC - Other cases -////globalVar = 3; -/////*11*/foo = foo + 1; -/////*12*/err = err++; -/////*13*/ -//////Shadowed fn Parameter -////function shdw(globa/*14*/lVar: number) { -//// //Increments -//// globalVar++; -//// return globalVar; -////} -//// -//////Remotes -//////Type test -////var remoteclsTest: remotefooCls; -//// -//////Arguments -////remoteclsTest = new remotefooCls(remoteglobalVar); -////remotefoo(remoteglobalVar); -//// -//////Increments -////remotefooCls.remoteclsSVar++; -////remotemodTest.remotemodVar++; -////remoteglobalVar = remoteglobalVar + remoteglobalVar; -//// -//////ETC - Other cases -////remoteglobalVar = 3; -//// -//////Find References misses method param -////var -//// -//// -//// -//// array = ["f", "o", "o"]; -//// -////array.forEach( -//// -//// -////function(str) { -//// -//// -//// -//// return /*15*/str + " "; -//// -////}); - -// @Filename: localGetReferences_2.ts -////var remoteglobalVar: number = 2; -//// -////class remotefooCls { -//// //Declare -//// remoteclsVar = 1; -//// static remoteclsSVar = 1; -//// -//// constructor(public remoteclsParam: number) { -//// //Increments -//// remoteglobalVar++; -//// this.remoteclsVar++; -//// remotefooCls.remoteclsSVar++; -//// this.remoteclsParam++; -//// remotemodTest.remotemodVar++; -//// } -////} -//// -////function remotefoo(remotex: number) { -//// //Declare -//// var remotefnVar = 1; -//// -//// //Increments -//// remotefooCls.remoteclsSVar++; -//// remoteglobalVar++; -//// remotemodTest.remotemodVar++; -//// remotefnVar++; -//// -//// //Return -//// return remotex++; -////} -//// -////module remotemodTest { -//// //Declare -//// export var remotemodVar: number; -//// -//// //Increments -//// remoteglobalVar++; -//// remotefooCls.remoteclsSVar++; -//// remotemodVar++; -//// -//// class remotetestCls { -//// static remoteboo = remotefoo; -//// } -//// -//// function remotetestFn(){ -//// static remoteboo = remotefoo; -//// -//// //Increments -//// remoteglobalVar++; -//// remotefooCls.remoteclsSVar++; -//// remotemodVar++; -//// } -//// -//// module remotetestMod { -//// var remoteboo = remotefoo; -//// } -////} - -// References to comment. -goTo.marker("1"); -verify.referencesCountIs(0); - -// References to type. -goTo.marker("2"); -verify.referencesCountIs(0); - -// References to a variable declared in global. -goTo.marker("3"); -verify.referencesCountIs(11); - -// References to a variable declared in a class. -goTo.marker("4"); -verify.referencesCountIs(2); - -// References to static variable declared in a class. -goTo.marker("5"); -verify.referencesCountIs(6); - -// References to a variable declared in a function. -goTo.marker("6"); -verify.referencesCountIs(2); - -// References to a class parameter. -goTo.marker("7"); -verify.referencesCountIs(2); - -// References to a function parameter. -goTo.marker("8"); -verify.referencesCountIs(2); - -// References to a function argument. -goTo.marker("9"); -verify.referencesCountIs(11); - -// References to a class argument. -goTo.marker("10"); -verify.referencesCountIs(11); - -// References to illegal assignment. -goTo.marker("11"); -verify.referencesCountIs(7); - -// References to unresolved symbol. -goTo.marker("12"); -verify.referencesCountIs(1); - -// References to no context. -goTo.marker("13"); -verify.referencesCountIs(0); - -// References to shadowed function parameter. -goTo.marker("14"); -verify.referencesCountIs(3); - -// Reference misses function parameter. -goTo.marker("15"); +/// + +// @Filename: localGetReferences_1.ts +////// Comment Refence Test: g/*1*/lobalVar +////var g/*3*/lobalVar: n/*2*/umber = 2; +//// +////class fooCls { +//// static clsS/*5*/Var = 1; +//// //Declare +//// cls/*4*/Var = 1; +//// +//// constructor (public clsParam: number) { +//// //Increments +//// globalVar++; +//// this.clsVar++; +//// fooCls.clsSVar++; +//// this.cls/*7*/Param++; +//// modTest.modVar++; +//// } +////} +//// +////function foo(/*8*/x: number) { +//// //Declare +//// var fn/*6*/Var = 1; +//// +//// //Increments +//// fooCls.clsSVar++; +//// globalVar++; +//// modTest.modVar++; +//// fnVar++; +//// +//// //Return +//// return x++; +////} +//// +////module modTest { +//// //Declare +//// export var modVar:number; +//// +//// //Increments +//// globalVar++; +//// fooCls.clsSVar++; +//// modVar++; +//// +//// class testCls { +//// static boo = foo; +//// } +//// +//// function testFn(){ +//// static boo = foo; +//// +//// //Increments +//// globalVar++; +//// fooCls.clsSVar++; +//// modVar++; +//// } +//// +//// module testMod { +//// var boo = foo; +//// } +////} +//// +//////Type test +////var clsTest: fooCls; +//// +//////Arguments +////clsTest = new fooCls(globalV/*10*/ar); +////foo(glo/*9*/balVar); +//// +//////Increments +////fooCls.clsSVar++; +////modTest.modVar++; +////globalVar = globalVar + globalVar; +//// +//////ETC - Other cases +////globalVar = 3; +/////*11*/foo = foo + 1; +/////*12*/err = err++; +/////*13*/ +//////Shadowed fn Parameter +////function shdw(globa/*14*/lVar: number) { +//// //Increments +//// globalVar++; +//// return globalVar; +////} +//// +//////Remotes +//////Type test +////var remoteclsTest: remotefooCls; +//// +//////Arguments +////remoteclsTest = new remotefooCls(remoteglobalVar); +////remotefoo(remoteglobalVar); +//// +//////Increments +////remotefooCls.remoteclsSVar++; +////remotemodTest.remotemodVar++; +////remoteglobalVar = remoteglobalVar + remoteglobalVar; +//// +//////ETC - Other cases +////remoteglobalVar = 3; +//// +//////Find References misses method param +////var +//// +//// +//// +//// array = ["f", "o", "o"]; +//// +////array.forEach( +//// +//// +////function(str) { +//// +//// +//// +//// return /*15*/str + " "; +//// +////}); + +// @Filename: localGetReferences_2.ts +////var remoteglobalVar: number = 2; +//// +////class remotefooCls { +//// //Declare +//// remoteclsVar = 1; +//// static remoteclsSVar = 1; +//// +//// constructor(public remoteclsParam: number) { +//// //Increments +//// remoteglobalVar++; +//// this.remoteclsVar++; +//// remotefooCls.remoteclsSVar++; +//// this.remoteclsParam++; +//// remotemodTest.remotemodVar++; +//// } +////} +//// +////function remotefoo(remotex: number) { +//// //Declare +//// var remotefnVar = 1; +//// +//// //Increments +//// remotefooCls.remoteclsSVar++; +//// remoteglobalVar++; +//// remotemodTest.remotemodVar++; +//// remotefnVar++; +//// +//// //Return +//// return remotex++; +////} +//// +////module remotemodTest { +//// //Declare +//// export var remotemodVar: number; +//// +//// //Increments +//// remoteglobalVar++; +//// remotefooCls.remoteclsSVar++; +//// remotemodVar++; +//// +//// class remotetestCls { +//// static remoteboo = remotefoo; +//// } +//// +//// function remotetestFn(){ +//// static remoteboo = remotefoo; +//// +//// //Increments +//// remoteglobalVar++; +//// remotefooCls.remoteclsSVar++; +//// remotemodVar++; +//// } +//// +//// module remotetestMod { +//// var remoteboo = remotefoo; +//// } +////} + +// References to comment. +goTo.marker("1"); +verify.referencesCountIs(0); + +// References to type. +goTo.marker("2"); +verify.referencesCountIs(0); + +// References to a variable declared in global. +goTo.marker("3"); +verify.referencesCountIs(11); + +// References to a variable declared in a class. +goTo.marker("4"); +verify.referencesCountIs(2); + +// References to static variable declared in a class. +goTo.marker("5"); +verify.referencesCountIs(6); + +// References to a variable declared in a function. +goTo.marker("6"); +verify.referencesCountIs(2); + +// References to a class parameter. +goTo.marker("7"); +verify.referencesCountIs(2); + +// References to a function parameter. +goTo.marker("8"); +verify.referencesCountIs(2); + +// References to a function argument. +goTo.marker("9"); +verify.referencesCountIs(11); + +// References to a class argument. +goTo.marker("10"); +verify.referencesCountIs(11); + +// References to illegal assignment. +goTo.marker("11"); +verify.referencesCountIs(7); + +// References to unresolved symbol. +goTo.marker("12"); +verify.referencesCountIs(1); + +// References to no context. +goTo.marker("13"); +verify.referencesCountIs(0); + +// References to shadowed function parameter. +goTo.marker("14"); +verify.referencesCountIs(3); + +// Reference misses function parameter. +goTo.marker("15"); verify.referencesCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash/malformedObjectLiteral.ts b/tests/cases/fourslash/malformedObjectLiteral.ts index dd0690c4ca7..85d1a956188 100644 --- a/tests/cases/fourslash/malformedObjectLiteral.ts +++ b/tests/cases/fourslash/malformedObjectLiteral.ts @@ -1,10 +1,10 @@ -/// - -////var tt = { aa };/**/ -////var y = /*1*/"unclosed string literal -/////*2*/var x = "closed string literal" -verify.errorExistsBeforeMarker(); -verify.errorExistsAfterMarker("1"); -verify.not.errorExistsAfterMarker("2"); - - +/// + +////var tt = { aa };/**/ +////var y = /*1*/"unclosed string literal +/////*2*/var x = "closed string literal" +verify.errorExistsBeforeMarker(); +verify.errorExistsAfterMarker("1"); +verify.not.errorExistsAfterMarker("2"); + + diff --git a/tests/cases/fourslash/memberCompletionFromFunctionCall.ts b/tests/cases/fourslash/memberCompletionFromFunctionCall.ts index a60a2d37b2f..56629a3b510 100644 --- a/tests/cases/fourslash/memberCompletionFromFunctionCall.ts +++ b/tests/cases/fourslash/memberCompletionFromFunctionCall.ts @@ -1,12 +1,12 @@ -/// - -////declare interface ifoo { -//// text: (value: any) => ifoo; -////} -////declare var foo: ifoo; -////foo.text(function() { })/**/ - -goTo.marker(); -edit.insert("."); -verify.not.memberListIsEmpty(); +/// + +////declare interface ifoo { +//// text: (value: any) => ifoo; +////} +////declare var foo: ifoo; +////foo.text(function() { })/**/ + +goTo.marker(); +edit.insert("."); +verify.not.memberListIsEmpty(); verify.memberListContains("text"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberConstructorEdits.ts b/tests/cases/fourslash/memberConstructorEdits.ts index 2bc2018cd89..45d631cd2b8 100644 --- a/tests/cases/fourslash/memberConstructorEdits.ts +++ b/tests/cases/fourslash/memberConstructorEdits.ts @@ -1,26 +1,26 @@ -/// - -//// module M { -//// export class A { -//// constructor(a: string) {} -//// public m(n: number) { -//// return 0; -//// } -//// public n() { -//// return this.m(0); -//// } -//// } -//// export class B extends A { -//// constructor(a: string) { -//// super(a); -//// } -//// /*1*/ -//// } -//// var a = new A("s"); -//// var b = new B("s"); -//// } - -verify.numberOfErrorsInCurrentFile(0); -goTo.marker('1'); -edit.insert("public m(n: number) { return 0; }"); +/// + +//// module M { +//// export class A { +//// constructor(a: string) {} +//// public m(n: number) { +//// return 0; +//// } +//// public n() { +//// return this.m(0); +//// } +//// } +//// export class B extends A { +//// constructor(a: string) { +//// super(a); +//// } +//// /*1*/ +//// } +//// var a = new A("s"); +//// var b = new B("s"); +//// } + +verify.numberOfErrorsInCurrentFile(0); +goTo.marker('1'); +edit.insert("public m(n: number) { return 0; }"); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListAfterSingleDot.ts b/tests/cases/fourslash/memberListAfterSingleDot.ts index e6e5d8ad0e8..0bc5107f2c1 100644 --- a/tests/cases/fourslash/memberListAfterSingleDot.ts +++ b/tests/cases/fourslash/memberListAfterSingleDot.ts @@ -1,6 +1,6 @@ -/// - -////./**/ - -goTo.marker(); +/// + +////./**/ + +goTo.marker(); verify.not.memberListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListErrorRecovery.ts b/tests/cases/fourslash/memberListErrorRecovery.ts index d1957ba3e4a..74bd25464f6 100644 --- a/tests/cases/fourslash/memberListErrorRecovery.ts +++ b/tests/cases/fourslash/memberListErrorRecovery.ts @@ -1,10 +1,10 @@ -/// - -////class Foo { static fun() { }; } -//// -////Foo./**/; -/////*1*/var bar; - -goTo.marker(); -verify.memberListContains("fun"); +/// + +////class Foo { static fun() { }; } +//// +////Foo./**/; +/////*1*/var bar; + +goTo.marker(); +verify.memberListContains("fun"); verify.not.errorExistsAfterMarker("1"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListInsideObjectLiterals.ts b/tests/cases/fourslash/memberListInsideObjectLiterals.ts index 6da0ac5b562..99d62cbc6e5 100644 --- a/tests/cases/fourslash/memberListInsideObjectLiterals.ts +++ b/tests/cases/fourslash/memberListInsideObjectLiterals.ts @@ -1,41 +1,41 @@ -/// - -////module ObjectLiterals { -//// interface MyPoint { -//// x1: number; -//// y1: number; -//// } -//// -//// var p1: MyPoint = { -//// /*1*/ -//// }; -//// -//// var p2: MyPoint = { -//// x1: 5, -//// /*2*/ -//// }; -//// -//// var p3: MyPoint = { -//// x1/*3*/: -//// }; -//// -//// var p4: MyPoint = { -//// /*4*/y1 -//// }; -////} - -// Literal member completion inside empty literal. -goTo.marker("1"); -verify.memberListContains("x1", "(property) MyPoint.x1: number"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); - -// Literal member completion for 2nd member name. -goTo.marker("2"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); - -// Literal member completion at existing member name location. -goTo.marker("3"); -verify.memberListContains("y1", "(property) MyPoint.y1: number"); - -goTo.marker("4"); +/// + +////module ObjectLiterals { +//// interface MyPoint { +//// x1: number; +//// y1: number; +//// } +//// +//// var p1: MyPoint = { +//// /*1*/ +//// }; +//// +//// var p2: MyPoint = { +//// x1: 5, +//// /*2*/ +//// }; +//// +//// var p3: MyPoint = { +//// x1/*3*/: +//// }; +//// +//// var p4: MyPoint = { +//// /*4*/y1 +//// }; +////} + +// Literal member completion inside empty literal. +goTo.marker("1"); +verify.memberListContains("x1", "(property) MyPoint.x1: number"); +verify.memberListContains("y1", "(property) MyPoint.y1: number"); + +// Literal member completion for 2nd member name. +goTo.marker("2"); +verify.memberListContains("y1", "(property) MyPoint.y1: number"); + +// Literal member completion at existing member name location. +goTo.marker("3"); +verify.memberListContains("y1", "(property) MyPoint.y1: number"); + +goTo.marker("4"); verify.memberListContains("x1", "(property) MyPoint.x1: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfClass.ts b/tests/cases/fourslash/memberListOfClass.ts index c12e781a852..6c93a0536d9 100644 --- a/tests/cases/fourslash/memberListOfClass.ts +++ b/tests/cases/fourslash/memberListOfClass.ts @@ -1,15 +1,15 @@ -/// - -////class C1 { -//// public pubMeth() { } -//// private privMeth() { } -//// public pubProp = 0; -//// private privProp = 0; -////} -////var f = new C1(); -////f./**/ - -goTo.marker(); -verify.memberListCount(2); -verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); +/// + +////class C1 { +//// public pubMeth() { } +//// private privMeth() { } +//// public pubProp = 0; +//// private privProp = 0; +////} +////var f = new C1(); +////f./**/ + +goTo.marker(); +verify.memberListCount(2); +verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); verify.memberListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfEnumInModule.ts b/tests/cases/fourslash/memberListOfEnumInModule.ts index 09db5d24617..f92c5d43ea8 100644 --- a/tests/cases/fourslash/memberListOfEnumInModule.ts +++ b/tests/cases/fourslash/memberListOfEnumInModule.ts @@ -1,13 +1,13 @@ -/// - -////module Fixes { -//// enum Foo { -//// bar, -//// baz -//// } -//// var f: Foo = Foo./**/; -////} - -goTo.marker(); -verify.memberListContains("bar"); +/// + +////module Fixes { +//// enum Foo { +//// bar, +//// baz +//// } +//// var f: Foo = Foo./**/; +////} + +goTo.marker(); +verify.memberListContains("bar"); verify.memberListContains("baz"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfExportedClass.ts b/tests/cases/fourslash/memberListOfExportedClass.ts index eaebab14f27..f6632bfe7b0 100644 --- a/tests/cases/fourslash/memberListOfExportedClass.ts +++ b/tests/cases/fourslash/memberListOfExportedClass.ts @@ -1,15 +1,15 @@ -/// - -////module M { -//// export class C { public pub = 0; private priv = 1; } -//// export var V = 0; -////} -//// -//// -////var c = new M.C(); -//// -////c./**/ // test on c. - -goTo.marker(); -verify.memberListCount(1); +/// + +////module M { +//// export class C { public pub = 0; private priv = 1; } +//// export var V = 0; +////} +//// +//// +////var c = new M.C(); +//// +////c./**/ // test on c. + +goTo.marker(); +verify.memberListCount(1); verify.memberListContains('pub', '(property) M.C.pub: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModule.ts b/tests/cases/fourslash/memberListOfModule.ts index be6066043d1..f09dfd67dbd 100644 --- a/tests/cases/fourslash/memberListOfModule.ts +++ b/tests/cases/fourslash/memberListOfModule.ts @@ -1,19 +1,19 @@ -/// - -////module Foo { -//// export class Bar { -//// -//// } -//// -//// -//// export module Blah { -//// -//// } -////} -//// -////var x: Foo./**/ - -goTo.marker(); -verify.memberListCount(2); -verify.memberListContains('Bar'); +/// + +////module Foo { +//// export class Bar { +//// +//// } +//// +//// +//// export module Blah { +//// +//// } +////} +//// +////var x: Foo./**/ + +goTo.marker(); +verify.memberListCount(2); +verify.memberListContains('Bar'); verify.memberListContains('Blah'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModuleAfterInvalidCharater.ts b/tests/cases/fourslash/memberListOfModuleAfterInvalidCharater.ts index a571c519c0f..b5bd4fb6bb5 100644 --- a/tests/cases/fourslash/memberListOfModuleAfterInvalidCharater.ts +++ b/tests/cases/fourslash/memberListOfModuleAfterInvalidCharater.ts @@ -1,10 +1,10 @@ -/// - -////module testModule { -//// export var foo = 1; -////} -////@ -////testModule./**/ - -goTo.marker(); +/// + +////module testModule { +//// export var foo = 1; +////} +////@ +////testModule./**/ + +goTo.marker(); verify.completionListContains('foo', '(var) testModule.foo: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModuleBeforeKeyword.ts b/tests/cases/fourslash/memberListOfModuleBeforeKeyword.ts index 33f085cde03..0ea07e87a0a 100644 --- a/tests/cases/fourslash/memberListOfModuleBeforeKeyword.ts +++ b/tests/cases/fourslash/memberListOfModuleBeforeKeyword.ts @@ -1,24 +1,24 @@ -/// - -////module TypeModule1 { -//// export class C1 { } -//// export class C2 { } -////} -////var x: TypeModule1./*namedType*/ -////module TypeModule2 { -//// export class Test3 {} -////} -//// -////TypeModule1./*dotedExpression*/ -////module TypeModule3 { -//// export class Test3 {} -////} - -// Verify the memberlist of module when the following line has a keyword -goTo.marker('namedType'); -verify.completionListContains('C1'); -verify.completionListContains('C2'); - -goTo.marker('dotedExpression'); -verify.completionListContains('C1'); +/// + +////module TypeModule1 { +//// export class C1 { } +//// export class C2 { } +////} +////var x: TypeModule1./*namedType*/ +////module TypeModule2 { +//// export class Test3 {} +////} +//// +////TypeModule1./*dotedExpression*/ +////module TypeModule3 { +//// export class Test3 {} +////} + +// Verify the memberlist of module when the following line has a keyword +goTo.marker('namedType'); +verify.completionListContains('C1'); +verify.completionListContains('C2'); + +goTo.marker('dotedExpression'); +verify.completionListContains('C1'); verify.completionListContains('C2'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts index 96044ffcc8a..4ac2778ac5a 100644 --- a/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts +++ b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts @@ -1,37 +1,37 @@ -/// - -////module mod1 { -//// var mX = 1; -//// function mFunc() { } -//// class mClass { } -//// module mMod { } -//// interface mInt {} -//// export var meX = 1; -//// export function meFunc() { } -//// export class meClass { } -//// export module meMod { export var iMex = 1; } -//// export interface meInt {} -////} -//// -////module frmConfirm { -//// import Mod1 = mod1; -//// import iMod1 = mod1./*1*/meMod; -//// Mod1./*2*/meX = 1; -//// iMod1./*3*/iMex = 1; -////} - -goTo.marker('1'); -verify.completionListContains('meX', '(var) mod1.meX: number'); -verify.completionListContains('meFunc', '(function) mod1.meFunc(): void'); -verify.completionListContains('meClass', 'class mod1.meClass'); -verify.completionListContains('meMod', 'module mod1.meMod'); -verify.completionListContains('meInt', 'interface mod1.meInt'); - -goTo.marker('2'); -verify.completionListContains('meX', '(var) mod1.meX: number'); -verify.completionListContains('meFunc', '(function) mod1.meFunc(): void'); -verify.completionListContains('meClass', 'class mod1.meClass'); -verify.completionListContains('meMod', 'module mod1.meMod'); - -goTo.marker('3'); +/// + +////module mod1 { +//// var mX = 1; +//// function mFunc() { } +//// class mClass { } +//// module mMod { } +//// interface mInt {} +//// export var meX = 1; +//// export function meFunc() { } +//// export class meClass { } +//// export module meMod { export var iMex = 1; } +//// export interface meInt {} +////} +//// +////module frmConfirm { +//// import Mod1 = mod1; +//// import iMod1 = mod1./*1*/meMod; +//// Mod1./*2*/meX = 1; +//// iMod1./*3*/iMex = 1; +////} + +goTo.marker('1'); +verify.completionListContains('meX', '(var) mod1.meX: number'); +verify.completionListContains('meFunc', '(function) mod1.meFunc(): void'); +verify.completionListContains('meClass', 'class mod1.meClass'); +verify.completionListContains('meMod', 'module mod1.meMod'); +verify.completionListContains('meInt', 'interface mod1.meInt'); + +goTo.marker('2'); +verify.completionListContains('meX', '(var) mod1.meX: number'); +verify.completionListContains('meFunc', '(function) mod1.meFunc(): void'); +verify.completionListContains('meClass', 'class mod1.meClass'); +verify.completionListContains('meMod', 'module mod1.meMod'); + +goTo.marker('3'); verify.completionListContains('iMex', '(var) mod1.meMod.iMex: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOnConstructorType.ts b/tests/cases/fourslash/memberListOnConstructorType.ts index 071b597955e..3d5596f2e58 100644 --- a/tests/cases/fourslash/memberListOnConstructorType.ts +++ b/tests/cases/fourslash/memberListOnConstructorType.ts @@ -1,8 +1,8 @@ -/// - -////var f: new () => void; -////f./*1*/ - -goTo.marker('1'); -verify.completionListContains('apply'); +/// + +////var f: new () => void; +////f./*1*/ + +goTo.marker('1'); +verify.completionListContains('apply'); verify.completionListContains('arguments'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOnFunctionParameter.ts b/tests/cases/fourslash/memberListOnFunctionParameter.ts index add2ed442be..ee33cdc95e5 100644 --- a/tests/cases/fourslash/memberListOnFunctionParameter.ts +++ b/tests/cases/fourslash/memberListOnFunctionParameter.ts @@ -1,13 +1,13 @@ -/// - -////module Test10 { -//// var x: string[] = []; -//// x.forEach(function (y) { y./**/} ); -////} - -goTo.marker(); -verify.memberListContains("charAt"); -verify.memberListContains("charCodeAt"); -verify.memberListContains("length"); -verify.memberListContains("concat"); +/// + +////module Test10 { +//// var x: string[] = []; +//// x.forEach(function (y) { y./**/} ); +////} + +goTo.marker(); +verify.memberListContains("charAt"); +verify.memberListContains("charCodeAt"); +verify.memberListContains("length"); +verify.memberListContains("concat"); verify.not.memberListContains("toFixed"); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts b/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts index 15686b4f7b8..341605e391c 100644 --- a/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts +++ b/tests/cases/fourslash/memberListOnThisInClassWithPrivates.ts @@ -1,13 +1,13 @@ -/// - -////class C1 { -//// public pubMeth() {this./**/} // test on 'this.' -//// private privMeth() {} -//// public pubProp = 0; -//// private privProp = 0; -////} - -goTo.marker(); -verify.memberListContains('privMeth', '(method) C1.privMeth(): void'); -verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); +/// + +////class C1 { +//// public pubMeth() {this./**/} // test on 'this.' +//// private privMeth() {} +//// public pubProp = 0; +//// private privProp = 0; +////} + +goTo.marker(); +verify.memberListContains('privMeth', '(method) C1.privMeth(): void'); +verify.memberListContains('pubMeth', '(method) C1.pubMeth(): void'); verify.memberListContains('pubProp', '(property) C1.pubProp: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/memberOverloadEdits.ts b/tests/cases/fourslash/memberOverloadEdits.ts index 95184027bdd..43553a81179 100644 --- a/tests/cases/fourslash/memberOverloadEdits.ts +++ b/tests/cases/fourslash/memberOverloadEdits.ts @@ -1,18 +1,18 @@ -/// - -//// module M { -//// export class A { -//// public m(n: number) { -//// return 0; -//// } -//// public n() { -//// return this.m(0); -//// } -//// } -//// export class B extends A { /*1*/ } -//// } - -verify.numberOfErrorsInCurrentFile(0); -goTo.marker('1'); -edit.insert("public m(n: number) { return 0; }"); +/// + +//// module M { +//// export class A { +//// public m(n: number) { +//// return 0; +//// } +//// public n() { +//// return this.m(0); +//// } +//// } +//// export class B extends A { /*1*/ } +//// } + +verify.numberOfErrorsInCurrentFile(0); +goTo.marker('1'); +edit.insert("public m(n: number) { return 0; }"); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash/mispeltVariableForInLoopErrorRecovery.ts b/tests/cases/fourslash/mispeltVariableForInLoopErrorRecovery.ts index 38636f88424..48d6aedac84 100644 --- a/tests/cases/fourslash/mispeltVariableForInLoopErrorRecovery.ts +++ b/tests/cases/fourslash/mispeltVariableForInLoopErrorRecovery.ts @@ -1,8 +1,8 @@ -/// - -////var alpha = [1, 2, 3]; -////for (var beta in alpha) { -//// alpha[beat/**/]++; -////} - -verify.not.errorExistsAfterMarker(); +/// + +////var alpha = [1, 2, 3]; +////for (var beta in alpha) { +//// alpha[beat/**/]++; +////} + +verify.not.errorExistsAfterMarker(); diff --git a/tests/cases/fourslash/moduleRenamingErrorRecovery.ts b/tests/cases/fourslash/moduleRenamingErrorRecovery.ts index f8d83a9e407..ada428d03bd 100644 --- a/tests/cases/fourslash/moduleRenamingErrorRecovery.ts +++ b/tests/cases/fourslash/moduleRenamingErrorRecovery.ts @@ -1,9 +1,9 @@ -/// - -////module Alpha/*1*//*2*/ { class Foo { public bar() { } } } - -goTo.marker("1"); -edit.backspace(5); -edit.insert("Pizza"); -verify.currentLineContentIs("module Pizza { class Foo { public bar() { } } }"); +/// + +////module Alpha/*1*//*2*/ { class Foo { public bar() { } } } + +goTo.marker("1"); +edit.backspace(5); +edit.insert("Pizza"); +verify.currentLineContentIs("module Pizza { class Foo { public bar() { } } }"); verify.not.errorExistsAfterMarker("2"); \ No newline at end of file diff --git a/tests/cases/fourslash/multipleExportAssignmentsErrorList0.ts b/tests/cases/fourslash/multipleExportAssignmentsErrorList0.ts index 721d110ce68..bb13973cc82 100644 --- a/tests/cases/fourslash/multipleExportAssignmentsErrorList0.ts +++ b/tests/cases/fourslash/multipleExportAssignmentsErrorList0.ts @@ -1,27 +1,27 @@ -/// - -//// interface connectModule { -//// (res, req, next): void; -//// } -//// interface connectExport { -//// use: (mod: connectModule) => connectExport; -//// listen: (port: number) => void; -//// } -//// var server: { -//// (): connectExport; -//// test1: connectModule; -//// test2(): connectModule; -//// }; -//// export = server; -//// /*1*/export = connectExport; -//// -//// - -edit.disableFormatting(); -goTo.marker('1'); - -edit.deleteAtCaret(24); - -goTo.marker('1'); - -edit.insert("export = connectExport;\n"); +/// + +//// interface connectModule { +//// (res, req, next): void; +//// } +//// interface connectExport { +//// use: (mod: connectModule) => connectExport; +//// listen: (port: number) => void; +//// } +//// var server: { +//// (): connectExport; +//// test1: connectModule; +//// test2(): connectModule; +//// }; +//// export = server; +//// /*1*/export = connectExport; +//// +//// + +edit.disableFormatting(); +goTo.marker('1'); + +edit.deleteAtCaret(24); + +goTo.marker('1'); + +edit.insert("export = connectExport;\n"); diff --git a/tests/cases/fourslash/nameOfRetypedClassInModule.ts b/tests/cases/fourslash/nameOfRetypedClassInModule.ts index 4faddd2b686..7dea74020f8 100644 --- a/tests/cases/fourslash/nameOfRetypedClassInModule.ts +++ b/tests/cases/fourslash/nameOfRetypedClassInModule.ts @@ -1,32 +1,32 @@ -/// - -//// module M { -//// } -//// -//// module M { -//// /*A*/class A {} -//// /*B*/export class B {} -//// class Check { /*check*/constructor(val) {} } -//// export class Check2 { /*check2*/constructor(val) {} } -//// } -//// - -edit.disableFormatting(); - -goTo.marker('check'); -verify.quickInfoIs('(constructor) Check(val: any): Check'); - -goTo.marker('check2'); -verify.quickInfoIs('(constructor) M.Check2(val: any): Check2'); - -goTo.marker('A'); -edit.deleteAtCaret('class A {}'.length); -edit.insert('class A { constructor(val) {} }'); -edit.moveLeft('constructor(val) {} }'.length); -verify.quickInfoIs('(constructor) A(val: any): A'); - -goTo.marker('B'); -edit.deleteAtCaret('export class B {}'.length); -edit.insert('export class B { constructor(val) {} }'); -edit.moveLeft('constructor(val) {} }'.length); -verify.quickInfoIs('(constructor) M.B(val: any): B'); +/// + +//// module M { +//// } +//// +//// module M { +//// /*A*/class A {} +//// /*B*/export class B {} +//// class Check { /*check*/constructor(val) {} } +//// export class Check2 { /*check2*/constructor(val) {} } +//// } +//// + +edit.disableFormatting(); + +goTo.marker('check'); +verify.quickInfoIs('(constructor) Check(val: any): Check'); + +goTo.marker('check2'); +verify.quickInfoIs('(constructor) M.Check2(val: any): Check2'); + +goTo.marker('A'); +edit.deleteAtCaret('class A {}'.length); +edit.insert('class A { constructor(val) {} }'); +edit.moveLeft('constructor(val) {} }'.length); +verify.quickInfoIs('(constructor) A(val: any): A'); + +goTo.marker('B'); +edit.deleteAtCaret('export class B {}'.length); +edit.insert('export class B { constructor(val) {} }'); +edit.moveLeft('constructor(val) {} }'.length); +verify.quickInfoIs('(constructor) M.B(val: any): B'); diff --git a/tests/cases/fourslash/nameOrDottedNameClasses.ts b/tests/cases/fourslash/nameOrDottedNameClasses.ts index 9aa63a7a473..7a0fd8c19c3 100644 --- a/tests/cases/fourslash/nameOrDottedNameClasses.ts +++ b/tests/cases/fourslash/nameOrDottedNameClasses.ts @@ -3,37 +3,37 @@ // @BaselineFile: nameOrDottedSpan_classes.baseline // @Filename: nameOrDottedSpan_classes.ts ////module Foo.Bar { -//// "use strict"; -//// +//// "use strict"; +//// //// class Greeter { //// constructor(public greeting: string) { //// } -//// +//// //// greet() { //// return "

" + this.greeting + "

"; //// } -//// } -//// -//// +//// } +//// +//// //// function foo(greeting: string): Greeter { //// return new Greeter(greeting); -//// } -//// -//// var greeter = new Greeter("Hello, world!"); -//// var str = greeter.greet(); -//// +//// } +//// +//// var greeter = new Greeter("Hello, world!"); +//// var str = greeter.greet(); +//// //// function foo2(greeting: string, ...restGreetings /* more greeting */: string[]) { //// var greeters: Greeter[] = []; /* inline block comment */ //// greeters[0] = new Greeter(greeting); //// for (var i = 0; i < restGreetings.length; i++) { //// greeters.push(new Greeter(restGreetings[i])); //// } -//// +//// //// return greeters; -//// } -//// -//// var b = foo2("Hello", "World", "!"); -//// // This is simple signle line comment +//// } +//// +//// var b = foo2("Hello", "World", "!"); +//// // This is simple signle line comment //// for (var j = 0; j < b.length; j++) { //// b[j].greet(); //// } diff --git a/tests/cases/fourslash/navigateItemsConst.ts b/tests/cases/fourslash/navigateItemsConst.ts index d5ccb31066d..a20c0192874 100644 --- a/tests/cases/fourslash/navigateItemsConst.ts +++ b/tests/cases/fourslash/navigateItemsConst.ts @@ -1,9 +1,9 @@ /// -////{| "itemName": "c", "kind": "const", "parentName": "" |}const c = 10; -////function foo() { -//// {| "itemName": "d", "kind": "const", "parentName": "foo" |}const d = 10; -////} +////{| "itemName": "c", "kind": "const", "parentName": "" |}const c = 10; +////function foo() { +//// {| "itemName": "d", "kind": "const", "parentName": "foo" |}const d = 10; +////} test.markers().forEach(marker => { verify.navigationItemsListContains( diff --git a/tests/cases/fourslash/navigationItemsExactMatch.ts b/tests/cases/fourslash/navigationItemsExactMatch.ts index 9658c52324c..5481f4295cb 100644 --- a/tests/cases/fourslash/navigationItemsExactMatch.ts +++ b/tests/cases/fourslash/navigationItemsExactMatch.ts @@ -1,27 +1,27 @@ -/// - -/////// Module -////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { -//// -//// // Class -//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { -//// // Instance member -//// {| "itemName": "origin", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private origin = 0.0; -//// -//// {| "itemName": "distFromZero", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private distFromZero = 0.0; -//// -//// // Getter -//// {| "itemName": "distance", "kind": "getter", "parentName": "Point", "matchKind": "exact" |}get distance(): number { return 0; } -//// } -////} -//// -////// Local variables -////{| "itemName": "point", "kind": "var", "parentName": "", "matchKind": "exact"|}var point = new Shapes.Point(); - -//// Testing for exact matching of navigationItems - -test.markers().forEach((marker) => { - if (marker.data) { - verify.navigationItemsListContains(marker.data.itemName, marker.data.kind, marker.data.itemName, marker.data.matchKind, marker.fileName, marker.data.parentName); - } -}); +/// + +/////// Module +////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { +//// +//// // Class +//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { +//// // Instance member +//// {| "itemName": "origin", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private origin = 0.0; +//// +//// {| "itemName": "distFromZero", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private distFromZero = 0.0; +//// +//// // Getter +//// {| "itemName": "distance", "kind": "getter", "parentName": "Point", "matchKind": "exact" |}get distance(): number { return 0; } +//// } +////} +//// +////// Local variables +////{| "itemName": "point", "kind": "var", "parentName": "", "matchKind": "exact"|}var point = new Shapes.Point(); + +//// Testing for exact matching of navigationItems + +test.markers().forEach((marker) => { + if (marker.data) { + verify.navigationItemsListContains(marker.data.itemName, marker.data.kind, marker.data.itemName, marker.data.matchKind, marker.fileName, marker.data.parentName); + } +}); diff --git a/tests/cases/fourslash/navigationItemsExactMatch2.ts b/tests/cases/fourslash/navigationItemsExactMatch2.ts index adf8e69761e..e96d4f65ed4 100644 --- a/tests/cases/fourslash/navigationItemsExactMatch2.ts +++ b/tests/cases/fourslash/navigationItemsExactMatch2.ts @@ -1,28 +1,28 @@ -/// -// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts -/////*file1*/ -////module Shapes { -//// class Point { -//// private _origin = 0.0; -//// private distanceFromA = 0.0; -//// -//// get distance1(distanceParam): number { -//// var distanceLocal; -//// return 0; -//// } -//// } -////} -//// -////var point = new Shapes.Point(); -////function distance2(distanceParam1): void { -//// var distanceLocal1; -////} -debugger; -goTo.marker("file1"); -verify.navigationItemsListCount(2, "point", "exact"); -verify.navigationItemsListCount(5, "distance", "prefix"); -verify.navigationItemsListCount(1, "origin", "substring"); - -verify.navigationItemsListCount(0, "square", "exact"); -verify.navigationItemsListCount(0, "square", "prefix"); +/// +// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts +/////*file1*/ +////module Shapes { +//// class Point { +//// private _origin = 0.0; +//// private distanceFromA = 0.0; +//// +//// get distance1(distanceParam): number { +//// var distanceLocal; +//// return 0; +//// } +//// } +////} +//// +////var point = new Shapes.Point(); +////function distance2(distanceParam1): void { +//// var distanceLocal1; +////} +debugger; +goTo.marker("file1"); +verify.navigationItemsListCount(2, "point", "exact"); +verify.navigationItemsListCount(5, "distance", "prefix"); +verify.navigationItemsListCount(1, "origin", "substring"); + +verify.navigationItemsListCount(0, "square", "exact"); +verify.navigationItemsListCount(0, "square", "prefix"); verify.navigationItemsListCount(0, "square", "substring"); \ No newline at end of file diff --git a/tests/cases/fourslash/navigationItemsInConstructorsExactMatch.ts b/tests/cases/fourslash/navigationItemsInConstructorsExactMatch.ts index 68bb7db5c72..10397813fd0 100644 --- a/tests/cases/fourslash/navigationItemsInConstructorsExactMatch.ts +++ b/tests/cases/fourslash/navigationItemsInConstructorsExactMatch.ts @@ -1,12 +1,12 @@ -/// - -////class Test { -//// private search1: number; -//// constructor(public search2: boolean, search3: string) { -//// } -////} - -// Search for properties defined in the constructor, but not other constructor paramters -var searchValue = "search"; -verify.navigationItemsListContains("search1", "property", searchValue, "prefix"); -verify.navigationItemsListContains("search2", "property", searchValue, "prefix"); +/// + +////class Test { +//// private search1: number; +//// constructor(public search2: boolean, search3: string) { +//// } +////} + +// Search for properties defined in the constructor, but not other constructor paramters +var searchValue = "search"; +verify.navigationItemsListContains("search1", "property", searchValue, "prefix"); +verify.navigationItemsListContains("search2", "property", searchValue, "prefix"); diff --git a/tests/cases/fourslash/navigationItemsOverloads1.ts b/tests/cases/fourslash/navigationItemsOverloads1.ts index 5f1981fe917..68d0c8d1f83 100644 --- a/tests/cases/fourslash/navigationItemsOverloads1.ts +++ b/tests/cases/fourslash/navigationItemsOverloads1.ts @@ -1,30 +1,30 @@ -/// - -////function overload(a: string): boolean; -////function overload(b: boolean): boolean; -////function overload(b: number): boolean; -////function overload(f: typeof overload): boolean; -////function overload(x: any, b = (function overload() { return false })): boolean { -//// throw overload; -////} -//// -////interface I { -//// interfaceMethodSignature(a: string): boolean; -//// interfaceMethodSignature(b: boolean): boolean; -//// interfaceMethodSignature(b: number): boolean; -//// interfaceMethodSignature(f: I): boolean; -////} -//// -////class C { -//// methodOverload(a: string): boolean; -//// methodOverload(b: boolean): boolean; -//// methodOverload(b: number): boolean; -//// methodOverload(f: I): boolean; -//// methodOverload(x: any, b = (function overload() { return false })): boolean { -//// throw C; -//// } -////} - -verify.navigationItemsListCount(1, "overload", "exact"); -verify.navigationItemsListCount(1, "interfaceMethodSignature", "exact"); -verify.navigationItemsListCount(1, "methodOverload", "exact"); +/// + +////function overload(a: string): boolean; +////function overload(b: boolean): boolean; +////function overload(b: number): boolean; +////function overload(f: typeof overload): boolean; +////function overload(x: any, b = (function overload() { return false })): boolean { +//// throw overload; +////} +//// +////interface I { +//// interfaceMethodSignature(a: string): boolean; +//// interfaceMethodSignature(b: boolean): boolean; +//// interfaceMethodSignature(b: number): boolean; +//// interfaceMethodSignature(f: I): boolean; +////} +//// +////class C { +//// methodOverload(a: string): boolean; +//// methodOverload(b: boolean): boolean; +//// methodOverload(b: number): boolean; +//// methodOverload(f: I): boolean; +//// methodOverload(x: any, b = (function overload() { return false })): boolean { +//// throw C; +//// } +////} + +verify.navigationItemsListCount(1, "overload", "exact"); +verify.navigationItemsListCount(1, "interfaceMethodSignature", "exact"); +verify.navigationItemsListCount(1, "methodOverload", "exact"); diff --git a/tests/cases/fourslash/navigationItemsOverloads2.ts b/tests/cases/fourslash/navigationItemsOverloads2.ts index c5824b639bc..2c33ef65f0d 100644 --- a/tests/cases/fourslash/navigationItemsOverloads2.ts +++ b/tests/cases/fourslash/navigationItemsOverloads2.ts @@ -1,12 +1,12 @@ -/// - -////interface I { -//// interfaceMethodSignature(a: string): boolean; -//// interfaceMethodSignature(b: number): boolean; -//// interfaceMethodSignature(f: I): boolean; -////} -////interface I { -//// interfaceMethodSignature(b: boolean): boolean; -////} - -verify.navigationItemsListCount(2, "interfaceMethodSignature", "exact"); +/// + +////interface I { +//// interfaceMethodSignature(a: string): boolean; +//// interfaceMethodSignature(b: number): boolean; +//// interfaceMethodSignature(f: I): boolean; +////} +////interface I { +//// interfaceMethodSignature(b: boolean): boolean; +////} + +verify.navigationItemsListCount(2, "interfaceMethodSignature", "exact"); diff --git a/tests/cases/fourslash/navigationItemsOverloadsBroken1.ts b/tests/cases/fourslash/navigationItemsOverloadsBroken1.ts index 7b8ebc9181f..d2a9ec8e25f 100644 --- a/tests/cases/fourslash/navigationItemsOverloadsBroken1.ts +++ b/tests/cases/fourslash/navigationItemsOverloadsBroken1.ts @@ -1,29 +1,29 @@ -/// - -////function overload1(a: string): boolean; -////function overload1(b: boolean): boolean; -////function overload1(b: number): boolean; -//// -////var heyImNotInterruptingAnythingAmI = '?'; -//// -////function overload1(f: typeof overload): boolean; -////function overload1(x: any, b = (function overload() { return false })): boolean { -//// throw overload; -////} - -////function overload2(a: string): boolean; -////function overload2(b: boolean): boolean; -////function overload2(b: number): boolean; -//// -////function iJustRuinEverything(x: any, b = (function overload() { return false })): boolean { -//// throw overload; -////} -//// -////function overload2(f: typeof overload): boolean; -////function overload2(x: any, b = (function overload() { return false })): boolean { -//// throw overload; -////} - -verify.navigationItemsListCount(2, "overload1", "exact"); -verify.navigationItemsListCount(2, "overload2", "exact"); +/// + +////function overload1(a: string): boolean; +////function overload1(b: boolean): boolean; +////function overload1(b: number): boolean; +//// +////var heyImNotInterruptingAnythingAmI = '?'; +//// +////function overload1(f: typeof overload): boolean; +////function overload1(x: any, b = (function overload() { return false })): boolean { +//// throw overload; +////} + +////function overload2(a: string): boolean; +////function overload2(b: boolean): boolean; +////function overload2(b: number): boolean; +//// +////function iJustRuinEverything(x: any, b = (function overload() { return false })): boolean { +//// throw overload; +////} +//// +////function overload2(f: typeof overload): boolean; +////function overload2(x: any, b = (function overload() { return false })): boolean { +//// throw overload; +////} + +verify.navigationItemsListCount(2, "overload1", "exact"); +verify.navigationItemsListCount(2, "overload2", "exact"); verify.navigationItemsListCount(4, "overload", "prefix"); \ No newline at end of file diff --git a/tests/cases/fourslash/navigationItemsOverloadsBroken2.ts b/tests/cases/fourslash/navigationItemsOverloadsBroken2.ts index c1f6ccae2f5..6b039322419 100644 --- a/tests/cases/fourslash/navigationItemsOverloadsBroken2.ts +++ b/tests/cases/fourslash/navigationItemsOverloadsBroken2.ts @@ -1,23 +1,23 @@ -/// - -////function overload1(a: string): boolean; -////function overload1(b: boolean): boolean; -////function overload1(x: any, b = (function overload() { return false })): boolean { -//// throw overload1; -////} -////function overload1(b: number): boolean; -////function overload1(f: typeof overload): boolean; - -////function overload2(a: string): boolean; -////function overload2(b: boolean): boolean; -////function overload2(x: any, b = (function overload() { return false })): boolean { -//// function overload2(): boolean; -//// function overload2(x: any): boolean; -//// throw overload2; -////} -////function overload2(b: number): boolean; -////function overload2(f: typeof overload): boolean; - -verify.navigationItemsListCount(1, "overload1", "exact"); -verify.navigationItemsListCount(3, "overload2", "exact"); +/// + +////function overload1(a: string): boolean; +////function overload1(b: boolean): boolean; +////function overload1(x: any, b = (function overload() { return false })): boolean { +//// throw overload1; +////} +////function overload1(b: number): boolean; +////function overload1(f: typeof overload): boolean; + +////function overload2(a: string): boolean; +////function overload2(b: boolean): boolean; +////function overload2(x: any, b = (function overload() { return false })): boolean { +//// function overload2(): boolean; +//// function overload2(x: any): boolean; +//// throw overload2; +////} +////function overload2(b: number): boolean; +////function overload2(f: typeof overload): boolean; + +verify.navigationItemsListCount(1, "overload1", "exact"); +verify.navigationItemsListCount(3, "overload2", "exact"); verify.navigationItemsListCount(4, "overload", "prefix"); \ No newline at end of file diff --git a/tests/cases/fourslash/navigationItemsPrefixMatch.ts b/tests/cases/fourslash/navigationItemsPrefixMatch.ts index b6ae4af0f33..b295def114f 100644 --- a/tests/cases/fourslash/navigationItemsPrefixMatch.ts +++ b/tests/cases/fourslash/navigationItemsPrefixMatch.ts @@ -1,29 +1,29 @@ -/// - -/////// Module -////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { -//// -//// // Class -//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { -//// // Instance member -//// {| "itemName": "originality", "kind": "property", "parentName": "Point", "matchKind": "prefix"|}private originality = 0.0; -//// -//// {| "itemName": "distanceFromOrig", "kind": "property", "parentName": "Point", "matchKind": "prefix"|}private distanceFromOrig = 0.0; -//// -//// // Getter -//// {| "itemName": "distanceFarFarAway", "kind": "getter", "parentName": "Point", "matchKind": "prefix" |}get distanceFarFarAway(): number { return 0; } -//// } -////} -//// -////// Local variables -////{| "itemName": "pointsSquareBox", "kind": "var", "parentName": "", "matchKind": "prefix" |}var pointsSquareBox = new Shapes.Point(); - -//// Testing for exact matching of navigationItems -// var searchValue = "origin distance points shape"; - -test.markers().forEach((marker) => { - if (marker.data) { - var itemName = marker.data.itemName; - verify.navigationItemsListContains(itemName, marker.data.kind, itemName.substr(0, itemName.length - 1), marker.data.matchKind, marker.fileName, marker.data.parentName); - } -}); +/// + +/////// Module +////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { +//// +//// // Class +//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { +//// // Instance member +//// {| "itemName": "originality", "kind": "property", "parentName": "Point", "matchKind": "prefix"|}private originality = 0.0; +//// +//// {| "itemName": "distanceFromOrig", "kind": "property", "parentName": "Point", "matchKind": "prefix"|}private distanceFromOrig = 0.0; +//// +//// // Getter +//// {| "itemName": "distanceFarFarAway", "kind": "getter", "parentName": "Point", "matchKind": "prefix" |}get distanceFarFarAway(): number { return 0; } +//// } +////} +//// +////// Local variables +////{| "itemName": "pointsSquareBox", "kind": "var", "parentName": "", "matchKind": "prefix" |}var pointsSquareBox = new Shapes.Point(); + +//// Testing for exact matching of navigationItems +// var searchValue = "origin distance points shape"; + +test.markers().forEach((marker) => { + if (marker.data) { + var itemName = marker.data.itemName; + verify.navigationItemsListContains(itemName, marker.data.kind, itemName.substr(0, itemName.length - 1), marker.data.matchKind, marker.fileName, marker.data.parentName); + } +}); diff --git a/tests/cases/fourslash/navigationItemsPrefixMatch2.ts b/tests/cases/fourslash/navigationItemsPrefixMatch2.ts index 282d0e2414f..0bce1f36b33 100644 --- a/tests/cases/fourslash/navigationItemsPrefixMatch2.ts +++ b/tests/cases/fourslash/navigationItemsPrefixMatch2.ts @@ -1,32 +1,32 @@ -/// -// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts -/////*file1*/ -////module Shapes { -//// export class Point { -//// private originality = 0.0; -//// private distanceFromOrig = 0.0; -//// get distanceFarFarAway(distanceFarFarAwayParam: number): number { -//// var distanceFarFarAwayLocal; -//// return 0; -//// } -//// } -////} -////var pointsSquareBox = new Shapes.Point(); -////function PointsFunc(): void { -//// var pointFuncLocal; -////} -////interface OriginI { -//// var 123; -//// var origin1; -//// public _distance(distanceParam): void; -////} - -var notFoundSearchValue = "mPointThatIJustInitiated wrongKeyWord"; - -goTo.marker("file1"); -verify.navigationItemsListCount(3, "origin", "prefix"); -verify.navigationItemsListCount(3, "distance", "prefix"); - -verify.navigationItemsListCount(0, notFoundSearchValue, "exact"); -verify.navigationItemsListCount(0, notFoundSearchValue, "prefix"); +/// +// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts +/////*file1*/ +////module Shapes { +//// export class Point { +//// private originality = 0.0; +//// private distanceFromOrig = 0.0; +//// get distanceFarFarAway(distanceFarFarAwayParam: number): number { +//// var distanceFarFarAwayLocal; +//// return 0; +//// } +//// } +////} +////var pointsSquareBox = new Shapes.Point(); +////function PointsFunc(): void { +//// var pointFuncLocal; +////} +////interface OriginI { +//// var 123; +//// var origin1; +//// public _distance(distanceParam): void; +////} + +var notFoundSearchValue = "mPointThatIJustInitiated wrongKeyWord"; + +goTo.marker("file1"); +verify.navigationItemsListCount(3, "origin", "prefix"); +verify.navigationItemsListCount(3, "distance", "prefix"); + +verify.navigationItemsListCount(0, notFoundSearchValue, "exact"); +verify.navigationItemsListCount(0, notFoundSearchValue, "prefix"); verify.navigationItemsListCount(0, notFoundSearchValue, "substring"); \ No newline at end of file diff --git a/tests/cases/fourslash/navigationItemsSubStringMatch.ts b/tests/cases/fourslash/navigationItemsSubStringMatch.ts index b90a2a2f33e..4be74953142 100644 --- a/tests/cases/fourslash/navigationItemsSubStringMatch.ts +++ b/tests/cases/fourslash/navigationItemsSubStringMatch.ts @@ -1,26 +1,26 @@ -/// - -/////// Module -////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { -//// -//// // Class -//// {| "itemName": "MyPoint", "kind": "class", "parentName": "MyShapes", "matchKind": "substring" |}export class MyPoint { -//// // Instance member -//// {| "itemName": "MyoriginPointAttheHorizon", "kind": "property", "parentName": "MyPoint", "matchKind": "substring"|}private MyoriginPointAttheHorizon = 0.0; -//// -//// // Getter -//// {| "itemName": "MydistanceFromOrigin", "kind": "getter", "parentName": "MyPoint", "matchKind": "substring" |}get MydistanceFromOrigin(): number { return 0; } -//// -//// } -////} -//// -////// Local variables -////{| "itemName": "MymyPointThatIJustInitiated", "kind": "var", "parentName": "", "matchKind": "substring"|}var MymyPointThatIJustInitiated = new Shapes.Point(); - -debugger; -test.markers().forEach((marker) => { - if (marker.data) { - var name = marker.data.itemName; - verify.navigationItemsListContains(name, marker.data.kind, name.substr(2), marker.data.matchKind, marker.fileName, marker.data.parentName); - } +/// + +/////// Module +////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { +//// +//// // Class +//// {| "itemName": "MyPoint", "kind": "class", "parentName": "MyShapes", "matchKind": "substring" |}export class MyPoint { +//// // Instance member +//// {| "itemName": "MyoriginPointAttheHorizon", "kind": "property", "parentName": "MyPoint", "matchKind": "substring"|}private MyoriginPointAttheHorizon = 0.0; +//// +//// // Getter +//// {| "itemName": "MydistanceFromOrigin", "kind": "getter", "parentName": "MyPoint", "matchKind": "substring" |}get MydistanceFromOrigin(): number { return 0; } +//// +//// } +////} +//// +////// Local variables +////{| "itemName": "MymyPointThatIJustInitiated", "kind": "var", "parentName": "", "matchKind": "substring"|}var MymyPointThatIJustInitiated = new Shapes.Point(); + +debugger; +test.markers().forEach((marker) => { + if (marker.data) { + var name = marker.data.itemName; + verify.navigationItemsListContains(name, marker.data.kind, name.substr(2), marker.data.matchKind, marker.fileName, marker.data.parentName); + } }); \ No newline at end of file diff --git a/tests/cases/fourslash/navigationItemsSubStringMatch2.ts b/tests/cases/fourslash/navigationItemsSubStringMatch2.ts index edce5ad761d..7ea901c9de3 100644 --- a/tests/cases/fourslash/navigationItemsSubStringMatch2.ts +++ b/tests/cases/fourslash/navigationItemsSubStringMatch2.ts @@ -1,36 +1,36 @@ -/// -// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts -/////*file1*/ -////module Shapes { -//// export class Point { -//// private originPointAttheHorizon = 0.0; -//// -//// get distanceFromOrigin(distanceParam): number { -//// var distanceLocal; -//// return 0; -//// } -//// } -////} -//// -////var myPointThatIJustInitiated = new Shapes.Point(); -////interface IDistance{ -//// INITIATED123; -//// public horizon(): void; -////} -debugger; -var notFoundSearchValue = "mPointThatIJustInitiated wrongKeyWord"; - -goTo.marker("file1"); -// case sensitive matching for 'Horizon' will fail -verify.navigationItemsListCount(1, "Horizon", "exact"); -// case insensitive matching will find 'horizon' -verify.navigationItemsListCount(1, "horizon", "exact"); -// case sensitive matching will find 'Distance' and INITIATED -verify.navigationItemsListCount(1, "Distance", "substring"); -// case sensitive matching will find 'INITIATED' -verify.navigationItemsListCount(1, "INITIATED", "prefix"); - - -verify.navigationItemsListCount(0, notFoundSearchValue, "exact"); -verify.navigationItemsListCount(0, notFoundSearchValue, "prefix"); +/// +// @Filename: navigationItemsContainsNoAnonymousFunctions_0.ts +/////*file1*/ +////module Shapes { +//// export class Point { +//// private originPointAttheHorizon = 0.0; +//// +//// get distanceFromOrigin(distanceParam): number { +//// var distanceLocal; +//// return 0; +//// } +//// } +////} +//// +////var myPointThatIJustInitiated = new Shapes.Point(); +////interface IDistance{ +//// INITIATED123; +//// public horizon(): void; +////} +debugger; +var notFoundSearchValue = "mPointThatIJustInitiated wrongKeyWord"; + +goTo.marker("file1"); +// case sensitive matching for 'Horizon' will fail +verify.navigationItemsListCount(1, "Horizon", "exact"); +// case insensitive matching will find 'horizon' +verify.navigationItemsListCount(1, "horizon", "exact"); +// case sensitive matching will find 'Distance' and INITIATED +verify.navigationItemsListCount(1, "Distance", "substring"); +// case sensitive matching will find 'INITIATED' +verify.navigationItemsListCount(1, "INITIATED", "prefix"); + + +verify.navigationItemsListCount(0, notFoundSearchValue, "exact"); +verify.navigationItemsListCount(0, notFoundSearchValue, "prefix"); verify.navigationItemsListCount(0, notFoundSearchValue, "substring"); \ No newline at end of file diff --git a/tests/cases/fourslash/noCompletionListOnCommentsInsideObjectLiterals.ts b/tests/cases/fourslash/noCompletionListOnCommentsInsideObjectLiterals.ts index 15affd3b61e..38f9133149e 100644 --- a/tests/cases/fourslash/noCompletionListOnCommentsInsideObjectLiterals.ts +++ b/tests/cases/fourslash/noCompletionListOnCommentsInsideObjectLiterals.ts @@ -1,18 +1,18 @@ -/// - -////module ObjectLiterals { -//// interface MyPoint { -//// x1: number; -//// y1: number; -//// } -//// -//// var p1: MyPoint = { -//// /* /*1*/ Comment /*2*/ */ -//// }; -////} - -goTo.marker("1"); -verify.completionListIsEmpty(); - -goTo.marker("2"); +/// + +////module ObjectLiterals { +//// interface MyPoint { +//// x1: number; +//// y1: number; +//// } +//// +//// var p1: MyPoint = { +//// /* /*1*/ Comment /*2*/ */ +//// }; +////} + +goTo.marker("1"); +verify.completionListIsEmpty(); + +goTo.marker("2"); verify.completionListIsEmpty(); \ No newline at end of file diff --git a/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts index 30314b1c665..8dc942f2758 100644 --- a/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts +++ b/tests/cases/fourslash/noSignatureHelpOnNewKeyword.ts @@ -1,4 +1,4 @@ -/// +/// ////class Foo { } ////new/*1*/ Foo diff --git a/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts b/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts index 692dfe70758..06c0fb6e44a 100644 --- a/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts +++ b/tests/cases/fourslash/noSmartIndentInsideMultilineString.ts @@ -1,11 +1,11 @@ -/// - -////window.onload = () => { -//// var el = document.getElementById('content\/*1*/'); -//// var greeter = new Greeter(el); -////greeter.start(); -////}; - -goTo.marker("1"); -edit.insert("\r\n"); +/// + +////window.onload = () => { +//// var el = document.getElementById('content\/*1*/'); +//// var greeter = new Greeter(el); +////greeter.start(); +////}; + +goTo.marker("1"); +edit.insert("\r\n"); verify.indentationIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/overloadObjectLiteralCrash.ts b/tests/cases/fourslash/overloadObjectLiteralCrash.ts index 91f081a54fe..f98469443bb 100644 --- a/tests/cases/fourslash/overloadObjectLiteralCrash.ts +++ b/tests/cases/fourslash/overloadObjectLiteralCrash.ts @@ -1,12 +1,12 @@ -/// - -//// interface Foo { -//// extend(...objs: any[]): T; -//// extend(deep, target: T): T; -//// } -//// var $: Foo; -//// $.extend({ /**/foo: 0 }, ""); -//// - -goTo.marker(); -verify.quickInfoExists(); +/// + +//// interface Foo { +//// extend(...objs: any[]): T; +//// extend(deep, target: T): T; +//// } +//// var $: Foo; +//// $.extend({ /**/foo: 0 }, ""); +//// + +goTo.marker(); +verify.quickInfoExists(); diff --git a/tests/cases/fourslash/parenthesisFatArrows.ts b/tests/cases/fourslash/parenthesisFatArrows.ts index e4bdc2c1f97..1751e50afc8 100644 --- a/tests/cases/fourslash/parenthesisFatArrows.ts +++ b/tests/cases/fourslash/parenthesisFatArrows.ts @@ -1,11 +1,11 @@ -/// - -////x => x; -////(y) => y; -/////**/ -////(y) => y; -////x => x; - -verify.numberOfErrorsInCurrentFile(0); -verify.not.errorExistsBeforeMarker(); +/// + +////x => x; +////(y) => y; +/////**/ +////(y) => y; +////x => x; + +verify.numberOfErrorsInCurrentFile(0); +verify.not.errorExistsBeforeMarker(); verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/publicBreak.ts b/tests/cases/fourslash/publicBreak.ts index 630e5714a40..26407184b48 100644 --- a/tests/cases/fourslash/publicBreak.ts +++ b/tests/cases/fourslash/publicBreak.ts @@ -1,7 +1,7 @@ -/// - -//// public break; -//// /**/ - -goTo.marker(); -edit.insert(' '); +/// + +//// public break; +//// /**/ + +goTo.marker(); +edit.insert(' '); diff --git a/tests/cases/fourslash/qualifiedName_import-declaration-with-variable-entity-names.ts b/tests/cases/fourslash/qualifiedName_import-declaration-with-variable-entity-names.ts index fa57a17f98a..b6f64e4be42 100644 --- a/tests/cases/fourslash/qualifiedName_import-declaration-with-variable-entity-names.ts +++ b/tests/cases/fourslash/qualifiedName_import-declaration-with-variable-entity-names.ts @@ -1,5 +1,5 @@ -/// - +/// + ////module Alpha { //// export var [|{| "name" : "def" |}x|] = 100; ////} @@ -7,20 +7,20 @@ ////module Beta { //// import p = Alpha.[|{| "name" : "import" |}x|]; ////} -//// -////var x = Alpha.[|{| "name" : "mem" |}x|] - -goTo.marker('import'); -verify.completionListContains('x', '(var) Alpha.x: number'); +//// +////var x = Alpha.[|{| "name" : "mem" |}x|] + +goTo.marker('import'); +verify.completionListContains('x', '(var) Alpha.x: number'); var def: FourSlashInterface.Range = test.ranges().filter(range => range.marker.data.name === "def")[0]; -var imp: FourSlashInterface.Range = test.ranges().filter(range => range.marker.data.name === "import")[0]; -var mem: FourSlashInterface.Range = test.ranges().filter(range => range.marker.data.name === "mem")[0]; - +var imp: FourSlashInterface.Range = test.ranges().filter(range => range.marker.data.name === "import")[0]; +var mem: FourSlashInterface.Range = test.ranges().filter(range => range.marker.data.name === "mem")[0]; + verify.occurrencesAtPositionContains(def); -verify.occurrencesAtPositionContains(imp); -verify.occurrencesAtPositionContains(mem); - -goTo.definition(); - +verify.occurrencesAtPositionContains(imp); +verify.occurrencesAtPositionContains(mem); + +goTo.definition(); + verify.caretAtMarker('def'); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForContextuallyTypedArrowFunctionInSuperCall.ts b/tests/cases/fourslash/quickInfoForContextuallyTypedArrowFunctionInSuperCall.ts index e24a484979a..51eb59378a9 100644 --- a/tests/cases/fourslash/quickInfoForContextuallyTypedArrowFunctionInSuperCall.ts +++ b/tests/cases/fourslash/quickInfoForContextuallyTypedArrowFunctionInSuperCall.ts @@ -1,4 +1,4 @@ -/// +/// ////class A { //// constructor(private map: (value: T1) => T2) { diff --git a/tests/cases/fourslash/quickInfoForShorthandProperty.ts b/tests/cases/fourslash/quickInfoForShorthandProperty.ts index 21ba9db683d..d4b30b0d736 100644 --- a/tests/cases/fourslash/quickInfoForShorthandProperty.ts +++ b/tests/cases/fourslash/quickInfoForShorthandProperty.ts @@ -1,4 +1,4 @@ -/// +/// //// var name1 = undefined, id1 = undefined; //// var /*obj1*/obj1 = {/*name1*/name1, /*id1*/id1}; diff --git a/tests/cases/fourslash/quickInfoInInvalidIndexSignature.ts b/tests/cases/fourslash/quickInfoInInvalidIndexSignature.ts index b08fb92b8b6..0aa634d0896 100644 --- a/tests/cases/fourslash/quickInfoInInvalidIndexSignature.ts +++ b/tests/cases/fourslash/quickInfoInInvalidIndexSignature.ts @@ -1,6 +1,6 @@ -/// - -//// function method() { var /**/dictionary = <{ [index]: string; }>{}; } - -goTo.marker(); -verify.quickInfoIs('(local var) dictionary: {}'); +/// + +//// function method() { var /**/dictionary = <{ [index]: string; }>{}; } + +goTo.marker(); +verify.quickInfoIs('(local var) dictionary: {}'); diff --git a/tests/cases/fourslash/quickInfoOfLablledForStatementIterator.ts b/tests/cases/fourslash/quickInfoOfLablledForStatementIterator.ts index d1fd6994f77..5091dd0c1c3 100644 --- a/tests/cases/fourslash/quickInfoOfLablledForStatementIterator.ts +++ b/tests/cases/fourslash/quickInfoOfLablledForStatementIterator.ts @@ -1,6 +1,6 @@ -/// - -//// label1: for(var /**/i = 0; i < 1; i++) { } - -goTo.marker(); +/// + +//// label1: for(var /**/i = 0; i < 1; i++) { } + +goTo.marker(); verify.quickInfoExists(); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoOnCatchVariable.ts b/tests/cases/fourslash/quickInfoOnCatchVariable.ts index 5d0af595e91..1ca0aa670d3 100644 --- a/tests/cases/fourslash/quickInfoOnCatchVariable.ts +++ b/tests/cases/fourslash/quickInfoOnCatchVariable.ts @@ -1,9 +1,9 @@ -/// - -//// function f() { -//// try { } catch (/**/e) { } -//// } - -goTo.marker(); -verify.quickInfoExists(); -verify.quickInfoIs("(local var) e: any"); +/// + +//// function f() { +//// try { } catch (/**/e) { } +//// } + +goTo.marker(); +verify.quickInfoExists(); +verify.quickInfoIs("(local var) e: any"); diff --git a/tests/cases/fourslash/recursiveGenerics2.ts b/tests/cases/fourslash/recursiveGenerics2.ts index 6db5e03fc3a..171bc310691 100644 --- a/tests/cases/fourslash/recursiveGenerics2.ts +++ b/tests/cases/fourslash/recursiveGenerics2.ts @@ -1,5 +1,5 @@ -/// - +/// + //// class S18 extends S18 { } //// /**/ diff --git a/tests/cases/fourslash/recursiveInternalModuleImport.ts b/tests/cases/fourslash/recursiveInternalModuleImport.ts index 3f377cb5795..afd94a1de27 100644 --- a/tests/cases/fourslash/recursiveInternalModuleImport.ts +++ b/tests/cases/fourslash/recursiveInternalModuleImport.ts @@ -1,11 +1,11 @@ -/// - -//// module M { -//// import A = B; -//// import /**/B = A; -//// } -//// - -goTo.marker(); -verify.quickInfoExists(); - +/// + +//// module M { +//// import A = B; +//// import /**/B = A; +//// } +//// + +goTo.marker(); +verify.quickInfoExists(); + diff --git a/tests/cases/fourslash/referenceToClass.ts b/tests/cases/fourslash/referenceToClass.ts index 2dd0bdc3e7e..2907a468577 100644 --- a/tests/cases/fourslash/referenceToClass.ts +++ b/tests/cases/fourslash/referenceToClass.ts @@ -1,36 +1,36 @@ -/// - -// Class references should work across file and not find local variables. - -// @Filename: referenceToClass_1.ts -////class /*1*/foo { -//// public n: /*2*/foo; -//// public foo: number; -////} -//// -////class bar { -//// public n: fo/*3*/o; -//// public k = new foo(); -////} -//// -////module mod { -//// var k: foo = null; -////} - -// @Filename: referenceToClass_2.ts -////var k: /*4*/foo; - -goTo.marker("1"); -verify.referencesCountIs(6); - -goTo.marker("2"); - -verify.referencesCountIs(6); - -goTo.marker("3"); - -verify.referencesCountIs(6); - -goTo.marker("4"); - +/// + +// Class references should work across file and not find local variables. + +// @Filename: referenceToClass_1.ts +////class /*1*/foo { +//// public n: /*2*/foo; +//// public foo: number; +////} +//// +////class bar { +//// public n: fo/*3*/o; +//// public k = new foo(); +////} +//// +////module mod { +//// var k: foo = null; +////} + +// @Filename: referenceToClass_2.ts +////var k: /*4*/foo; + +goTo.marker("1"); +verify.referencesCountIs(6); + +goTo.marker("2"); + +verify.referencesCountIs(6); + +goTo.marker("3"); + +verify.referencesCountIs(6); + +goTo.marker("4"); + verify.referencesCountIs(6); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesBloomFilters.ts b/tests/cases/fourslash/referencesBloomFilters.ts index ea7dcfaaf07..3961d557e89 100644 --- a/tests/cases/fourslash/referencesBloomFilters.ts +++ b/tests/cases/fourslash/referencesBloomFilters.ts @@ -1,20 +1,20 @@ -/// - -// Ensure BloomFilter building logic is correct, by having one reference per file - -// @Filename: declaration.ts -////var container = { /*1*/searchProp : 1 }; - -// @Filename: expression.ts -////function blah() { return (1 + 2 + container./*2*/searchProp()) === 2; }; - -// @Filename: stringIndexer.ts -////function blah2() { container[/*3*/"searchProp"] }; - -// @Filename: redeclaration.ts -////container = { /*4*/"searchProp" : 18 }; - -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(4); +/// + +// Ensure BloomFilter building logic is correct, by having one reference per file + +// @Filename: declaration.ts +////var container = { /*1*/searchProp : 1 }; + +// @Filename: expression.ts +////function blah() { return (1 + 2 + container./*2*/searchProp()) === 2; }; + +// @Filename: stringIndexer.ts +////function blah2() { container[/*3*/"searchProp"] }; + +// @Filename: redeclaration.ts +////container = { /*4*/"searchProp" : 18 }; + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(4); }); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesBloomFilters2.ts b/tests/cases/fourslash/referencesBloomFilters2.ts index 7599e2fe96f..ef7643e0215 100644 --- a/tests/cases/fourslash/referencesBloomFilters2.ts +++ b/tests/cases/fourslash/referencesBloomFilters2.ts @@ -1,20 +1,20 @@ -/// - -// Ensure BloomFilter building logic is correct, by having one reference per file - -// @Filename: declaration.ts -////var container = { /*1*/42 : 1 }; - -// @Filename: expression.ts -////function blah() { return (container[/*2*/42]) === 2; }; - -// @Filename: stringIndexer.ts -////function blah2() { container[/*3*/"42"] }; - -// @Filename: redeclaration.ts -////container = { /*4*/"42" : 18 }; - -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(4); +/// + +// Ensure BloomFilter building logic is correct, by having one reference per file + +// @Filename: declaration.ts +////var container = { /*1*/42 : 1 }; + +// @Filename: expression.ts +////function blah() { return (container[/*2*/42]) === 2; }; + +// @Filename: stringIndexer.ts +////function blah2() { container[/*3*/"42"] }; + +// @Filename: redeclaration.ts +////container = { /*4*/"42" : 18 }; + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(4); }); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesBloomFilters3.ts b/tests/cases/fourslash/referencesBloomFilters3.ts index 7056bab2393..65215469950 100644 --- a/tests/cases/fourslash/referencesBloomFilters3.ts +++ b/tests/cases/fourslash/referencesBloomFilters3.ts @@ -1,16 +1,16 @@ -/// - -// Ensure BloomFilter building logic is correct, by having one reference per file - - -// @Filename: declaration.ts -////enum Test { /*1*/"42" = 1 }; - -// @Filename: expression.ts -////(Test[/*2*/42]); - - -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(2); +/// + +// Ensure BloomFilter building logic is correct, by having one reference per file + + +// @Filename: declaration.ts +////enum Test { /*1*/"42" = 1 }; + +// @Filename: expression.ts +////(Test[/*2*/42]); + + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(2); }); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForClassParameter.ts b/tests/cases/fourslash/referencesForClassParameter.ts index 2d0bdf9f9cd..48cdbbf1e41 100644 --- a/tests/cases/fourslash/referencesForClassParameter.ts +++ b/tests/cases/fourslash/referencesForClassParameter.ts @@ -1,26 +1,26 @@ -/// - -// Reference to a class parameter. - -////var p = 2; -//// -////class p { } -//// -////class foo { -//// constructor (public p: any) { -//// } -//// -//// public f(p) { -//// this./*1*/p = p; -//// } -//// -////} -//// -////var n = new foo(undefined); -////n./*2*/p = null; - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); +/// + +// Reference to a class parameter. + +////var p = 2; +//// +////class p { } +//// +////class foo { +//// constructor (public p: any) { +//// } +//// +//// public f(p) { +//// this./*1*/p = p; +//// } +//// +////} +//// +////var n = new foo(undefined); +////n./*2*/p = null; + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForFunctionOverloads.ts b/tests/cases/fourslash/referencesForFunctionOverloads.ts index f27dd8e8461..2a4981ff4a3 100644 --- a/tests/cases/fourslash/referencesForFunctionOverloads.ts +++ b/tests/cases/fourslash/referencesForFunctionOverloads.ts @@ -1,17 +1,17 @@ -/// - -// Function overloads should be highlighted together. - -////function /*1*/foo(x: string); -////function /*2*/foo(x: string, y: number) { -//// /*3*/foo('', 43); -////} - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); -verify.referencesCountIs(3); - -goTo.marker("3"); +/// + +// Function overloads should be highlighted together. + +////function /*1*/foo(x: string); +////function /*2*/foo(x: string, y: number) { +//// /*3*/foo('', 43); +////} + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); +verify.referencesCountIs(3); + +goTo.marker("3"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForFunctionParameter.ts b/tests/cases/fourslash/referencesForFunctionParameter.ts index b8ffc5f639a..fd9189d1b72 100644 --- a/tests/cases/fourslash/referencesForFunctionParameter.ts +++ b/tests/cases/fourslash/referencesForFunctionParameter.ts @@ -1,15 +1,15 @@ -/// - -////var x; -////var n; -//// -////function n(x: number, /*1*/n: number) { -//// /*2*/n = 32; -//// x = n; -////} - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); +/// + +////var x; +////var n; +//// +////function n(x: number, /*1*/n: number) { +//// /*2*/n = 32; +//// x = n; +////} + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts index 4afaedf93e8..b76007624bb 100644 --- a/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts +++ b/tests/cases/fourslash/referencesForGlobalsInExternalModule.ts @@ -1,24 +1,24 @@ -/// - -// Global variable reference. - -////var /*1*/topLevelVar = 2; -////var topLevelVar2 = topLevelVar; -//// -////class /*2*/topLevelClass { } -////var c = new topLevelClass(); -//// -////interface topLevelInterface { } -////var i: /*3*/topLevelInterface; -//// -////module topLevelModule { -//// export var x; -////} -////var x = /*4*/topLevelModule.x; -//// -////export = x; - -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(2); +/// + +// Global variable reference. + +////var /*1*/topLevelVar = 2; +////var topLevelVar2 = topLevelVar; +//// +////class /*2*/topLevelClass { } +////var c = new topLevelClass(); +//// +////interface topLevelInterface { } +////var i: /*3*/topLevelInterface; +//// +////module topLevelModule { +//// export var x; +////} +////var x = /*4*/topLevelModule.x; +//// +////export = x; + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(2); }); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForIllegalAssignment.ts b/tests/cases/fourslash/referencesForIllegalAssignment.ts index 6c7d228d3e7..81a45f64153 100644 --- a/tests/cases/fourslash/referencesForIllegalAssignment.ts +++ b/tests/cases/fourslash/referencesForIllegalAssignment.ts @@ -1,21 +1,21 @@ -/// - -////f/*1*/oo = fo/*2*/o; - -////var /*3*/bar = function () { }; -////ba/*4*/r = b/*5*/ar + 1; - -goTo.marker("1"); -verify.referencesCountIs(1); - -goTo.marker("2"); -verify.referencesCountIs(1); - -goTo.marker("3"); -verify.referencesCountIs(3); - -goTo.marker("4"); -verify.referencesCountIs(3); - -goTo.marker("5"); +/// + +////f/*1*/oo = fo/*2*/o; + +////var /*3*/bar = function () { }; +////ba/*4*/r = b/*5*/ar + 1; + +goTo.marker("1"); +verify.referencesCountIs(1); + +goTo.marker("2"); +verify.referencesCountIs(1); + +goTo.marker("3"); +verify.referencesCountIs(3); + +goTo.marker("4"); +verify.referencesCountIs(3); + +goTo.marker("5"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForIndexProperty.ts b/tests/cases/fourslash/referencesForIndexProperty.ts index 96ae1ff05e3..89084a2ef05 100644 --- a/tests/cases/fourslash/referencesForIndexProperty.ts +++ b/tests/cases/fourslash/referencesForIndexProperty.ts @@ -1,18 +1,18 @@ -/// - -// References a class property using string index access - -////class Foo { -//// property: number; -//// method(): void { } -////} -//// -////var f: Foo; -////f[/*1*/"property"]; -////f[/*2*/"method"]; - -goTo.marker("1"); -verify.referencesCountIs(2); - -goTo.marker("2"); -verify.referencesCountIs(2); +/// + +// References a class property using string index access + +////class Foo { +//// property: number; +//// method(): void { } +////} +//// +////var f: Foo; +////f[/*1*/"property"]; +////f[/*2*/"method"]; + +goTo.marker("1"); +verify.referencesCountIs(2); + +goTo.marker("2"); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/referencesForIndexProperty2.ts b/tests/cases/fourslash/referencesForIndexProperty2.ts index a84adf672a1..fd9cf0e7183 100644 --- a/tests/cases/fourslash/referencesForIndexProperty2.ts +++ b/tests/cases/fourslash/referencesForIndexProperty2.ts @@ -1,9 +1,9 @@ -/// - -// References to a unknown index property - -////var a; -////a[/*1*/"blah"]; - -goTo.marker("1"); +/// + +// References to a unknown index property + +////var a; +////a[/*1*/"blah"]; + +goTo.marker("1"); verify.referencesCountIs(1); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForIndexProperty3.ts b/tests/cases/fourslash/referencesForIndexProperty3.ts index 72a2b560b4f..07081f8c17d 100644 --- a/tests/cases/fourslash/referencesForIndexProperty3.ts +++ b/tests/cases/fourslash/referencesForIndexProperty3.ts @@ -1,19 +1,19 @@ -/// - -// References to a property of the apparent type using string indexer - -////interface Object { -//// toMyString(); -////} -//// -////var y: Object; -////y./*1*/toMyString(); -//// -////var x = {}; -////x[/*2*/"toMyString"](); - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); -verify.referencesCountIs(3); +/// + +// References to a property of the apparent type using string indexer + +////interface Object { +//// toMyString(); +////} +//// +////var y: Object; +////y./*1*/toMyString(); +//// +////var x = {}; +////x[/*2*/"toMyString"](); + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); +verify.referencesCountIs(3); diff --git a/tests/cases/fourslash/referencesForLabel.ts b/tests/cases/fourslash/referencesForLabel.ts index ee5df8049c0..f79e038ca0a 100644 --- a/tests/cases/fourslash/referencesForLabel.ts +++ b/tests/cases/fourslash/referencesForLabel.ts @@ -1,23 +1,23 @@ -/// - -// Valid References for a label - -/////*1*/label: while (true) { -//// if (false) break /*2*/label; -//// if (true) continue /*3*/label; -////} -//// -/////*4*/label: while (false) { } -////var label = "label"; - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); -verify.referencesCountIs(3); - -goTo.marker("3"); -verify.referencesCountIs(3); - -goTo.marker("4"); +/// + +// Valid References for a label + +/////*1*/label: while (true) { +//// if (false) break /*2*/label; +//// if (true) continue /*3*/label; +////} +//// +/////*4*/label: while (false) { } +////var label = "label"; + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); +verify.referencesCountIs(3); + +goTo.marker("3"); +verify.referencesCountIs(3); + +goTo.marker("4"); verify.referencesCountIs(1); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForLabel2.ts b/tests/cases/fourslash/referencesForLabel2.ts index 96467158cca..054ce562864 100644 --- a/tests/cases/fourslash/referencesForLabel2.ts +++ b/tests/cases/fourslash/referencesForLabel2.ts @@ -1,12 +1,12 @@ -/// - -// References to undefined label - -////var label = "label"; -////while (true) { -//// if (false) break /*1*/label; -//// if (true) continue label; -////} - -goTo.marker("1"); -verify.referencesCountIs(1); +/// + +// References to undefined label + +////var label = "label"; +////while (true) { +//// if (false) break /*1*/label; +//// if (true) continue label; +////} + +goTo.marker("1"); +verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/referencesForLabel3.ts b/tests/cases/fourslash/referencesForLabel3.ts index 5a4c3893211..9c621909c34 100644 --- a/tests/cases/fourslash/referencesForLabel3.ts +++ b/tests/cases/fourslash/referencesForLabel3.ts @@ -1,10 +1,10 @@ -/// - -// References to unused label - -/////*1*/label: while (true) { -//// var label = "label"; -////} - -goTo.marker("1"); -verify.referencesCountIs(1); +/// + +// References to unused label + +/////*1*/label: while (true) { +//// var label = "label"; +////} + +goTo.marker("1"); +verify.referencesCountIs(1); diff --git a/tests/cases/fourslash/referencesForLabel4.ts b/tests/cases/fourslash/referencesForLabel4.ts index 4288046ecec..d9817b2d857 100644 --- a/tests/cases/fourslash/referencesForLabel4.ts +++ b/tests/cases/fourslash/referencesForLabel4.ts @@ -1,15 +1,15 @@ -/// - -// References to a label outside function bounderies - -/////*1*/label: function foo(label) { -//// while (true) { -//// break /*2*/label; -//// } -////} - -goTo.marker("1"); -verify.referencesCountIs(2); - -goTo.marker("2"); -verify.referencesCountIs(2); +/// + +// References to a label outside function bounderies + +/////*1*/label: function foo(label) { +//// while (true) { +//// break /*2*/label; +//// } +////} + +goTo.marker("1"); +verify.referencesCountIs(2); + +goTo.marker("2"); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/referencesForLabel5.ts b/tests/cases/fourslash/referencesForLabel5.ts index 0a465a89f2f..dba59ec79ab 100644 --- a/tests/cases/fourslash/referencesForLabel5.ts +++ b/tests/cases/fourslash/referencesForLabel5.ts @@ -1,28 +1,28 @@ -/// - -// References to shadowed label - -/////*outer1*/label: while (true) { -//// if (false) break /*outer2*/label; -//// function blah() { -/////*inner1*/label: while (true) { -//// if (false) break /*inner2*/label; -//// } -//// } -//// if (false) break /*outer3*/label; -//// } - -goTo.marker("outer1"); -verify.referencesCountIs(3); - -goTo.marker("outer2"); -verify.referencesCountIs(3); - -goTo.marker("outer3"); -verify.referencesCountIs(3); - -goTo.marker("inner1"); -verify.referencesCountIs(2); - -goTo.marker("inner2"); -verify.referencesCountIs(2); +/// + +// References to shadowed label + +/////*outer1*/label: while (true) { +//// if (false) break /*outer2*/label; +//// function blah() { +/////*inner1*/label: while (true) { +//// if (false) break /*inner2*/label; +//// } +//// } +//// if (false) break /*outer3*/label; +//// } + +goTo.marker("outer1"); +verify.referencesCountIs(3); + +goTo.marker("outer2"); +verify.referencesCountIs(3); + +goTo.marker("outer3"); +verify.referencesCountIs(3); + +goTo.marker("inner1"); +verify.referencesCountIs(2); + +goTo.marker("inner2"); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/referencesForLabel6.ts b/tests/cases/fourslash/referencesForLabel6.ts index 83c3c8a2fc1..a9aab59c467 100644 --- a/tests/cases/fourslash/referencesForLabel6.ts +++ b/tests/cases/fourslash/referencesForLabel6.ts @@ -1,14 +1,14 @@ -/// - -// References to lable wiht close names - -/////*1*/labela: while (true) { -/////*2*/labelb: while (false) { break labelb; } -//// break labelc; -////} - -goTo.marker("1"); -verify.referencesCountIs(1); - -goTo.marker("2"); +/// + +// References to lable wiht close names + +/////*1*/labela: while (true) { +/////*2*/labelb: while (false) { break labelb; } +//// break labelc; +////} + +goTo.marker("1"); +verify.referencesCountIs(1); + +goTo.marker("2"); verify.referencesCountIs(2); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForMergedDeclarations.ts b/tests/cases/fourslash/referencesForMergedDeclarations.ts index 51ad4ea8ce8..a475780b66e 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations.ts @@ -1,5 +1,5 @@ -/// - +/// + ////interface /*type1*/Foo { ////} //// @@ -12,10 +12,10 @@ //// ////var f1: /*namespace2*/Foo.Bar; ////var f2: /*type2*/Foo; -/////*value2*/Foo.bind(this); - - -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(2); -}); +/////*value2*/Foo.bind(this); + + +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(2); +}); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations3.ts b/tests/cases/fourslash/referencesForMergedDeclarations3.ts index c673f89179e..80cf1fb9e42 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations3.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations3.ts @@ -1,4 +1,4 @@ -/// +/// // class and uninstanciated module @@ -18,22 +18,22 @@ /////*class2*/testClass.staticMethod(); /////*class3*/testClass.prototype.method(); /////*class4*/testClass.bind(this); -////new /*class5*/testClass(); - -goTo.marker("module"); -verify.referencesCountIs(2); - -goTo.marker("class1"); -verify.referencesCountIs(6); - -goTo.marker("class2"); -verify.referencesCountIs(6); - -goTo.marker("class3"); -verify.referencesCountIs(6); - -goTo.marker("class4"); -verify.referencesCountIs(6); - -goTo.marker("class5"); +////new /*class5*/testClass(); + +goTo.marker("module"); +verify.referencesCountIs(2); + +goTo.marker("class1"); +verify.referencesCountIs(6); + +goTo.marker("class2"); +verify.referencesCountIs(6); + +goTo.marker("class3"); +verify.referencesCountIs(6); + +goTo.marker("class4"); +verify.referencesCountIs(6); + +goTo.marker("class5"); verify.referencesCountIs(6); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForMergedDeclarations4.ts b/tests/cases/fourslash/referencesForMergedDeclarations4.ts index 18386594631..88faf672fcc 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations4.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations4.ts @@ -1,4 +1,4 @@ -/// +/// // class and instanciated module @@ -20,10 +20,10 @@ /////*4*/testClass.prototype.method(); /////*5*/testClass.bind(this); /////*6*/testClass.s; -////new /*7*/testClass(); - -// Instanciated Module and class intersect in the value space, so we consider them all one group -test.markers().forEach(m => { - goTo.position(m.position, m.fileName); - verify.referencesCountIs(9); -}); +////new /*7*/testClass(); + +// Instanciated Module and class intersect in the value space, so we consider them all one group +test.markers().forEach(m => { + goTo.position(m.position, m.fileName); + verify.referencesCountIs(9); +}); diff --git a/tests/cases/fourslash/referencesForMergedDeclarations5.ts b/tests/cases/fourslash/referencesForMergedDeclarations5.ts index cf4ddea31d7..deb7ad321c9 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations5.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations5.ts @@ -1,10 +1,10 @@ -/// - -////interface Foo { } -////module Foo { export interface Bar { } } -////function Foo() { } -//// -////export = /*1*/Foo; - -goTo.marker("1"); +/// + +////interface Foo { } +////module Foo { export interface Bar { } } +////function Foo() { } +//// +////export = /*1*/Foo; + +goTo.marker("1"); verify.referencesCountIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForMergedDeclarations7.ts b/tests/cases/fourslash/referencesForMergedDeclarations7.ts index 7a86362907c..1c6d730797f 100644 --- a/tests/cases/fourslash/referencesForMergedDeclarations7.ts +++ b/tests/cases/fourslash/referencesForMergedDeclarations7.ts @@ -1,14 +1,14 @@ -/// - -////interface Foo { } -////module Foo { +/// + +////interface Foo { } +////module Foo { //// export interface Bar { } //// export module Bar { export interface Baz { } } //// export function Bar() { } -////} -//// -////// module, value and type -////import a2 = Foo./*1*/Bar; - -goTo.marker("1"); +////} +//// +////// module, value and type +////import a2 = Foo./*1*/Bar; + +goTo.marker("1"); verify.referencesCountIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForNoContext.ts b/tests/cases/fourslash/referencesForNoContext.ts index 4fe0753da6f..ee9391e5416 100644 --- a/tests/cases/fourslash/referencesForNoContext.ts +++ b/tests/cases/fourslash/referencesForNoContext.ts @@ -1,34 +1,34 @@ -/// - -////module modTest { -//// //Declare -//// export var modVar:number; -//// /*1*/ -//// -//// //Increments -//// modVar++; -//// -//// class testCls{ -//// /*2*/ -//// } -//// -//// function testFn(){ -//// //Increments -//// modVar++; -//// } /*3*/ -/////*4*/ -//// module testMod { -//// } -////} - -goTo.marker("1"); -verify.referencesCountIs(0); - -goTo.marker("2"); -verify.referencesCountIs(0); - -goTo.marker("3"); -verify.referencesCountIs(0); - -goTo.marker("4"); -verify.referencesCountIs(0); +/// + +////module modTest { +//// //Declare +//// export var modVar:number; +//// /*1*/ +//// +//// //Increments +//// modVar++; +//// +//// class testCls{ +//// /*2*/ +//// } +//// +//// function testFn(){ +//// //Increments +//// modVar++; +//// } /*3*/ +/////*4*/ +//// module testMod { +//// } +////} + +goTo.marker("1"); +verify.referencesCountIs(0); + +goTo.marker("2"); +verify.referencesCountIs(0); + +goTo.marker("3"); +verify.referencesCountIs(0); + +goTo.marker("4"); +verify.referencesCountIs(0); diff --git a/tests/cases/fourslash/referencesForObjectLiteralProperties.ts b/tests/cases/fourslash/referencesForObjectLiteralProperties.ts index c606e2f13f3..8515a5487b7 100644 --- a/tests/cases/fourslash/referencesForObjectLiteralProperties.ts +++ b/tests/cases/fourslash/referencesForObjectLiteralProperties.ts @@ -1,15 +1,15 @@ -/// - -// References to an object literal property - +/// + +// References to an object literal property + ////var x = { /*1*/add: 0, b: "string" }; ////x["add"]; ////x./*2*/add; ////var y = x; -////y.add; - -goTo.marker("1"); -verify.referencesCountIs(4); - -goTo.marker("2"); +////y.add; + +goTo.marker("1"); +verify.referencesCountIs(4); + +goTo.marker("2"); verify.referencesCountIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForOverrides.ts b/tests/cases/fourslash/referencesForOverrides.ts index df3a6f208a0..2b67269a6f3 100644 --- a/tests/cases/fourslash/referencesForOverrides.ts +++ b/tests/cases/fourslash/referencesForOverrides.ts @@ -1,84 +1,84 @@ -/// - -////module FindRef3 { -//// module SimpleClassTest { -//// export class Foo { -//// public foo(): void { -//// } -//// } -//// export class Bar extends Foo { -//// public foo(): void { -//// } -//// } -//// } -//// -//// module SimpleInterfaceTest { -//// export interface IFoo { -//// foo(): void; -//// } -//// export interface IBar extends IFoo { -//// foo(): void; -//// } -//// } -//// -//// module SimpleClassInterfaceTest { -//// export interface IFoo { -//// foo(): void; -//// } -//// export class Bar implements IFoo { -//// public foo(): void { -//// } -//// } -//// } -//// -//// module Test { -//// export interface IBase { -//// field: string; -//// method(): void; -//// } -//// -//// export interface IBlah extends IBase { -//// field: string; -//// } -//// -//// export interface IBlah2 extends IBlah { -//// field: string; -//// } -//// -//// export interface IDerived extends IBlah2 { -//// method(): void; -//// } -//// -//// export class Bar implements IDerived { -//// public field: string; -//// public method(): void { } -//// } -//// -//// export class BarBlah extends Bar { -//// public field: string; -//// } -//// } -//// -//// function test() { -//// var x = new SimpleClassTest.Bar(); -//// x.fo/*1*/o(); -//// -//// var y: SimpleInterfaceTest.IBar = null; -//// y.fo/*2*/o(); -//// -//// var z = new Test.BarBlah(); -//// z.fi/*3*/eld = ""; -//// } -////} - -// References to a field declared in a base class. -goTo.marker("1"); -verify.referencesCountIs(3); - -// References to a field declared in a base interface. -goTo.marker("2"); -verify.referencesCountIs(3); - -// References to a field declared in a chain of base class and interfaces. -goTo.marker("3"); -verify.referencesCountIs(6); +/// + +////module FindRef3 { +//// module SimpleClassTest { +//// export class Foo { +//// public foo(): void { +//// } +//// } +//// export class Bar extends Foo { +//// public foo(): void { +//// } +//// } +//// } +//// +//// module SimpleInterfaceTest { +//// export interface IFoo { +//// foo(): void; +//// } +//// export interface IBar extends IFoo { +//// foo(): void; +//// } +//// } +//// +//// module SimpleClassInterfaceTest { +//// export interface IFoo { +//// foo(): void; +//// } +//// export class Bar implements IFoo { +//// public foo(): void { +//// } +//// } +//// } +//// +//// module Test { +//// export interface IBase { +//// field: string; +//// method(): void; +//// } +//// +//// export interface IBlah extends IBase { +//// field: string; +//// } +//// +//// export interface IBlah2 extends IBlah { +//// field: string; +//// } +//// +//// export interface IDerived extends IBlah2 { +//// method(): void; +//// } +//// +//// export class Bar implements IDerived { +//// public field: string; +//// public method(): void { } +//// } +//// +//// export class BarBlah extends Bar { +//// public field: string; +//// } +//// } +//// +//// function test() { +//// var x = new SimpleClassTest.Bar(); +//// x.fo/*1*/o(); +//// +//// var y: SimpleInterfaceTest.IBar = null; +//// y.fo/*2*/o(); +//// +//// var z = new Test.BarBlah(); +//// z.fi/*3*/eld = ""; +//// } +////} + +// References to a field declared in a base class. +goTo.marker("1"); +verify.referencesCountIs(3); + +// References to a field declared in a base interface. +goTo.marker("2"); +verify.referencesCountIs(3); + +// References to a field declared in a chain of base class and interfaces. +goTo.marker("3"); +verify.referencesCountIs(6); diff --git a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts index e5428df0d5d..c611c40fc89 100644 --- a/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts +++ b/tests/cases/fourslash/referencesForPropertiesOfGenericType.ts @@ -1,5 +1,5 @@ -/// - +/// + ////interface IFoo { //// /*1*/doSomething(v: T): T; ////} @@ -8,8 +8,8 @@ ////x.doSomething("ss"); //// ////var y: IFoo; -////y.doSomething(12); - - -goTo.marker("1"); +////y.doSomething(12); + + +goTo.marker("1"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForStatic.ts b/tests/cases/fourslash/referencesForStatic.ts index 97a88a92782..34b34e2d474 100644 --- a/tests/cases/fourslash/referencesForStatic.ts +++ b/tests/cases/fourslash/referencesForStatic.ts @@ -1,40 +1,40 @@ -/// - -// Reference a class static. - -// @Filename: referencesOnStatic_1.ts -////var n = 43; -//// -////class foo { -//// static n = ''; -//// -//// public bar() { -//// foo./*1*/n = "'"; -//// if(foo.n) { -//// var x = foo.n; -//// } -//// } -////} -//// -////class foo2 { -//// private x = foo./*2*/n; -//// constructor() { -//// foo./*3*/n = x; -//// } -//// -//// function b(n) { -//// n = foo.n; -//// } -////} - -// @Filename: referencesOnStatic_2.ts -////var q = foo.n; - -goTo.marker("1"); -verify.referencesCountIs(8); - -goTo.marker("2"); -verify.referencesCountIs(8); - -goTo.marker("3"); +/// + +// Reference a class static. + +// @Filename: referencesOnStatic_1.ts +////var n = 43; +//// +////class foo { +//// static n = ''; +//// +//// public bar() { +//// foo./*1*/n = "'"; +//// if(foo.n) { +//// var x = foo.n; +//// } +//// } +////} +//// +////class foo2 { +//// private x = foo./*2*/n; +//// constructor() { +//// foo./*3*/n = x; +//// } +//// +//// function b(n) { +//// n = foo.n; +//// } +////} + +// @Filename: referencesOnStatic_2.ts +////var q = foo.n; + +goTo.marker("1"); +verify.referencesCountIs(8); + +goTo.marker("2"); +verify.referencesCountIs(8); + +goTo.marker("3"); verify.referencesCountIs(8); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts index 15ae06e0560..fe83f47757b 100644 --- a/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts +++ b/tests/cases/fourslash/referencesForStaticsAndMembersWithSameNames.ts @@ -1,49 +1,49 @@ -/// - -////module FindRef4 { -//// module MixedStaticsClassTest { -//// export class Foo { -//// b/*3*/ar: Foo; -//// static b/*4*/ar: Foo; -//// -//// public f/*1*/oo(): void { -//// } -//// public static f/*2*/oo(): void { -//// } -//// } -//// } -//// -//// function test() { -//// // instance function -//// var x = new MixedStaticsClassTest.Foo(); -//// x.foo(); -//// x.bar; -//// -//// var y = new MixedStaticsClassTest.Foo(); -//// y.foo(); -//// y.bar; -//// -//// // static function -//// MixedStaticsClassTest.Foo.foo(); -//// MixedStaticsClassTest.Foo.bar; -//// } -////} - +/// + +////module FindRef4 { +//// module MixedStaticsClassTest { +//// export class Foo { +//// b/*3*/ar: Foo; +//// static b/*4*/ar: Foo; +//// +//// public f/*1*/oo(): void { +//// } +//// public static f/*2*/oo(): void { +//// } +//// } +//// } +//// +//// function test() { +//// // instance function +//// var x = new MixedStaticsClassTest.Foo(); +//// x.foo(); +//// x.bar; +//// +//// var y = new MixedStaticsClassTest.Foo(); +//// y.foo(); +//// y.bar; +//// +//// // static function +//// MixedStaticsClassTest.Foo.foo(); +//// MixedStaticsClassTest.Foo.bar; +//// } +////} + // this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -// References to a member method with the same name as a static. -goTo.marker("1"); -verify.referencesCountIs(3); - -// References to a static method with the same name as a member. -goTo.marker("2"); -verify.referencesCountIs(2); - -// References to a member property with the same name as a static. -goTo.marker("3"); -verify.referencesCountIs(3); - -// References to a static property with the same name as a member. -goTo.marker("4"); -verify.referencesCountIs(2); +edit.insert(''); + +// References to a member method with the same name as a static. +goTo.marker("1"); +verify.referencesCountIs(3); + +// References to a static method with the same name as a member. +goTo.marker("2"); +verify.referencesCountIs(2); + +// References to a member property with the same name as a static. +goTo.marker("3"); +verify.referencesCountIs(3); + +// References to a static property with the same name as a member. +goTo.marker("4"); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts index 86ce18abb84..67b956dcd02 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames2.ts @@ -1,15 +1,15 @@ -/// - +/// + ////class Foo { //// /*1*/"blah"() { return 0; } ////} //// ////var x: Foo; ////x./*2*/blah; - - -goTo.marker("1"); -verify.referencesCountIs(2); - -goTo.marker("2"); -verify.referencesCountIs(2); + + +goTo.marker("1"); +verify.referencesCountIs(2); + +goTo.marker("2"); +verify.referencesCountIs(2); diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts index 59ab77e584b..3288aec9b92 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames3.ts @@ -1,15 +1,15 @@ -/// - +/// + ////class Foo2 { //// get /*1*/"42"() { return 0; } //// set /*2*/42(n) { } ////} //// ////var y: Foo2; -////y[42]; - -goTo.marker("1"); -verify.referencesCountIs(3); - -goTo.marker("2"); +////y[42]; + +goTo.marker("1"); +verify.referencesCountIs(3); + +goTo.marker("2"); verify.referencesCountIs(3); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts b/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts index 8c6292143ab..08d04188ee9 100644 --- a/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts +++ b/tests/cases/fourslash/referencesForStringLiteralPropertyNames4.ts @@ -1,8 +1,8 @@ -/// - -////var x = { "[|someProperty|]": 0 } -////x["[|someProperty|]"] = 3; -////x./*1*/[|someProperty|] = 5; - -goTo.marker("1"); +/// + +////var x = { "[|someProperty|]": 0 } +////x["[|someProperty|]"] = 3; +////x./*1*/[|someProperty|] = 5; + +goTo.marker("1"); test.ranges().forEach(r => verify.referencesAtPositionContains(r)); \ No newline at end of file diff --git a/tests/cases/fourslash/referencesForUnionProperties.ts b/tests/cases/fourslash/referencesForUnionProperties.ts index f4ef85e8e4e..d5f0a2fd516 100644 --- a/tests/cases/fourslash/referencesForUnionProperties.ts +++ b/tests/cases/fourslash/referencesForUnionProperties.ts @@ -4,15 +4,15 @@ //// common: { /*1*/a: number; }; ////} //// -////interface Base { -//// /*2*/a: string; -//// b: string; -////} +////interface Base { +//// /*2*/a: string; +//// b: string; +////} //// -////interface HasAOrB extends Base { -//// /*3*/a: string; -//// b: string; -////} +////interface HasAOrB extends Base { +//// /*3*/a: string; +//// b: string; +////} //// ////interface Two { //// common: HasAOrB; diff --git a/tests/cases/fourslash/referencesInComment.ts b/tests/cases/fourslash/referencesInComment.ts index f6a9fcdb0f1..7ae9fdec9d2 100644 --- a/tests/cases/fourslash/referencesInComment.ts +++ b/tests/cases/fourslash/referencesInComment.ts @@ -1,18 +1,18 @@ -/// - -////// References to /*1*/foo or b/*2*/ar -/////* in comments should not find fo/*3*/o or bar/*4*/ */ -////class foo { } -////var bar = 0; - -goTo.marker("1"); -verify.referencesCountIs(0); - -goTo.marker("2"); -verify.referencesCountIs(0); - -goTo.marker("3"); -verify.referencesCountIs(0); - -goTo.marker("4"); +/// + +////// References to /*1*/foo or b/*2*/ar +/////* in comments should not find fo/*3*/o or bar/*4*/ */ +////class foo { } +////var bar = 0; + +goTo.marker("1"); +verify.referencesCountIs(0); + +goTo.marker("2"); +verify.referencesCountIs(0); + +goTo.marker("3"); +verify.referencesCountIs(0); + +goTo.marker("4"); verify.referencesCountIs(0); \ No newline at end of file diff --git a/tests/cases/fourslash/regexDetection.ts b/tests/cases/fourslash/regexDetection.ts index 03ad81f63b0..585e25cebac 100644 --- a/tests/cases/fourslash/regexDetection.ts +++ b/tests/cases/fourslash/regexDetection.ts @@ -1,15 +1,15 @@ -/// - -//// /*1*/15 / /*2*/Math.min(61 / /*3*/42, 32 / 15) / /*4*/15; - -goTo.marker("1"); -verify.not.quickInfoExists(); - -goTo.marker("2"); -verify.not.quickInfoIs('RegExp'); - -goTo.marker("3"); -verify.not.quickInfoExists(); - -goTo.marker("4"); +/// + +//// /*1*/15 / /*2*/Math.min(61 / /*3*/42, 32 / 15) / /*4*/15; + +goTo.marker("1"); +verify.not.quickInfoExists(); + +goTo.marker("2"); +verify.not.quickInfoIs('RegExp'); + +goTo.marker("3"); +verify.not.quickInfoExists(); + +goTo.marker("4"); verify.not.quickInfoExists(); \ No newline at end of file diff --git a/tests/cases/fourslash/regexErrorRecovery.ts b/tests/cases/fourslash/regexErrorRecovery.ts index 8b5a0e5e65e..4f46249552e 100644 --- a/tests/cases/fourslash/regexErrorRecovery.ts +++ b/tests/cases/fourslash/regexErrorRecovery.ts @@ -1,13 +1,13 @@ -/// - -//// // test code -//////var x = //**/a/;/*1*/ -//////x.exec("bab"); - -//goTo.marker(""); -//debug.printCurrentFileState(); -//verify.quickInfoIs("RegExp"); -//// Bug 579071: Parser no longer detects a Regex when an open bracket is inserted -edit.insert("("); -////verify.quickInfoIs("RegExp"); +/// + +//// // test code +//////var x = //**/a/;/*1*/ +//////x.exec("bab"); + +//goTo.marker(""); +//debug.printCurrentFileState(); +//verify.quickInfoIs("RegExp"); +//// Bug 579071: Parser no longer detects a Regex when an open bracket is inserted +edit.insert("("); +////verify.quickInfoIs("RegExp"); ////verify.not.errorExistsAfterMarker("1"); \ No newline at end of file diff --git a/tests/cases/fourslash/remoteGetReferences.ts b/tests/cases/fourslash/remoteGetReferences.ts index 1bf857f24f5..cdc4ab035a3 100644 --- a/tests/cases/fourslash/remoteGetReferences.ts +++ b/tests/cases/fourslash/remoteGetReferences.ts @@ -1,202 +1,202 @@ -/// - -// @Filename: remoteGetReferences_1.ts -////// Comment Refence Test: globalVar -////var globalVar: number = 2; -//// -////class fooCls { -//// static clsSVar = 1; -//// //Declare -//// clsVar = 1; -//// -//// constructor (public clsParam: number) { -//// //Increments -//// globalVar++; -//// this.clsVar++; -//// fooCls.clsSVar++; -//// this.clsParam++; -//// modTest.modVar++; -//// } -////} -//// -////function foo(x: number) { -//// //Declare -//// var fnVar = 1; -//// -//// //Increments -//// fooCls.clsSVar++; -//// globalVar++; -//// modTest.modVar++; -//// fnVar++; -//// -//// //Return -//// return x++; -////} -//// -////module modTest { -//// //Declare -//// export var modVar:number; -//// -//// //Increments -//// globalVar++; -//// fooCls.clsSVar++; -//// modVar++; -//// -//// class testCls { -//// static boo = foo; -//// } -//// -//// function testFn(){ -//// static boo = foo; -//// -//// //Increments -//// globalVar++; -//// fooCls.clsSVar++; -//// modVar++; -//// } -//// -//// module testMod { -//// var boo = foo; -//// } -////} -//// -//////Type test -////var clsTest: fooCls; -//// -//////Arguments -////clsTest = new fooCls(globalVar); -////foo(globalVar); -//// -//////Increments -////fooCls.clsSVar++; -////modTest.modVar++; -////globalVar = globalVar + globalVar; -//// -//////ETC - Other cases -////globalVar = 3; -////foo = foo + 1; -////err = err++; -//// -//////Shadowed fn Parameter -////function shdw(globalVar: number) { -//// //Increments -//// globalVar++; -//// return globalVar; -////} -//// -//////Remotes -//////Type test -////var remoteclsTest: rem/*2*/otefooCls; -//// -//////Arguments -////remoteclsTest = new remotefooCls(remoteglo/*4*/balVar); -////remotefoo(remotegl/*3*/obalVar); -//// -//////Increments -////remotefooCls.remoteclsSVar++; -////remotemodTest.remotemodVar++; -/////*1*/remoteglobalVar = remoteglobalVar + remoteglobalVar; -//// -//////ETC - Other cases -////remoteglobalVar = 3; -//// -//////Find References misses method param -////var -//// -//// -//// -//// array = ["f", "o", "o"]; -//// -////array.forEach( -//// -//// -////function(str) { -//// -//// -//// -//// return str + " "; -//// -////}); - -// @Filename: remoteGetReferences_2.ts -////var remoteglobalVar: number = 2; -//// -////class remotefooCls { -//// //Declare -//// rem/*5*/oteclsVar = 1; -//// static r/*6*/emoteclsSVar = 1; -//// -//// constructor(public remoteclsParam: number) { -//// //Increments -//// remoteglobalVar++; -//// this.remoteclsVar++; -//// remotefooCls.remoteclsSVar++; -//// this.remoteclsParam++; -//// remotemodTest.remotemodVar++; -//// } -////} -//// -////function remotefoo(remotex: number) { -//// //Declare -//// var remotefnVar = 1; -//// -//// //Increments -//// remotefooCls.remoteclsSVar++; -//// remoteglobalVar++; -//// remotemodTest.remotemodVar++; -//// remotefnVar++; -//// -//// //Return -//// return remotex++; -////} -//// -////module remotemodTest { -//// //Declare -//// export var remotemodVar: number; -//// -//// //Increments -//// remoteglobalVar++; -//// remotefooCls.remoteclsSVar++; -//// remotemodVar++; -//// -//// class remotetestCls { -//// static remoteboo = remotefoo; -//// } -//// -//// function remotetestFn(){ -//// static remoteboo = remotefoo; -//// -//// //Increments -//// remoteglobalVar++; -//// remotefooCls.remoteclsSVar++; -//// remotemodVar++; -//// } -//// -//// module remotetestMod { -//// var remoteboo = remotefoo; -//// } -////} - -// References to a variable declared in global. -goTo.marker("1"); -verify.referencesCountIs(11); - -// References to a type. -goTo.marker("2"); -verify.referencesCountIs(8); - -// References to a function argument. -goTo.marker("3"); -verify.referencesCountIs(11); - -// References to a class argument. -goTo.marker("4"); -verify.referencesCountIs(11); - -// References to a variable declared in a class. -goTo.marker("5"); -verify.referencesCountIs(2); - -// References to static variable declared in a class. -goTo.marker("6"); +/// + +// @Filename: remoteGetReferences_1.ts +////// Comment Refence Test: globalVar +////var globalVar: number = 2; +//// +////class fooCls { +//// static clsSVar = 1; +//// //Declare +//// clsVar = 1; +//// +//// constructor (public clsParam: number) { +//// //Increments +//// globalVar++; +//// this.clsVar++; +//// fooCls.clsSVar++; +//// this.clsParam++; +//// modTest.modVar++; +//// } +////} +//// +////function foo(x: number) { +//// //Declare +//// var fnVar = 1; +//// +//// //Increments +//// fooCls.clsSVar++; +//// globalVar++; +//// modTest.modVar++; +//// fnVar++; +//// +//// //Return +//// return x++; +////} +//// +////module modTest { +//// //Declare +//// export var modVar:number; +//// +//// //Increments +//// globalVar++; +//// fooCls.clsSVar++; +//// modVar++; +//// +//// class testCls { +//// static boo = foo; +//// } +//// +//// function testFn(){ +//// static boo = foo; +//// +//// //Increments +//// globalVar++; +//// fooCls.clsSVar++; +//// modVar++; +//// } +//// +//// module testMod { +//// var boo = foo; +//// } +////} +//// +//////Type test +////var clsTest: fooCls; +//// +//////Arguments +////clsTest = new fooCls(globalVar); +////foo(globalVar); +//// +//////Increments +////fooCls.clsSVar++; +////modTest.modVar++; +////globalVar = globalVar + globalVar; +//// +//////ETC - Other cases +////globalVar = 3; +////foo = foo + 1; +////err = err++; +//// +//////Shadowed fn Parameter +////function shdw(globalVar: number) { +//// //Increments +//// globalVar++; +//// return globalVar; +////} +//// +//////Remotes +//////Type test +////var remoteclsTest: rem/*2*/otefooCls; +//// +//////Arguments +////remoteclsTest = new remotefooCls(remoteglo/*4*/balVar); +////remotefoo(remotegl/*3*/obalVar); +//// +//////Increments +////remotefooCls.remoteclsSVar++; +////remotemodTest.remotemodVar++; +/////*1*/remoteglobalVar = remoteglobalVar + remoteglobalVar; +//// +//////ETC - Other cases +////remoteglobalVar = 3; +//// +//////Find References misses method param +////var +//// +//// +//// +//// array = ["f", "o", "o"]; +//// +////array.forEach( +//// +//// +////function(str) { +//// +//// +//// +//// return str + " "; +//// +////}); + +// @Filename: remoteGetReferences_2.ts +////var remoteglobalVar: number = 2; +//// +////class remotefooCls { +//// //Declare +//// rem/*5*/oteclsVar = 1; +//// static r/*6*/emoteclsSVar = 1; +//// +//// constructor(public remoteclsParam: number) { +//// //Increments +//// remoteglobalVar++; +//// this.remoteclsVar++; +//// remotefooCls.remoteclsSVar++; +//// this.remoteclsParam++; +//// remotemodTest.remotemodVar++; +//// } +////} +//// +////function remotefoo(remotex: number) { +//// //Declare +//// var remotefnVar = 1; +//// +//// //Increments +//// remotefooCls.remoteclsSVar++; +//// remoteglobalVar++; +//// remotemodTest.remotemodVar++; +//// remotefnVar++; +//// +//// //Return +//// return remotex++; +////} +//// +////module remotemodTest { +//// //Declare +//// export var remotemodVar: number; +//// +//// //Increments +//// remoteglobalVar++; +//// remotefooCls.remoteclsSVar++; +//// remotemodVar++; +//// +//// class remotetestCls { +//// static remoteboo = remotefoo; +//// } +//// +//// function remotetestFn(){ +//// static remoteboo = remotefoo; +//// +//// //Increments +//// remoteglobalVar++; +//// remotefooCls.remoteclsSVar++; +//// remotemodVar++; +//// } +//// +//// module remotetestMod { +//// var remoteboo = remotefoo; +//// } +////} + +// References to a variable declared in global. +goTo.marker("1"); +verify.referencesCountIs(11); + +// References to a type. +goTo.marker("2"); +verify.referencesCountIs(8); + +// References to a function argument. +goTo.marker("3"); +verify.referencesCountIs(11); + +// References to a class argument. +goTo.marker("4"); +verify.referencesCountIs(11); + +// References to a variable declared in a class. +goTo.marker("5"); +verify.referencesCountIs(2); + +// References to static variable declared in a class. +goTo.marker("6"); verify.referencesCountIs(6); \ No newline at end of file diff --git a/tests/cases/fourslash/removeDeclareParamTypeAnnotation.ts b/tests/cases/fourslash/removeDeclareParamTypeAnnotation.ts index c78c681e517..ec04d1f362c 100644 --- a/tests/cases/fourslash/removeDeclareParamTypeAnnotation.ts +++ b/tests/cases/fourslash/removeDeclareParamTypeAnnotation.ts @@ -1,8 +1,8 @@ -/// - -//// declare class T { } -//// declare function parseInt(/**/s:T):T; -//// parseInt('2'); - -goTo.marker(); -edit.deleteAtCaret('s:T'.length); +/// + +//// declare class T { } +//// declare function parseInt(/**/s:T):T; +//// parseInt('2'); + +goTo.marker(); +edit.deleteAtCaret('s:T'.length); diff --git a/tests/cases/fourslash/removeExportFromInterfaceError0.ts b/tests/cases/fourslash/removeExportFromInterfaceError0.ts index f10180d53b3..103f51ff419 100644 --- a/tests/cases/fourslash/removeExportFromInterfaceError0.ts +++ b/tests/cases/fourslash/removeExportFromInterfaceError0.ts @@ -1,15 +1,15 @@ -/// - -//// module M { -//// export class C1 { } -//// /*1*/export interface I { n: number; } -//// } -//// module M { -//// function f(): I { return null; } } -//// - -edit.disableFormatting(); - -goTo.marker("1"); - -edit.deleteAtCaret(6); +/// + +//// module M { +//// export class C1 { } +//// /*1*/export interface I { n: number; } +//// } +//// module M { +//// function f(): I { return null; } } +//// + +edit.disableFormatting(); + +goTo.marker("1"); + +edit.deleteAtCaret(6); diff --git a/tests/cases/fourslash/removeExportFromInterfaceError1.ts b/tests/cases/fourslash/removeExportFromInterfaceError1.ts index f10180d53b3..103f51ff419 100644 --- a/tests/cases/fourslash/removeExportFromInterfaceError1.ts +++ b/tests/cases/fourslash/removeExportFromInterfaceError1.ts @@ -1,15 +1,15 @@ -/// - -//// module M { -//// export class C1 { } -//// /*1*/export interface I { n: number; } -//// } -//// module M { -//// function f(): I { return null; } } -//// - -edit.disableFormatting(); - -goTo.marker("1"); - -edit.deleteAtCaret(6); +/// + +//// module M { +//// export class C1 { } +//// /*1*/export interface I { n: number; } +//// } +//// module M { +//// function f(): I { return null; } } +//// + +edit.disableFormatting(); + +goTo.marker("1"); + +edit.deleteAtCaret(6); diff --git a/tests/cases/fourslash/removeExportedClassFromReopenedModule.ts b/tests/cases/fourslash/removeExportedClassFromReopenedModule.ts index 3d5ce9cb559..701a19074f9 100644 --- a/tests/cases/fourslash/removeExportedClassFromReopenedModule.ts +++ b/tests/cases/fourslash/removeExportedClassFromReopenedModule.ts @@ -1,16 +1,16 @@ -/// - -//// module multiM { } -//// -//// module multiM { -//// /*1*/export class c { } -//// } -//// - -goTo.marker('1'); -edit.deleteAtCaret('export class c { }'.length); - -goTo.eof(); - -edit.insert("new multiM.c();"); -verify.numberOfErrorsInCurrentFile(1); +/// + +//// module multiM { } +//// +//// module multiM { +//// /*1*/export class c { } +//// } +//// + +goTo.marker('1'); +edit.deleteAtCaret('export class c { }'.length); + +goTo.eof(); + +edit.insert("new multiM.c();"); +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/removeInterfaceUsedAsGenericTypeArgument.ts b/tests/cases/fourslash/removeInterfaceUsedAsGenericTypeArgument.ts index 200f21fa788..86d25e167c1 100644 --- a/tests/cases/fourslash/removeInterfaceUsedAsGenericTypeArgument.ts +++ b/tests/cases/fourslash/removeInterfaceUsedAsGenericTypeArgument.ts @@ -1,8 +1,8 @@ -/// - -//// /**/interface A { a: string; } -//// interface G { } -//// var v1: G; - -goTo.marker(); -edit.deleteAtCaret('interface A { a: string; }'.length); +/// + +//// /**/interface A { a: string; } +//// interface G { } +//// var v1: G; + +goTo.marker(); +edit.deleteAtCaret('interface A { a: string; }'.length); diff --git a/tests/cases/fourslash/removeParameterBetweenCommentAndParameter.ts b/tests/cases/fourslash/removeParameterBetweenCommentAndParameter.ts index d145e16febd..29de69b8ef3 100644 --- a/tests/cases/fourslash/removeParameterBetweenCommentAndParameter.ts +++ b/tests/cases/fourslash/removeParameterBetweenCommentAndParameter.ts @@ -1,6 +1,6 @@ -/// - -//// function fn(/* comment! */ /**/a: number, c) { } - -goTo.marker(); -edit.deleteAtCaret('a: number,'.length); +/// + +//// function fn(/* comment! */ /**/a: number, c) { } + +goTo.marker(); +edit.deleteAtCaret('a: number,'.length); diff --git a/tests/cases/fourslash/removeVarFromModuleWithReopenedEnums.ts b/tests/cases/fourslash/removeVarFromModuleWithReopenedEnums.ts index b25cbfde3a3..ef0012a62e7 100644 --- a/tests/cases/fourslash/removeVarFromModuleWithReopenedEnums.ts +++ b/tests/cases/fourslash/removeVarFromModuleWithReopenedEnums.ts @@ -1,16 +1,16 @@ -/// - -//// module A { -//// /**/var o; -//// } -//// enum A { -//// } -//// enum A { -//// } -//// module A { -//// var p; -//// } - -goTo.marker(); -edit.deleteAtCaret('var o;'.length); - +/// + +//// module A { +//// /**/var o; +//// } +//// enum A { +//// } +//// enum A { +//// } +//// module A { +//// var p; +//// } + +goTo.marker(); +edit.deleteAtCaret('var o;'.length); + diff --git a/tests/cases/fourslash/renameCommentsAndStrings1.ts b/tests/cases/fourslash/renameCommentsAndStrings1.ts index b5c8ac6aacc..b7a1f5d61ae 100644 --- a/tests/cases/fourslash/renameCommentsAndStrings1.ts +++ b/tests/cases/fourslash/renameCommentsAndStrings1.ts @@ -1,5 +1,5 @@ -/// - +/// + /////// ////function /**/[|Bar|]() { diff --git a/tests/cases/fourslash/scriptLexicalStructureEmptyConstructors.ts b/tests/cases/fourslash/scriptLexicalStructureEmptyConstructors.ts index 27bae4ab6bf..570b2f7518c 100644 --- a/tests/cases/fourslash/scriptLexicalStructureEmptyConstructors.ts +++ b/tests/cases/fourslash/scriptLexicalStructureEmptyConstructors.ts @@ -1,12 +1,12 @@ -/// - -////class Test { -//// constructor() { -//// } -////} - -verify.getScriptLexicalStructureListContains("Test", "class"); -verify.getScriptLexicalStructureListContains("constructor", "constructor"); - -// no other items +/// + +////class Test { +//// constructor() { +//// } +////} + +verify.getScriptLexicalStructureListContains("Test", "class"); +verify.getScriptLexicalStructureListContains("constructor", "constructor"); + +// no other items verify.getScriptLexicalStructureListCount(2); \ No newline at end of file diff --git a/tests/cases/fourslash/scriptLexicalStructureExports.ts b/tests/cases/fourslash/scriptLexicalStructureExports.ts index f2a4adfa0d1..d9db125b9b0 100644 --- a/tests/cases/fourslash/scriptLexicalStructureExports.ts +++ b/tests/cases/fourslash/scriptLexicalStructureExports.ts @@ -1,18 +1,18 @@ -/// - - -////export { {| "itemName": "a", "kind": "alias", "parentName": "" |}a } from "a"; -//// -////export { {| "itemName": "B", "kind": "alias", "parentName": "" |}b as B } from "a" -//// -////{| "itemName": "e", "kind": "alias", "parentName": "" |} export import e = require("a"); -//// -////export * from "a"; // no bindings here - -test.markers().forEach((marker) => { - if (marker.data) { - verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); - } -}); - -verify.getScriptLexicalStructureListCount(4); +/// + + +////export { {| "itemName": "a", "kind": "alias", "parentName": "" |}a } from "a"; +//// +////export { {| "itemName": "B", "kind": "alias", "parentName": "" |}b as B } from "a" +//// +////{| "itemName": "e", "kind": "alias", "parentName": "" |} export import e = require("a"); +//// +////export * from "a"; // no bindings here + +test.markers().forEach((marker) => { + if (marker.data) { + verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); + } +}); + +verify.getScriptLexicalStructureListCount(4); diff --git a/tests/cases/fourslash/scriptLexicalStructureImports.ts b/tests/cases/fourslash/scriptLexicalStructureImports.ts index 9d9e3e8b468..8b0d02bd9f5 100644 --- a/tests/cases/fourslash/scriptLexicalStructureImports.ts +++ b/tests/cases/fourslash/scriptLexicalStructureImports.ts @@ -1,25 +1,25 @@ -/// - - -////import {| "itemName": "d1", "kind": "alias", "parentName": "" |}d1 from "a"; -//// -////import { {| "itemName": "a", "kind": "alias", "parentName": "" |}a } from "a"; -//// -////import { {| "itemName": "B", "kind": "alias", "parentName": "" |}b as B } from "a" -//// -////import {| "itemName": "d2", "kind": "alias", "parentName": "" |}d2, -//// { {| "itemName": "c", "kind": "alias", "parentName": "" |}c, -//// {| "itemName": "D", "kind": "alias", "parentName": "" |} d as D } from "a" -//// -////{| "itemName": "e", "kind": "alias", "parentName": "" |}import e = require("a"); -//// -////import {| "itemName": "ns", "kind": "alias", "parentName": "" |}* as ns from "a"; - - -test.markers().forEach((marker) => { - if (marker.data) { - verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); - } -}); - -verify.getScriptLexicalStructureListCount(9); +/// + + +////import {| "itemName": "d1", "kind": "alias", "parentName": "" |}d1 from "a"; +//// +////import { {| "itemName": "a", "kind": "alias", "parentName": "" |}a } from "a"; +//// +////import { {| "itemName": "B", "kind": "alias", "parentName": "" |}b as B } from "a" +//// +////import {| "itemName": "d2", "kind": "alias", "parentName": "" |}d2, +//// { {| "itemName": "c", "kind": "alias", "parentName": "" |}c, +//// {| "itemName": "D", "kind": "alias", "parentName": "" |} d as D } from "a" +//// +////{| "itemName": "e", "kind": "alias", "parentName": "" |}import e = require("a"); +//// +////import {| "itemName": "ns", "kind": "alias", "parentName": "" |}* as ns from "a"; + + +test.markers().forEach((marker) => { + if (marker.data) { + verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); + } +}); + +verify.getScriptLexicalStructureListCount(9); diff --git a/tests/cases/fourslash/scriptLexicalStructureItems.ts b/tests/cases/fourslash/scriptLexicalStructureItems.ts index e18f49c1db9..67e14fe1009 100644 --- a/tests/cases/fourslash/scriptLexicalStructureItems.ts +++ b/tests/cases/fourslash/scriptLexicalStructureItems.ts @@ -1,52 +1,52 @@ -/// - -////// Interface -////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { -//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; -//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; -//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; -//// {| "itemName": "[]", "kind": "index", "parentName": "IPoint" |}[x:string]: number; -//// {| "itemName": "prop", "kind": "property", "parentName": "IPoint" |}prop: string; -////} -//// -/////// Module -////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { -//// -//// // Class -//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point implements IPoint { -//// {| "itemName": "constructor", "kind": "constructor", "parentName": "Shapes.Point" |}constructor (public x: number, public y: number) { } -//// -//// // Instance member -//// {| "itemName": "getDist", "kind": "method", "parentName": "Shapes.Point" |}getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } -//// -//// // Getter -//// {| "itemName": "value", "kind": "getter", "parentName": "Shapes.Point" |}get value(): number { return 0; } -//// -//// // Setter -//// {| "itemName": "value", "kind": "setter", "parentName": "Shapes.Point" |}set value(newValue: number) { return; } -//// -//// // Static member -//// {| "itemName": "origin", "kind": "property", "parentName": "Shapes.Point" |}static origin = new Point(0, 0); -//// -//// // Static method -//// {| "itemName": "getOrigin", "kind": "method", "parentName": "Shapes.Point" |}private static getOrigin() { return Point.origin;} -//// } -//// -//// {| "itemName": "Values", "kind": "enum", "parentName": "Shapes" |}enum Values { -//// value1, -//// {| "itemName": "value2", "kind": "property", "parentName": "Shapes.Values" |}value2, -//// value3, -//// } -////} -//// -////// Local variables -////{| "itemName": "p", "kind": "var", "parentName": "" |}var p: IPoint = new Shapes.Point(3, 4); -////{| "itemName": "dist", "kind": "var", "parentName": "" |}var dist = p.getDist(); - -test.markers().forEach((marker) => { - if (marker.data) { - verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); - } -}); - -verify.getScriptLexicalStructureListCount(23); +/// + +////// Interface +////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { +//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; +//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; +//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; +//// {| "itemName": "[]", "kind": "index", "parentName": "IPoint" |}[x:string]: number; +//// {| "itemName": "prop", "kind": "property", "parentName": "IPoint" |}prop: string; +////} +//// +/////// Module +////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { +//// +//// // Class +//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point implements IPoint { +//// {| "itemName": "constructor", "kind": "constructor", "parentName": "Shapes.Point" |}constructor (public x: number, public y: number) { } +//// +//// // Instance member +//// {| "itemName": "getDist", "kind": "method", "parentName": "Shapes.Point" |}getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } +//// +//// // Getter +//// {| "itemName": "value", "kind": "getter", "parentName": "Shapes.Point" |}get value(): number { return 0; } +//// +//// // Setter +//// {| "itemName": "value", "kind": "setter", "parentName": "Shapes.Point" |}set value(newValue: number) { return; } +//// +//// // Static member +//// {| "itemName": "origin", "kind": "property", "parentName": "Shapes.Point" |}static origin = new Point(0, 0); +//// +//// // Static method +//// {| "itemName": "getOrigin", "kind": "method", "parentName": "Shapes.Point" |}private static getOrigin() { return Point.origin;} +//// } +//// +//// {| "itemName": "Values", "kind": "enum", "parentName": "Shapes" |}enum Values { +//// value1, +//// {| "itemName": "value2", "kind": "property", "parentName": "Shapes.Values" |}value2, +//// value3, +//// } +////} +//// +////// Local variables +////{| "itemName": "p", "kind": "var", "parentName": "" |}var p: IPoint = new Shapes.Point(3, 4); +////{| "itemName": "dist", "kind": "var", "parentName": "" |}var dist = p.getDist(); + +test.markers().forEach((marker) => { + if (marker.data) { + verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); + } +}); + +verify.getScriptLexicalStructureListCount(23); diff --git a/tests/cases/fourslash/scriptLexicalStructureItems2.ts b/tests/cases/fourslash/scriptLexicalStructureItems2.ts index 092527ec937..7022c082ced 100644 --- a/tests/cases/fourslash/scriptLexicalStructureItems2.ts +++ b/tests/cases/fourslash/scriptLexicalStructureItems2.ts @@ -1,12 +1,12 @@ -/// - - -/////**/ - -goTo.marker(); -edit.insertLine("module A"); -edit.insert("export class "); - -// should not crash -verify.getScriptLexicalStructureListCount(1); - +/// + + +/////**/ + +goTo.marker(); +edit.insertLine("module A"); +edit.insert("export class "); + +// should not crash +verify.getScriptLexicalStructureListCount(1); + diff --git a/tests/cases/fourslash/scriptLexicalStructureItemsContainsNoAnonymousFunctions.ts b/tests/cases/fourslash/scriptLexicalStructureItemsContainsNoAnonymousFunctions.ts index a4086450176..b7430ad03de 100644 --- a/tests/cases/fourslash/scriptLexicalStructureItemsContainsNoAnonymousFunctions.ts +++ b/tests/cases/fourslash/scriptLexicalStructureItemsContainsNoAnonymousFunctions.ts @@ -1,44 +1,44 @@ -/// -// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_0.ts -/////*file1*/ -////(function() { -//// // this should not be included -//// var x = 0; -//// -//// // this should not be included either -//// function foo() { -//// -//// } -////})(); -//// -// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_1.ts -/////*file2*/ -////var x = function() { -//// // this should not be included -//// var x = 0; -//// -//// // this should not be included either -//// function foo() { -////}; -//// -// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_2.ts -////// Named functions should still show up -/////*file3*/ -////function foo() { -////} -////function bar() { -////} - -goTo.marker("file1"); -verify.getScriptLexicalStructureListCount(0); - -goTo.marker("file2"); -verify.getScriptLexicalStructureListContains("", "module"); -verify.getScriptLexicalStructureListContains("x", "var"); -verify.getScriptLexicalStructureListCount(2); - -goTo.marker("file3"); -verify.getScriptLexicalStructureListContains("", "module"); -verify.getScriptLexicalStructureListContains("foo", "function"); -verify.getScriptLexicalStructureListContains("bar", "function"); +/// +// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_0.ts +/////*file1*/ +////(function() { +//// // this should not be included +//// var x = 0; +//// +//// // this should not be included either +//// function foo() { +//// +//// } +////})(); +//// +// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_1.ts +/////*file2*/ +////var x = function() { +//// // this should not be included +//// var x = 0; +//// +//// // this should not be included either +//// function foo() { +////}; +//// +// @Filename: scriptLexicalStructureItemsContainsNoAnonymouseFunctions_2.ts +////// Named functions should still show up +/////*file3*/ +////function foo() { +////} +////function bar() { +////} + +goTo.marker("file1"); +verify.getScriptLexicalStructureListCount(0); + +goTo.marker("file2"); +verify.getScriptLexicalStructureListContains("", "module"); +verify.getScriptLexicalStructureListContains("x", "var"); +verify.getScriptLexicalStructureListCount(2); + +goTo.marker("file3"); +verify.getScriptLexicalStructureListContains("", "module"); +verify.getScriptLexicalStructureListContains("foo", "function"); +verify.getScriptLexicalStructureListContains("bar", "function"); verify.getScriptLexicalStructureListCount(5); \ No newline at end of file diff --git a/tests/cases/fourslash/scriptLexicalStructureMissingName1.ts b/tests/cases/fourslash/scriptLexicalStructureMissingName1.ts index 60d858b6089..c5282d696f3 100644 --- a/tests/cases/fourslash/scriptLexicalStructureMissingName1.ts +++ b/tests/cases/fourslash/scriptLexicalStructureMissingName1.ts @@ -1,4 +1,4 @@ -////export function +////export function /////** //// * This is a class. //// */ diff --git a/tests/cases/fourslash/scriptLexicalStructureMissingName2.ts b/tests/cases/fourslash/scriptLexicalStructureMissingName2.ts index 0ee0d1197bf..b805427ff63 100644 --- a/tests/cases/fourslash/scriptLexicalStructureMissingName2.ts +++ b/tests/cases/fourslash/scriptLexicalStructureMissingName2.ts @@ -1,4 +1,4 @@ -/////** +/////** //// * This is a class. //// */ ////class /* But it has no name! */ { diff --git a/tests/cases/fourslash/scriptLexicalStructureModules.ts b/tests/cases/fourslash/scriptLexicalStructureModules.ts index ee0f91cc73c..a5fc9b641f9 100644 --- a/tests/cases/fourslash/scriptLexicalStructureModules.ts +++ b/tests/cases/fourslash/scriptLexicalStructureModules.ts @@ -1,4 +1,4 @@ - + ////{| "itemName": "\"X.Y.Z\"", "kind": "module" |} ////declare module "X.Y.Z" { ////} diff --git a/tests/cases/fourslash/scriptLexicalStructureMultilineStringIdentifiers.ts b/tests/cases/fourslash/scriptLexicalStructureMultilineStringIdentifiers.ts index 796a4caa2d8..59eca486b62 100644 --- a/tests/cases/fourslash/scriptLexicalStructureMultilineStringIdentifiers.ts +++ b/tests/cases/fourslash/scriptLexicalStructureMultilineStringIdentifiers.ts @@ -1,4 +1,4 @@ - + ////{| "itemName": "\"Multiline\\r\\nMadness\"", "kind": "module" |} ////declare module "Multiline\r\nMadness" { ////} diff --git a/tests/cases/fourslash/scriptLexicalStructurePropertiesDefinedInConstructors.ts b/tests/cases/fourslash/scriptLexicalStructurePropertiesDefinedInConstructors.ts index e73db067bf9..adda43066a3 100644 --- a/tests/cases/fourslash/scriptLexicalStructurePropertiesDefinedInConstructors.ts +++ b/tests/cases/fourslash/scriptLexicalStructurePropertiesDefinedInConstructors.ts @@ -1,15 +1,15 @@ -/// - -////class List { -//// constructor(public a: boolean, public b: T, c: number) { -//// var local = 0; -//// } -////} - -verify.getScriptLexicalStructureListContains("List", "class"); -verify.getScriptLexicalStructureListContains("constructor", "constructor"); -verify.getScriptLexicalStructureListContains("a", "property"); -verify.getScriptLexicalStructureListContains("b", "property"); - -// no other items +/// + +////class List { +//// constructor(public a: boolean, public b: T, c: number) { +//// var local = 0; +//// } +////} + +verify.getScriptLexicalStructureListContains("List", "class"); +verify.getScriptLexicalStructureListContains("constructor", "constructor"); +verify.getScriptLexicalStructureListContains("a", "property"); +verify.getScriptLexicalStructureListContains("b", "property"); + +// no other items verify.getScriptLexicalStructureListCount(4); \ No newline at end of file diff --git a/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts b/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts index 19f6d1062cb..7ac8bec2820 100644 --- a/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts +++ b/tests/cases/fourslash/semanticClassificationInTemplateExpressions.ts @@ -1,4 +1,4 @@ -/// +/// ////module /*0*/M { //// export class /*1*/C { diff --git a/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName1.ts b/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName1.ts index 2b8b6824558..2061c218eac 100644 --- a/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName1.ts +++ b/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName1.ts @@ -1,4 +1,4 @@ -/// +/// ////module /*0*/M { //// export interface /*1*/I { diff --git a/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName2.ts b/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName2.ts index 5d2ed9844cc..f1f4fa8e670 100644 --- a/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName2.ts +++ b/tests/cases/fourslash/semanticClassificationInstantiatedModuleWithVariableOfSameName2.ts @@ -1,4 +1,4 @@ -/// +/// ////module /*0*/M { //// export interface /*1*/I { diff --git a/tests/cases/fourslash/semanticClassificationModules.ts b/tests/cases/fourslash/semanticClassificationModules.ts index 86c2819983a..6992639e4c3 100644 --- a/tests/cases/fourslash/semanticClassificationModules.ts +++ b/tests/cases/fourslash/semanticClassificationModules.ts @@ -1,4 +1,4 @@ -/// +/// ////module /*0*/M { //// export var v; diff --git a/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName1.ts b/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName1.ts index e7486c2c0cb..6c98c8340c3 100644 --- a/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName1.ts +++ b/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName1.ts @@ -1,4 +1,4 @@ -/// +/// ////declare module /*0*/M { //// interface /*1*/I { diff --git a/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName2.ts b/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName2.ts index f90efd7518d..419692b98ce 100644 --- a/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName2.ts +++ b/tests/cases/fourslash/semanticClassificationUninstantiatedModuleWithVariableOfSameName2.ts @@ -1,4 +1,4 @@ -/// +/// ////module /*0*/M { //// export interface /*1*/I { diff --git a/tests/cases/fourslash/semanticClassificationWithUnionTypes.ts b/tests/cases/fourslash/semanticClassificationWithUnionTypes.ts index 40a7f409685..bc55c5d8253 100644 --- a/tests/cases/fourslash/semanticClassificationWithUnionTypes.ts +++ b/tests/cases/fourslash/semanticClassificationWithUnionTypes.ts @@ -1,4 +1,4 @@ -////module /*0*/M { +////module /*0*/M { //// export interface /*1*/I { //// } ////} diff --git a/tests/cases/fourslash/server/definition.ts b/tests/cases/fourslash/server/definition.ts index 531e4562843..f403965fe12 100644 --- a/tests/cases/fourslash/server/definition.ts +++ b/tests/cases/fourslash/server/definition.ts @@ -1,4 +1,4 @@ -/// +/// // @Filename: b.ts ////import n = require('a/*1*/'); diff --git a/tests/cases/fourslash/server/navbar.ts b/tests/cases/fourslash/server/navbar.ts index e18f49c1db9..67e14fe1009 100644 --- a/tests/cases/fourslash/server/navbar.ts +++ b/tests/cases/fourslash/server/navbar.ts @@ -1,52 +1,52 @@ -/// - -////// Interface -////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { -//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; -//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; -//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; -//// {| "itemName": "[]", "kind": "index", "parentName": "IPoint" |}[x:string]: number; -//// {| "itemName": "prop", "kind": "property", "parentName": "IPoint" |}prop: string; -////} -//// -/////// Module -////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { -//// -//// // Class -//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point implements IPoint { -//// {| "itemName": "constructor", "kind": "constructor", "parentName": "Shapes.Point" |}constructor (public x: number, public y: number) { } -//// -//// // Instance member -//// {| "itemName": "getDist", "kind": "method", "parentName": "Shapes.Point" |}getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } -//// -//// // Getter -//// {| "itemName": "value", "kind": "getter", "parentName": "Shapes.Point" |}get value(): number { return 0; } -//// -//// // Setter -//// {| "itemName": "value", "kind": "setter", "parentName": "Shapes.Point" |}set value(newValue: number) { return; } -//// -//// // Static member -//// {| "itemName": "origin", "kind": "property", "parentName": "Shapes.Point" |}static origin = new Point(0, 0); -//// -//// // Static method -//// {| "itemName": "getOrigin", "kind": "method", "parentName": "Shapes.Point" |}private static getOrigin() { return Point.origin;} -//// } -//// -//// {| "itemName": "Values", "kind": "enum", "parentName": "Shapes" |}enum Values { -//// value1, -//// {| "itemName": "value2", "kind": "property", "parentName": "Shapes.Values" |}value2, -//// value3, -//// } -////} -//// -////// Local variables -////{| "itemName": "p", "kind": "var", "parentName": "" |}var p: IPoint = new Shapes.Point(3, 4); -////{| "itemName": "dist", "kind": "var", "parentName": "" |}var dist = p.getDist(); - -test.markers().forEach((marker) => { - if (marker.data) { - verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); - } -}); - -verify.getScriptLexicalStructureListCount(23); +/// + +////// Interface +////{| "itemName": "IPoint", "kind": "interface", "parentName": "" |}interface IPoint { +//// {| "itemName": "getDist", "kind": "method", "parentName": "IPoint" |}getDist(): number; +//// {| "itemName": "new()", "kind": "construct", "parentName": "IPoint" |}new(): IPoint; +//// {| "itemName": "()", "kind": "call", "parentName": "IPoint" |}(): any; +//// {| "itemName": "[]", "kind": "index", "parentName": "IPoint" |}[x:string]: number; +//// {| "itemName": "prop", "kind": "property", "parentName": "IPoint" |}prop: string; +////} +//// +/////// Module +////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { +//// +//// // Class +//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point implements IPoint { +//// {| "itemName": "constructor", "kind": "constructor", "parentName": "Shapes.Point" |}constructor (public x: number, public y: number) { } +//// +//// // Instance member +//// {| "itemName": "getDist", "kind": "method", "parentName": "Shapes.Point" |}getDist() { return Math.sqrt(this.x * this.x + this.y * this.y); } +//// +//// // Getter +//// {| "itemName": "value", "kind": "getter", "parentName": "Shapes.Point" |}get value(): number { return 0; } +//// +//// // Setter +//// {| "itemName": "value", "kind": "setter", "parentName": "Shapes.Point" |}set value(newValue: number) { return; } +//// +//// // Static member +//// {| "itemName": "origin", "kind": "property", "parentName": "Shapes.Point" |}static origin = new Point(0, 0); +//// +//// // Static method +//// {| "itemName": "getOrigin", "kind": "method", "parentName": "Shapes.Point" |}private static getOrigin() { return Point.origin;} +//// } +//// +//// {| "itemName": "Values", "kind": "enum", "parentName": "Shapes" |}enum Values { +//// value1, +//// {| "itemName": "value2", "kind": "property", "parentName": "Shapes.Values" |}value2, +//// value3, +//// } +////} +//// +////// Local variables +////{| "itemName": "p", "kind": "var", "parentName": "" |}var p: IPoint = new Shapes.Point(3, 4); +////{| "itemName": "dist", "kind": "var", "parentName": "" |}var dist = p.getDist(); + +test.markers().forEach((marker) => { + if (marker.data) { + verify.getScriptLexicalStructureListContains(marker.data.itemName, marker.data.kind, marker.fileName, marker.data.parentName); + } +}); + +verify.getScriptLexicalStructureListCount(23); diff --git a/tests/cases/fourslash/server/navto.ts b/tests/cases/fourslash/server/navto.ts index 0179c168552..ba907e985fd 100644 --- a/tests/cases/fourslash/server/navto.ts +++ b/tests/cases/fourslash/server/navto.ts @@ -1,28 +1,28 @@ -/// - -/////// Module -////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { -//// -//// // Class -//// {| "itemName": "MyPoint", "kind": "class", "parentName": "MyShapes", "matchKind": "substring" |}export class MyPoint { -//// // Instance member -//// {| "itemName": "MyoriginPointAttheHorizon", "kind": "property", "parentName": "MyPoint", "matchKind": "substring"|}private MyoriginPointAttheHorizon = 0.0; -//// -//// // Getter -//// {| "itemName": "MydistanceFromOrigin", "kind": "getter", "parentName": "MyPoint", "matchKind": "substring" |}get MydistanceFromOrigin(): number { return 0; } -//// -//// } -////} -//// -////// Local variables -////{| "itemName": "myPointThatIJustInitiated", "kind": "var", "parentName": "", "matchKind": "substring"|}var myPointThatIJustInitiated = new Shapes.Point(); - -//// Testing for substring matching of navigationItems -//var searchValue = "FromOrigin horizon INITIATED Shape Point"; - -test.markers().forEach((marker) => { - if (marker.data) { - var name = marker.data.itemName; - verify.navigationItemsListContains(name, marker.data.kind, name.substr(2), marker.data.matchKind, marker.fileName, marker.data.parentName); - } +/// + +/////// Module +////{| "itemName": "MyShapes", "kind": "module", "parentName": "", "matchKind": "substring" |}module MyShapes { +//// +//// // Class +//// {| "itemName": "MyPoint", "kind": "class", "parentName": "MyShapes", "matchKind": "substring" |}export class MyPoint { +//// // Instance member +//// {| "itemName": "MyoriginPointAttheHorizon", "kind": "property", "parentName": "MyPoint", "matchKind": "substring"|}private MyoriginPointAttheHorizon = 0.0; +//// +//// // Getter +//// {| "itemName": "MydistanceFromOrigin", "kind": "getter", "parentName": "MyPoint", "matchKind": "substring" |}get MydistanceFromOrigin(): number { return 0; } +//// +//// } +////} +//// +////// Local variables +////{| "itemName": "myPointThatIJustInitiated", "kind": "var", "parentName": "", "matchKind": "substring"|}var myPointThatIJustInitiated = new Shapes.Point(); + +//// Testing for substring matching of navigationItems +//var searchValue = "FromOrigin horizon INITIATED Shape Point"; + +test.markers().forEach((marker) => { + if (marker.data) { + var name = marker.data.itemName; + verify.navigationItemsListContains(name, marker.data.kind, name.substr(2), marker.data.matchKind, marker.fileName, marker.data.parentName); + } }); \ No newline at end of file diff --git a/tests/cases/fourslash/shims/getDefinitionAtPosition.ts b/tests/cases/fourslash/shims/getDefinitionAtPosition.ts index 54b799ba65f..3aa31d1556c 100644 --- a/tests/cases/fourslash/shims/getDefinitionAtPosition.ts +++ b/tests/cases/fourslash/shims/getDefinitionAtPosition.ts @@ -1,29 +1,29 @@ -/// - -// @Filename: goToDefinitionDifferentFile_Definition.ts -////var /*remoteVariableDefinition*/remoteVariable; -/////*remoteFunctionDefinition*/function remoteFunction() { } -/////*remoteClassDefinition*/class remoteClass { } -/////*remoteInterfaceDefinition*/interface remoteInterface{ } -/////*remoteModuleDefinition*/module remoteModule{ export var foo = 1;} - -// @Filename: goToDefinitionDifferentFile_Consumption.ts -/////*remoteVariableReference*/remoteVariable = 1; -/////*remoteFunctionReference*/remoteFunction(); -////var foo = new /*remoteClassReference*/remoteClass(); -////class fooCls implements /*remoteInterfaceReference*/remoteInterface { } -////var fooVar = /*remoteModuleReference*/remoteModule.foo; - -var markerList = [ - "remoteVariable", - "remoteFunction", - "remoteClass", - "remoteInterface", - "remoteModule", -]; - -markerList.forEach((marker) => { - goTo.marker(marker + 'Reference'); - goTo.definition(); - verify.caretAtMarker(marker + 'Definition'); -}); +/// + +// @Filename: goToDefinitionDifferentFile_Definition.ts +////var /*remoteVariableDefinition*/remoteVariable; +/////*remoteFunctionDefinition*/function remoteFunction() { } +/////*remoteClassDefinition*/class remoteClass { } +/////*remoteInterfaceDefinition*/interface remoteInterface{ } +/////*remoteModuleDefinition*/module remoteModule{ export var foo = 1;} + +// @Filename: goToDefinitionDifferentFile_Consumption.ts +/////*remoteVariableReference*/remoteVariable = 1; +/////*remoteFunctionReference*/remoteFunction(); +////var foo = new /*remoteClassReference*/remoteClass(); +////class fooCls implements /*remoteInterfaceReference*/remoteInterface { } +////var fooVar = /*remoteModuleReference*/remoteModule.foo; + +var markerList = [ + "remoteVariable", + "remoteFunction", + "remoteClass", + "remoteInterface", + "remoteModule", +]; + +markerList.forEach((marker) => { + goTo.marker(marker + 'Reference'); + goTo.definition(); + verify.caretAtMarker(marker + 'Definition'); +}); diff --git a/tests/cases/fourslash/shims/getEmitOutput.ts b/tests/cases/fourslash/shims/getEmitOutput.ts index 699514521ed..7e86212d135 100644 --- a/tests/cases/fourslash/shims/getEmitOutput.ts +++ b/tests/cases/fourslash/shims/getEmitOutput.ts @@ -1,22 +1,22 @@ -/// - -// @BaselineFile: getEmitOutput.baseline -// @declaration: true - -// @Filename: inputFile1.ts -// @emitThisFile: true -//// var x: number = 5; -//// class Bar { -//// x : string; -//// y : number -//// } - -// @Filename: inputFile2.ts -// @emitThisFile: true -//// var x1: string = "hello world"; -//// class Foo{ -//// x : string; -//// y : number; -//// } - +/// + +// @BaselineFile: getEmitOutput.baseline +// @declaration: true + +// @Filename: inputFile1.ts +// @emitThisFile: true +//// var x: number = 5; +//// class Bar { +//// x : string; +//// y : number +//// } + +// @Filename: inputFile2.ts +// @emitThisFile: true +//// var x1: string = "hello world"; +//// class Foo{ +//// x : string; +//// y : number; +//// } + verify.baselineGetEmitOutput(); \ No newline at end of file diff --git a/tests/cases/fourslash/shims/getIndentationAtPosition.ts b/tests/cases/fourslash/shims/getIndentationAtPosition.ts index 5e26781357e..ba2936bd702 100644 --- a/tests/cases/fourslash/shims/getIndentationAtPosition.ts +++ b/tests/cases/fourslash/shims/getIndentationAtPosition.ts @@ -1,21 +1,21 @@ -/// - -////class Bar { -//// {| "indentation": 4|} -//// private foo: string = ""; -//// {| "indentation": 4|} -//// private f() { -//// var a: any[] = [[1, 2], [3, 4], 5]; -//// {| "indentation": 8|} -//// return ((1 + 1)); -//// } -//// {| "indentation": 4|} -//// private f2() { -//// if (true) { } { }; -//// } -////} +/// + +////class Bar { +//// {| "indentation": 4|} +//// private foo: string = ""; +//// {| "indentation": 4|} +//// private f() { +//// var a: any[] = [[1, 2], [3, 4], 5]; +//// {| "indentation": 8|} +//// return ((1 + 1)); +//// } +//// {| "indentation": 4|} +//// private f2() { +//// if (true) { } { }; +//// } +////} ////{| "indentation": 0|} test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); -}); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); +}); diff --git a/tests/cases/fourslash/shims/getNavigateToItems.ts b/tests/cases/fourslash/shims/getNavigateToItems.ts index 9658c52324c..5481f4295cb 100644 --- a/tests/cases/fourslash/shims/getNavigateToItems.ts +++ b/tests/cases/fourslash/shims/getNavigateToItems.ts @@ -1,27 +1,27 @@ -/// - -/////// Module -////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { -//// -//// // Class -//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { -//// // Instance member -//// {| "itemName": "origin", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private origin = 0.0; -//// -//// {| "itemName": "distFromZero", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private distFromZero = 0.0; -//// -//// // Getter -//// {| "itemName": "distance", "kind": "getter", "parentName": "Point", "matchKind": "exact" |}get distance(): number { return 0; } -//// } -////} -//// -////// Local variables -////{| "itemName": "point", "kind": "var", "parentName": "", "matchKind": "exact"|}var point = new Shapes.Point(); - -//// Testing for exact matching of navigationItems - -test.markers().forEach((marker) => { - if (marker.data) { - verify.navigationItemsListContains(marker.data.itemName, marker.data.kind, marker.data.itemName, marker.data.matchKind, marker.fileName, marker.data.parentName); - } -}); +/// + +/////// Module +////{| "itemName": "Shapes", "kind": "module", "parentName": "" |}module Shapes { +//// +//// // Class +//// {| "itemName": "Point", "kind": "class", "parentName": "Shapes" |}export class Point { +//// // Instance member +//// {| "itemName": "origin", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private origin = 0.0; +//// +//// {| "itemName": "distFromZero", "kind": "property", "parentName": "Point", "matchKind": "exact"|}private distFromZero = 0.0; +//// +//// // Getter +//// {| "itemName": "distance", "kind": "getter", "parentName": "Point", "matchKind": "exact" |}get distance(): number { return 0; } +//// } +////} +//// +////// Local variables +////{| "itemName": "point", "kind": "var", "parentName": "", "matchKind": "exact"|}var point = new Shapes.Point(); + +//// Testing for exact matching of navigationItems + +test.markers().forEach((marker) => { + if (marker.data) { + verify.navigationItemsListContains(marker.data.itemName, marker.data.kind, marker.data.itemName, marker.data.matchKind, marker.fileName, marker.data.parentName); + } +}); diff --git a/tests/cases/fourslash/shims/getRenameInfo.ts b/tests/cases/fourslash/shims/getRenameInfo.ts index b5c8ac6aacc..b7a1f5d61ae 100644 --- a/tests/cases/fourslash/shims/getRenameInfo.ts +++ b/tests/cases/fourslash/shims/getRenameInfo.ts @@ -1,5 +1,5 @@ -/// - +/// + /////// ////function /**/[|Bar|]() { diff --git a/tests/cases/fourslash/shims/getSemanticDiagnostics.ts b/tests/cases/fourslash/shims/getSemanticDiagnostics.ts index 6345c464213..804abbde33b 100644 --- a/tests/cases/fourslash/shims/getSemanticDiagnostics.ts +++ b/tests/cases/fourslash/shims/getSemanticDiagnostics.ts @@ -1,11 +1,11 @@ -/// - -// @module: CommonJS -// @declaration: true -//// interface privateInterface {} -//// export class Bar implements /*1*/privateInterface/*2*/{ } - -verify.errorExistsBetweenMarkers("1", "2"); -verify.numberOfErrorsInCurrentFile(1); - - +/// + +// @module: CommonJS +// @declaration: true +//// interface privateInterface {} +//// export class Bar implements /*1*/privateInterface/*2*/{ } + +verify.errorExistsBetweenMarkers("1", "2"); +verify.numberOfErrorsInCurrentFile(1); + + diff --git a/tests/cases/fourslash/signatureHelpCallExpression.ts b/tests/cases/fourslash/signatureHelpCallExpression.ts index fd9758cfa54..61606b77bc0 100644 --- a/tests/cases/fourslash/signatureHelpCallExpression.ts +++ b/tests/cases/fourslash/signatureHelpCallExpression.ts @@ -1,16 +1,16 @@ -/// - -////function fnTest(str: string, num: number) { } -////fnTest(/*1*/'', /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParameterCountIs(2); -verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); +/// + +////function fnTest(str: string, num: number) { } +////fnTest(/*1*/'', /*2*/5); + +goTo.marker('1'); +verify.signatureHelpCountIs(1); +verify.currentSignatureParameterCountIs(2); +verify.currentSignatureHelpIs('fnTest(str: string, num: number): void'); + +verify.currentParameterHelpArgumentNameIs('str'); +verify.currentParameterSpanIs("str: string"); + +goTo.marker('2'); +verify.currentParameterHelpArgumentNameIs('num'); +verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash/signatureHelpConstructExpression.ts b/tests/cases/fourslash/signatureHelpConstructExpression.ts index 00efee0a479..a64c0123e6f 100644 --- a/tests/cases/fourslash/signatureHelpConstructExpression.ts +++ b/tests/cases/fourslash/signatureHelpConstructExpression.ts @@ -1,17 +1,17 @@ -/// - -////class sampleCls { constructor(str: string, num: number) { } } -////var x = new sampleCls(/*1*/"", /*2*/5); - -goTo.marker('1'); -verify.signatureHelpCountIs(1); - -verify.currentSignatureParameterCountIs(2); -verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); - -verify.currentParameterHelpArgumentNameIs('str'); -verify.currentParameterSpanIs("str: string"); - -goTo.marker('2'); -verify.currentParameterHelpArgumentNameIs('num'); -verify.currentParameterSpanIs("num: number"); +/// + +////class sampleCls { constructor(str: string, num: number) { } } +////var x = new sampleCls(/*1*/"", /*2*/5); + +goTo.marker('1'); +verify.signatureHelpCountIs(1); + +verify.currentSignatureParameterCountIs(2); +verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls'); + +verify.currentParameterHelpArgumentNameIs('str'); +verify.currentParameterSpanIs("str: string"); + +goTo.marker('2'); +verify.currentParameterHelpArgumentNameIs('num'); +verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash/signatureHelpConstructorInheritance.ts b/tests/cases/fourslash/signatureHelpConstructorInheritance.ts index a2e683d69bb..23f802f10b5 100644 --- a/tests/cases/fourslash/signatureHelpConstructorInheritance.ts +++ b/tests/cases/fourslash/signatureHelpConstructorInheritance.ts @@ -1,22 +1,22 @@ -/// - -////class base { -//// constructor(s: string); -//// constructor(n: number); -//// constructor(a: any) { } -////} -////class B1 extends base { } -////class B2 extends B1 { } -////class B3 extends B2 { -//// constructor() { -//// super(/*indirectSuperCall*/3); -//// } -////} - - -goTo.marker('indirectSuperCall'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParameterCountIs(1); -verify.currentSignatureHelpIs('B2(n: number): B2'); -verify.currentParameterHelpArgumentNameIs("n"); -verify.currentParameterSpanIs("n: number"); +/// + +////class base { +//// constructor(s: string); +//// constructor(n: number); +//// constructor(a: any) { } +////} +////class B1 extends base { } +////class B2 extends B1 { } +////class B3 extends B2 { +//// constructor() { +//// super(/*indirectSuperCall*/3); +//// } +////} + + +goTo.marker('indirectSuperCall'); +verify.signatureHelpCountIs(2); +verify.currentSignatureParameterCountIs(1); +verify.currentSignatureHelpIs('B2(n: number): B2'); +verify.currentParameterHelpArgumentNameIs("n"); +verify.currentParameterSpanIs("n: number"); diff --git a/tests/cases/fourslash/signatureHelpConstructorOverload.ts b/tests/cases/fourslash/signatureHelpConstructorOverload.ts index 9aab48f71ae..b562d4f54c7 100644 --- a/tests/cases/fourslash/signatureHelpConstructorOverload.ts +++ b/tests/cases/fourslash/signatureHelpConstructorOverload.ts @@ -1,16 +1,16 @@ -/// - -////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } -////var x = new clsOverload(/*1*/); -////var y = new clsOverload(/*2*/''); - -goTo.marker('1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParameterCountIs(0); -verify.currentSignatureHelpIs('clsOverload(): clsOverload'); - -goTo.marker('2'); -verify.currentSignatureParameterCountIs(1); -verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); -verify.currentParameterHelpArgumentNameIs('test'); +/// + +////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } +////var x = new clsOverload(/*1*/); +////var y = new clsOverload(/*2*/''); + +goTo.marker('1'); +verify.signatureHelpCountIs(2); +verify.currentSignatureParameterCountIs(0); +verify.currentSignatureHelpIs('clsOverload(): clsOverload'); + +goTo.marker('2'); +verify.currentSignatureParameterCountIs(1); +verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload'); +verify.currentParameterHelpArgumentNameIs('test'); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpFunctionOverload.ts b/tests/cases/fourslash/signatureHelpFunctionOverload.ts index cc02ba12570..219e718f811 100644 --- a/tests/cases/fourslash/signatureHelpFunctionOverload.ts +++ b/tests/cases/fourslash/signatureHelpFunctionOverload.ts @@ -1,18 +1,18 @@ -/// - -////function functionOverload(); -////function functionOverload(test: string); -////function functionOverload(test?: string) { } -////functionOverload(/*functionOverload1*/); -////functionOverload(""/*functionOverload2*/); - -goTo.marker('functionOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureParameterCountIs(0); -verify.currentSignatureHelpIs('functionOverload(): any'); - -goTo.marker('functionOverload2'); -verify.currentSignatureParameterCountIs(1); -verify.currentSignatureHelpIs('functionOverload(test: string): any'); -verify.currentParameterHelpArgumentNameIs("test"); +/// + +////function functionOverload(); +////function functionOverload(test: string); +////function functionOverload(test?: string) { } +////functionOverload(/*functionOverload1*/); +////functionOverload(""/*functionOverload2*/); + +goTo.marker('functionOverload1'); +verify.signatureHelpCountIs(2); +verify.currentSignatureParameterCountIs(0); +verify.currentSignatureHelpIs('functionOverload(): any'); + +goTo.marker('functionOverload2'); +verify.currentSignatureParameterCountIs(1); +verify.currentSignatureHelpIs('functionOverload(test: string): any'); +verify.currentParameterHelpArgumentNameIs("test"); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpFunctionParameter.ts b/tests/cases/fourslash/signatureHelpFunctionParameter.ts index b61e56dedcb..9105ee067ce 100644 --- a/tests/cases/fourslash/signatureHelpFunctionParameter.ts +++ b/tests/cases/fourslash/signatureHelpFunctionParameter.ts @@ -2,16 +2,16 @@ ////function parameterFunction(callback: (a: number, b: string) => void) { //// callback(/*parameterFunction1*/5, /*parameterFunction2*/""); -////} - -goTo.marker('parameterFunction1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureParameterCountIs(2); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("a"); -verify.currentParameterSpanIs("a: number"); - -goTo.marker('parameterFunction2'); -verify.currentSignatureHelpIs('callback(a: number, b: string): void'); -verify.currentParameterHelpArgumentNameIs("b"); +////} + +goTo.marker('parameterFunction1'); +verify.signatureHelpCountIs(1); +verify.currentSignatureParameterCountIs(2); +verify.currentSignatureHelpIs('callback(a: number, b: string): void'); +verify.currentParameterHelpArgumentNameIs("a"); +verify.currentParameterSpanIs("a: number"); + +goTo.marker('parameterFunction2'); +verify.currentSignatureHelpIs('callback(a: number, b: string): void'); +verify.currentParameterHelpArgumentNameIs("b"); verify.currentParameterSpanIs("b: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpImplicitConstructor.ts b/tests/cases/fourslash/signatureHelpImplicitConstructor.ts index 4324767d00a..c22087b9d1d 100644 --- a/tests/cases/fourslash/signatureHelpImplicitConstructor.ts +++ b/tests/cases/fourslash/signatureHelpImplicitConstructor.ts @@ -2,9 +2,9 @@ ////class ImplicitConstructor { ////} -////var implicitConstructor = new ImplicitConstructor(/**/); - -goTo.marker(); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); -verify.currentSignatureParameterCountIs(0); +////var implicitConstructor = new ImplicitConstructor(/**/); + +goTo.marker(); +verify.signatureHelpCountIs(1); +verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor"); +verify.currentSignatureParameterCountIs(0); diff --git a/tests/cases/fourslash/signatureHelpInFunctionCall.ts b/tests/cases/fourslash/signatureHelpInFunctionCall.ts index 566acc14fb7..48c3b4a4ccf 100644 --- a/tests/cases/fourslash/signatureHelpInFunctionCall.ts +++ b/tests/cases/fourslash/signatureHelpInFunctionCall.ts @@ -3,7 +3,7 @@ ////var items = []; ////items.forEach(item => { //// for (/**/ -////}); - -goTo.marker(); -verify.not.signatureHelpPresent(); +////}); + +goTo.marker(); +verify.not.signatureHelpPresent(); diff --git a/tests/cases/fourslash/signatureHelpNegativeTests2.ts b/tests/cases/fourslash/signatureHelpNegativeTests2.ts index 28f25063ddf..a7341225c73 100644 --- a/tests/cases/fourslash/signatureHelpNegativeTests2.ts +++ b/tests/cases/fourslash/signatureHelpNegativeTests2.ts @@ -1,10 +1,10 @@ -/// - -////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } -////var x = new clsOverload/*beforeOpenParen*/()/*afterCloseParen*/; - -goTo.marker('beforeOpenParen'); -verify.not.signatureHelpPresent(); - -goTo.marker('afterCloseParen'); +/// + +////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } } +////var x = new clsOverload/*beforeOpenParen*/()/*afterCloseParen*/; + +goTo.marker('beforeOpenParen'); +verify.not.signatureHelpPresent(); + +goTo.marker('afterCloseParen'); verify.not.signatureHelpPresent(); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpObjectCreationExpressionNoArgs_NotAvailable.ts b/tests/cases/fourslash/signatureHelpObjectCreationExpressionNoArgs_NotAvailable.ts index aea52719273..40a0a316a0e 100644 --- a/tests/cases/fourslash/signatureHelpObjectCreationExpressionNoArgs_NotAvailable.ts +++ b/tests/cases/fourslash/signatureHelpObjectCreationExpressionNoArgs_NotAvailable.ts @@ -1,8 +1,8 @@ -/// - -////class sampleCls { constructor(str: string, num: number) { } } -////var x = new sampleCls/**/; - -goTo.marker(); -verify.signatureHelpCountIs(0); +/// + +////class sampleCls { constructor(str: string, num: number) { } } +////var x = new sampleCls/**/; + +goTo.marker(); +verify.signatureHelpCountIs(0); verify.not.signatureHelpPresent(); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity.ts b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity.ts index fe18f655ed4..ff20d2ca5c2 100644 --- a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity.ts +++ b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity.ts @@ -1,4 +1,4 @@ -/// +/// ////declare function f(s: string); ////declare function f(n: number); diff --git a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity2.ts b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity2.ts index 1f87f3b9a0c..1290859d848 100644 --- a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity2.ts +++ b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity2.ts @@ -1,4 +1,4 @@ -/// +/// ////declare function f(s: string); ////declare function f(n: number); diff --git a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts index f9754c7d1fd..b98cfe6bbfe 100644 --- a/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts +++ b/tests/cases/fourslash/signatureHelpOnOverloadsDifferentArity3.ts @@ -1,4 +1,4 @@ -/// +/// ////declare function f(); ////declare function f(s: string); diff --git a/tests/cases/fourslash/signatureHelpSimpleConstructorCall.ts b/tests/cases/fourslash/signatureHelpSimpleConstructorCall.ts index 81af0422f9a..8a5fa60ace8 100644 --- a/tests/cases/fourslash/signatureHelpSimpleConstructorCall.ts +++ b/tests/cases/fourslash/signatureHelpSimpleConstructorCall.ts @@ -4,14 +4,14 @@ //// constructor(str: string, num: number) { //// } ////} -////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2); - -goTo.marker('constructorCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); +////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2); + +goTo.marker('constructorCall1'); +verify.signatureHelpCountIs(1); +verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); +verify.currentParameterHelpArgumentNameIs("str"); +verify.currentParameterSpanIs("str: string"); goTo.marker('constructorCall2'); -verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); +verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall"); verify.currentParameterHelpArgumentNameIs("num"); verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash/signatureHelpSimpleFunctionCall.ts b/tests/cases/fourslash/signatureHelpSimpleFunctionCall.ts index 6e5817ad90d..0dc76c0eb0a 100644 --- a/tests/cases/fourslash/signatureHelpSimpleFunctionCall.ts +++ b/tests/cases/fourslash/signatureHelpSimpleFunctionCall.ts @@ -5,15 +5,15 @@ ////} ////functionCall(/*functionCall1*/); ////functionCall("", /*functionCall2*/1); - - -goTo.marker('functionCall1'); -verify.signatureHelpCountIs(1); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); -verify.currentParameterHelpArgumentNameIs("str"); -verify.currentParameterSpanIs("str: string"); + + +goTo.marker('functionCall1'); +verify.signatureHelpCountIs(1); +verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); +verify.currentParameterHelpArgumentNameIs("str"); +verify.currentParameterSpanIs("str: string"); goTo.marker('functionCall2'); -verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); +verify.currentSignatureHelpIs("functionCall(str: string, num: number): void"); verify.currentParameterHelpArgumentNameIs("num"); verify.currentParameterSpanIs("num: number"); diff --git a/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts b/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts index aa2e3e4856c..c65ce2824c0 100644 --- a/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts +++ b/tests/cases/fourslash/signatureHelpSuperConstructorOverload.ts @@ -1,28 +1,28 @@ -/// - -////class SuperOverloadlBase { -//// constructor(); -//// constructor(test: string); -//// constructor(test?: string) { -//// } -////} -////class SuperOverLoad1 extends SuperOverloadlBase { -//// constructor() { -//// super(/*superOverload1*/); -//// } -////} -////class SuperOverLoad2 extends SuperOverloadlBase { -//// constructor() { -//// super(""/*superOverload2*/); -//// } -////} - -goTo.marker('superOverload1'); -verify.signatureHelpCountIs(2); -verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); -verify.currentSignatureParameterCountIs(0); -goTo.marker('superOverload2'); -verify.currentSignatureParameterCountIs(1); -verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); -verify.currentParameterHelpArgumentNameIs("test"); +/// + +////class SuperOverloadlBase { +//// constructor(); +//// constructor(test: string); +//// constructor(test?: string) { +//// } +////} +////class SuperOverLoad1 extends SuperOverloadlBase { +//// constructor() { +//// super(/*superOverload1*/); +//// } +////} +////class SuperOverLoad2 extends SuperOverloadlBase { +//// constructor() { +//// super(""/*superOverload2*/); +//// } +////} + +goTo.marker('superOverload1'); +verify.signatureHelpCountIs(2); +verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase"); +verify.currentSignatureParameterCountIs(0); +goTo.marker('superOverload2'); +verify.currentSignatureParameterCountIs(1); +verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase"); +verify.currentParameterHelpArgumentNameIs("test"); verify.currentParameterSpanIs("test: string"); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpWithInterfaceAsIdentifier.ts b/tests/cases/fourslash/signatureHelpWithInterfaceAsIdentifier.ts index 229d42c0524..cf89b4f4769 100644 --- a/tests/cases/fourslash/signatureHelpWithInterfaceAsIdentifier.ts +++ b/tests/cases/fourslash/signatureHelpWithInterfaceAsIdentifier.ts @@ -1,9 +1,9 @@ -/// - +/// + ////interface C { //// (): void; ////} -////C(/*1*/); - -goTo.marker('1'); +////C(/*1*/); + +goTo.marker('1'); verify.not.signatureHelpPresent(); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpWithUnknown.ts b/tests/cases/fourslash/signatureHelpWithUnknown.ts index 00a031b2673..e2ade663484 100644 --- a/tests/cases/fourslash/signatureHelpWithUnknown.ts +++ b/tests/cases/fourslash/signatureHelpWithUnknown.ts @@ -1,6 +1,6 @@ -/// - -////eval(\/*1*/ - -goTo.marker("1"); -verify.signatureHelpCountIs(1); +/// + +////eval(\/*1*/ + +goTo.marker("1"); +verify.signatureHelpCountIs(1); diff --git a/tests/cases/fourslash/smartIndentActualIndentation.ts b/tests/cases/fourslash/smartIndentActualIndentation.ts index b2874d3c1d8..da47aaf1bc1 100644 --- a/tests/cases/fourslash/smartIndentActualIndentation.ts +++ b/tests/cases/fourslash/smartIndentActualIndentation.ts @@ -1,17 +1,17 @@ -/// - -//// class A { -//// /*1*/ -//// } - -////module M { -//// class C { -//// /*2*/ -//// } -////} - -goTo.marker("1"); -verify.indentationIs(12); - -goTo.marker("2"); -verify.indentationIs(16); +/// + +//// class A { +//// /*1*/ +//// } + +////module M { +//// class C { +//// /*2*/ +//// } +////} + +goTo.marker("1"); +verify.indentationIs(12); + +goTo.marker("2"); +verify.indentationIs(16); diff --git a/tests/cases/fourslash/smartIndentAfterAlignedFunctionArgument.ts b/tests/cases/fourslash/smartIndentAfterAlignedFunctionArgument.ts index d5aa2bc4310..76566e996d5 100644 --- a/tests/cases/fourslash/smartIndentAfterAlignedFunctionArgument.ts +++ b/tests/cases/fourslash/smartIndentAfterAlignedFunctionArgument.ts @@ -1,10 +1,10 @@ -/// - -////function foo(bar, -//// blah, baz, -//// /**/ -////) { }; - -goTo.marker(); -// keep indentation of 'blah' -verify.indentationIs(13); +/// + +////function foo(bar, +//// blah, baz, +//// /**/ +////) { }; + +goTo.marker(); +// keep indentation of 'blah' +verify.indentationIs(13); diff --git a/tests/cases/fourslash/smartIndentClass.ts b/tests/cases/fourslash/smartIndentClass.ts index 5e26781357e..ba2936bd702 100644 --- a/tests/cases/fourslash/smartIndentClass.ts +++ b/tests/cases/fourslash/smartIndentClass.ts @@ -1,21 +1,21 @@ -/// - -////class Bar { -//// {| "indentation": 4|} -//// private foo: string = ""; -//// {| "indentation": 4|} -//// private f() { -//// var a: any[] = [[1, 2], [3, 4], 5]; -//// {| "indentation": 8|} -//// return ((1 + 1)); -//// } -//// {| "indentation": 4|} -//// private f2() { -//// if (true) { } { }; -//// } -////} +/// + +////class Bar { +//// {| "indentation": 4|} +//// private foo: string = ""; +//// {| "indentation": 4|} +//// private f() { +//// var a: any[] = [[1, 2], [3, 4], 5]; +//// {| "indentation": 8|} +//// return ((1 + 1)); +//// } +//// {| "indentation": 4|} +//// private f2() { +//// if (true) { } { }; +//// } +////} ////{| "indentation": 0|} test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); -}); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); +}); diff --git a/tests/cases/fourslash/smartIndentCloseBrace.ts b/tests/cases/fourslash/smartIndentCloseBrace.ts index da2094d76c6..10039075105 100644 --- a/tests/cases/fourslash/smartIndentCloseBrace.ts +++ b/tests/cases/fourslash/smartIndentCloseBrace.ts @@ -1,11 +1,11 @@ -/// - -////class A { -//// {| "indentation": 0|} } -////class B { -//// var x = 1; -//// {| "indentation": 0|} } +/// + +////class A { +//// {| "indentation": 0|} } +////class B { +//// var x = 1; +//// {| "indentation": 0|} } test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); -}); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); +}); diff --git a/tests/cases/fourslash/smartIndentDoStatement.ts b/tests/cases/fourslash/smartIndentDoStatement.ts index 2dff10f9276..d121344bed0 100644 --- a/tests/cases/fourslash/smartIndentDoStatement.ts +++ b/tests/cases/fourslash/smartIndentDoStatement.ts @@ -1,17 +1,17 @@ /// //// do /*1*/ { //// } while (true) -//// -//// do { /*2*/ -//// } /*3*/while (true)/*4*/ - -function verifyIndentationAfterNewLine(marker: string, indentation: number): void { - goTo.marker(marker); - edit.insert("\r\n"); - verify.indentationIs(indentation); -} - -verifyIndentationAfterNewLine("1", 0); -verifyIndentationAfterNewLine("2", 4); -verifyIndentationAfterNewLine("3", 0); -verifyIndentationAfterNewLine("4", 0); +//// +//// do { /*2*/ +//// } /*3*/while (true)/*4*/ + +function verifyIndentationAfterNewLine(marker: string, indentation: number): void { + goTo.marker(marker); + edit.insert("\r\n"); + verify.indentationIs(indentation); +} + +verifyIndentationAfterNewLine("1", 0); +verifyIndentationAfterNewLine("2", 4); +verifyIndentationAfterNewLine("3", 0); +verifyIndentationAfterNewLine("4", 0); diff --git a/tests/cases/fourslash/smartIndentIfStatement.ts b/tests/cases/fourslash/smartIndentIfStatement.ts index fb377ec9c96..5a8c5014a77 100644 --- a/tests/cases/fourslash/smartIndentIfStatement.ts +++ b/tests/cases/fourslash/smartIndentIfStatement.ts @@ -1,20 +1,20 @@ -/// - -//// if /*1*/(true) { } -//// -//// if (true) /*2*/ { /*3*/ -//// } /*4*/ -//// -//// if (1 === /*5*/ 2) { } - -function verifyIndentationAfterNewLine(marker: string, indentation: number): void { - goTo.marker(marker); - edit.insert("\r\n"); - verify.indentationIs(indentation); -} - -verifyIndentationAfterNewLine("1", 4); -verifyIndentationAfterNewLine("2", 0); -verifyIndentationAfterNewLine("3", 4); -verifyIndentationAfterNewLine("4", 0); +/// + +//// if /*1*/(true) { } +//// +//// if (true) /*2*/ { /*3*/ +//// } /*4*/ +//// +//// if (1 === /*5*/ 2) { } + +function verifyIndentationAfterNewLine(marker: string, indentation: number): void { + goTo.marker(marker); + edit.insert("\r\n"); + verify.indentationIs(indentation); +} + +verifyIndentationAfterNewLine("1", 4); +verifyIndentationAfterNewLine("2", 0); +verifyIndentationAfterNewLine("3", 4); +verifyIndentationAfterNewLine("4", 0); verifyIndentationAfterNewLine("5", 4); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentInCallExpressions.ts b/tests/cases/fourslash/smartIndentInCallExpressions.ts index 1e28932678b..27332507613 100644 --- a/tests/cases/fourslash/smartIndentInCallExpressions.ts +++ b/tests/cases/fourslash/smartIndentInCallExpressions.ts @@ -1,4 +1,4 @@ -/// +/// ////module My.App { //// export var appModule = angular.module("app", [ diff --git a/tests/cases/fourslash/smartIndentInsideBlockInsideCase.ts b/tests/cases/fourslash/smartIndentInsideBlockInsideCase.ts index ecff8e8368c..51c74269446 100644 --- a/tests/cases/fourslash/smartIndentInsideBlockInsideCase.ts +++ b/tests/cases/fourslash/smartIndentInsideBlockInsideCase.ts @@ -1,18 +1,18 @@ -/// - -////module SwitchTest { -//// var a = 3; -//// -//// if (a == 5) { -//// switch (a) { -//// case 1: -//// if (a == 5) { -//// /**/ -//// } -//// break; -//// } -//// } -////} - -goTo.marker(); -verify.indentationIs(20); +/// + +////module SwitchTest { +//// var a = 3; +//// +//// if (a == 5) { +//// switch (a) { +//// case 1: +//// if (a == 5) { +//// /**/ +//// } +//// break; +//// } +//// } +////} + +goTo.marker(); +verify.indentationIs(20); diff --git a/tests/cases/fourslash/smartIndentInterface.ts b/tests/cases/fourslash/smartIndentInterface.ts index 3a481ce759f..29fdf77d11e 100644 --- a/tests/cases/fourslash/smartIndentInterface.ts +++ b/tests/cases/fourslash/smartIndentInterface.ts @@ -1,14 +1,14 @@ -/// - -////interface Foo { -//// {| "indentation" : 4 |} -//// x: number; -//// {| "indentation" : 4 |} -//// foo(): number; -//// {| "indentation" : 4 |} -////} -////{| "indentation" : 0 |} +/// + +////interface Foo { +//// {| "indentation" : 4 |} +//// x: number; +//// {| "indentation" : 4 |} +//// foo(): number; +//// {| "indentation" : 4 |} +////} +////{| "indentation" : 0 |} test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); }); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentModule.ts b/tests/cases/fourslash/smartIndentModule.ts index 8cac1ade9ce..12873c71250 100644 --- a/tests/cases/fourslash/smartIndentModule.ts +++ b/tests/cases/fourslash/smartIndentModule.ts @@ -1,12 +1,12 @@ -/// - -////module Foo { -//// /*insideModule*/ -////} -/////*afterModule*/ - -goTo.marker('insideModule'); -verify.indentationIs(4); - -goTo.marker('afterModule'); -verify.indentationIs(0); +/// + +////module Foo { +//// /*insideModule*/ +////} +/////*afterModule*/ + +goTo.marker('insideModule'); +verify.indentationIs(4); + +goTo.marker('afterModule'); +verify.indentationIs(0); diff --git a/tests/cases/fourslash/smartIndentNonterminatedArgumentListAtEOF.ts b/tests/cases/fourslash/smartIndentNonterminatedArgumentListAtEOF.ts index e4ab33fca37..b2b1f746a32 100644 --- a/tests/cases/fourslash/smartIndentNonterminatedArgumentListAtEOF.ts +++ b/tests/cases/fourslash/smartIndentNonterminatedArgumentListAtEOF.ts @@ -1,7 +1,7 @@ -/// - -////function foo(a, -/////**/ - -goTo.marker(); -verify.indentationIs(0); +/// + +////function foo(a, +/////**/ + +goTo.marker(); +verify.indentationIs(0); diff --git a/tests/cases/fourslash/smartIndentNonterminatedIfStatementAtEOF.ts b/tests/cases/fourslash/smartIndentNonterminatedIfStatementAtEOF.ts index 87989b9d85a..0bf4bca5ecb 100644 --- a/tests/cases/fourslash/smartIndentNonterminatedIfStatementAtEOF.ts +++ b/tests/cases/fourslash/smartIndentNonterminatedIfStatementAtEOF.ts @@ -1,7 +1,7 @@ -/// - -////if (true) -/////**/ - -goTo.marker(); -verify.indentationIs(4); +/// + +////if (true) +/////**/ + +goTo.marker(); +verify.indentationIs(4); diff --git a/tests/cases/fourslash/smartIndentOnFunctionParameters.ts b/tests/cases/fourslash/smartIndentOnFunctionParameters.ts index 012c4d93b4a..8823bf46917 100644 --- a/tests/cases/fourslash/smartIndentOnFunctionParameters.ts +++ b/tests/cases/fourslash/smartIndentOnFunctionParameters.ts @@ -1,31 +1,31 @@ -/// - -////function foo(a, -//// /*2*/b,/*0*/ -//// //comment/*3*/ -//// /*4*/c -//// ) { -////}; -////var x = [ -//// /*5*///comment/*1*/ -//// 1,/*6*/ -//// 2/*7*/ -////] -goTo.marker("0"); -edit.insert("\r\n"); -verify.indentationIs(4); -goTo.marker("2"); -verify.currentLineContentIs(" b,"); -goTo.marker("3"); -verify.currentLineContentIs(" //comment"); -goTo.marker("4"); -verify.currentLineContentIs(" c"); -goTo.marker("1"); -edit.insert("\r\n"); -verify.indentationIs(4); -goTo.marker("5"); -verify.currentLineContentIs(" //comment"); -goTo.marker("6"); -verify.currentLineContentIs(" 1,"); -goTo.marker("7"); -verify.currentLineContentIs(" 2"); +/// + +////function foo(a, +//// /*2*/b,/*0*/ +//// //comment/*3*/ +//// /*4*/c +//// ) { +////}; +////var x = [ +//// /*5*///comment/*1*/ +//// 1,/*6*/ +//// 2/*7*/ +////] +goTo.marker("0"); +edit.insert("\r\n"); +verify.indentationIs(4); +goTo.marker("2"); +verify.currentLineContentIs(" b,"); +goTo.marker("3"); +verify.currentLineContentIs(" //comment"); +goTo.marker("4"); +verify.currentLineContentIs(" c"); +goTo.marker("1"); +edit.insert("\r\n"); +verify.indentationIs(4); +goTo.marker("5"); +verify.currentLineContentIs(" //comment"); +goTo.marker("6"); +verify.currentLineContentIs(" 1,"); +goTo.marker("7"); +verify.currentLineContentIs(" 2"); diff --git a/tests/cases/fourslash/smartIndentStartLineInLists.ts b/tests/cases/fourslash/smartIndentStartLineInLists.ts index 0150881ff34..3410b4012ee 100644 --- a/tests/cases/fourslash/smartIndentStartLineInLists.ts +++ b/tests/cases/fourslash/smartIndentStartLineInLists.ts @@ -2,7 +2,7 @@ ////foo(function () { ////}).then(function () {/*1*/ ////}) - -goTo.marker("1"); -edit.insert("\r\n"); + +goTo.marker("1"); +edit.insert("\r\n"); verify.indentationIs(4); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentStatementFor.ts b/tests/cases/fourslash/smartIndentStatementFor.ts index 0412fe66d4e..a3fc2a9a0ce 100644 --- a/tests/cases/fourslash/smartIndentStatementFor.ts +++ b/tests/cases/fourslash/smartIndentStatementFor.ts @@ -1,14 +1,14 @@ -/// - -////function Foo() { -//// for (var i = 0; i < 10; i++) { -//// /*insideStatement*/ -//// } -//// /*afterStatement*/ -////} - -goTo.marker('insideStatement'); -verify.indentationIs(8); - -goTo.marker('afterStatement'); -verify.indentationIs(4); +/// + +////function Foo() { +//// for (var i = 0; i < 10; i++) { +//// /*insideStatement*/ +//// } +//// /*afterStatement*/ +////} + +goTo.marker('insideStatement'); +verify.indentationIs(8); + +goTo.marker('afterStatement'); +verify.indentationIs(4); diff --git a/tests/cases/fourslash/smartIndentStatementForIn.ts b/tests/cases/fourslash/smartIndentStatementForIn.ts index 9e710758864..355f175b7df 100644 --- a/tests/cases/fourslash/smartIndentStatementForIn.ts +++ b/tests/cases/fourslash/smartIndentStatementForIn.ts @@ -1,15 +1,15 @@ -/// - -////function Foo() { -//// for (var i in []) -//// { -//// /*insideStatement*/ -//// } -//// /*afterStatement*/ -////} - -goTo.marker('insideStatement'); -verify.indentationIs(8); - -goTo.marker('afterStatement'); -verify.indentationIs(4); +/// + +////function Foo() { +//// for (var i in []) +//// { +//// /*insideStatement*/ +//// } +//// /*afterStatement*/ +////} + +goTo.marker('insideStatement'); +verify.indentationIs(8); + +goTo.marker('afterStatement'); +verify.indentationIs(4); diff --git a/tests/cases/fourslash/smartIndentStatementSwitch.ts b/tests/cases/fourslash/smartIndentStatementSwitch.ts index e8d2a02948d..c2c2d09fd45 100644 --- a/tests/cases/fourslash/smartIndentStatementSwitch.ts +++ b/tests/cases/fourslash/smartIndentStatementSwitch.ts @@ -1,21 +1,21 @@ -/// - -////function Foo() { -//// var x; -//// switch (x) { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -//// switch (x) { -//// {| "indentation": 8 |} -//// case 1: -//// {| "indentation": 12 |} -//// break; -//// {| "indentation": 12 |} // content of case clauses is always indented relatively to case clause -//// } -//// {| "indentation": 4 |} -////} +/// + +////function Foo() { +//// var x; +//// switch (x) { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +//// switch (x) { +//// {| "indentation": 8 |} +//// case 1: +//// {| "indentation": 12 |} +//// break; +//// {| "indentation": 12 |} // content of case clauses is always indented relatively to case clause +//// } +//// {| "indentation": 4 |} +////} test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); }); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentStatementTryCatchFinally.ts b/tests/cases/fourslash/smartIndentStatementTryCatchFinally.ts index a3bcaf9ac4d..e671dd9dc51 100644 --- a/tests/cases/fourslash/smartIndentStatementTryCatchFinally.ts +++ b/tests/cases/fourslash/smartIndentStatementTryCatchFinally.ts @@ -1,45 +1,45 @@ -/// - -////function tryCatch() { -//// {| "indentation": 4 |} -//// try { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -//// catch (err) { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -////} -//// -////function tryFinally() { -//// {| "indentation": 4 |} -//// try { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -//// finally { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -////} -//// -////function tryCatchFinally() { -//// {| "indentation": 4 |} -//// try { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -//// catch (err) { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -//// finally { -//// {| "indentation": 8 |} -//// } -//// {| "indentation": 4 |} -////} +/// + +////function tryCatch() { +//// {| "indentation": 4 |} +//// try { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +//// catch (err) { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +////} +//// +////function tryFinally() { +//// {| "indentation": 4 |} +//// try { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +//// finally { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +////} +//// +////function tryCatchFinally() { +//// {| "indentation": 4 |} +//// try { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +//// catch (err) { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +//// finally { +//// {| "indentation": 8 |} +//// } +//// {| "indentation": 4 |} +////} test.markers().forEach((marker) => { - verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); + verify.indentationAtPositionIs(marker.fileName, marker.position, marker.data.indentation); }); \ No newline at end of file diff --git a/tests/cases/fourslash/smartIndentStatementWith.ts b/tests/cases/fourslash/smartIndentStatementWith.ts index 799555b8724..311ecafbb3b 100644 --- a/tests/cases/fourslash/smartIndentStatementWith.ts +++ b/tests/cases/fourslash/smartIndentStatementWith.ts @@ -1,15 +1,15 @@ -/// - -////function Foo() { -//// var obj = { a: 'foo' }; -//// with (obj) { -//// /*insideStatement*/ -//// } -//// /*afterStatement*/ -////} - -goTo.marker('insideStatement'); -verify.indentationIs(8); - -goTo.marker('afterStatement'); -verify.indentationIs(4); +/// + +////function Foo() { +//// var obj = { a: 'foo' }; +//// with (obj) { +//// /*insideStatement*/ +//// } +//// /*afterStatement*/ +////} + +goTo.marker('insideStatement'); +verify.indentationIs(8); + +goTo.marker('afterStatement'); +verify.indentationIs(4); diff --git a/tests/cases/fourslash/spaceAfterReturn.ts b/tests/cases/fourslash/spaceAfterReturn.ts index 16b44d81024..b5d26ae9819 100644 --- a/tests/cases/fourslash/spaceAfterReturn.ts +++ b/tests/cases/fourslash/spaceAfterReturn.ts @@ -1,15 +1,15 @@ -/// - -////function f( ) { -////return 1;/*1*/ -////return[1];/*2*/ -////return ;/*3*/ -////} - -format.document(); -goTo.marker("1"); -verify.currentLineContentIs(" return 1;"); -goTo.marker("2"); -verify.currentLineContentIs(" return [1];"); -goTo.marker("3"); +/// + +////function f( ) { +////return 1;/*1*/ +////return[1];/*2*/ +////return ;/*3*/ +////} + +format.document(); +goTo.marker("1"); +verify.currentLineContentIs(" return 1;"); +goTo.marker("2"); +verify.currentLineContentIs(" return [1];"); +goTo.marker("3"); verify.currentLineContentIs(" return;"); \ No newline at end of file diff --git a/tests/cases/fourslash/squiggleFunctionExpression.ts b/tests/cases/fourslash/squiggleFunctionExpression.ts index 3477f31db3a..75cca339e9d 100644 --- a/tests/cases/fourslash/squiggleFunctionExpression.ts +++ b/tests/cases/fourslash/squiggleFunctionExpression.ts @@ -1,9 +1,9 @@ -/// - -////function takesCallback(callback: (n) => any) { } -////takesCallback(function inner(n) { var /*1*/k/*2*/: string = 10; }); - -verify.errorExistsBetweenMarkers("1", "2"); -verify.not.errorExistsBeforeMarker("1"); -verify.not.errorExistsAfterMarker("2"); -verify.numberOfErrorsInCurrentFile(1); +/// + +////function takesCallback(callback: (n) => any) { } +////takesCallback(function inner(n) { var /*1*/k/*2*/: string = 10; }); + +verify.errorExistsBetweenMarkers("1", "2"); +verify.not.errorExistsBeforeMarker("1"); +verify.not.errorExistsAfterMarker("2"); +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/squiggleIllegalClassExtension.ts b/tests/cases/fourslash/squiggleIllegalClassExtension.ts index 21919835a64..357b4ef9ac0 100644 --- a/tests/cases/fourslash/squiggleIllegalClassExtension.ts +++ b/tests/cases/fourslash/squiggleIllegalClassExtension.ts @@ -1,6 +1,6 @@ -/// - -////class Foo extends /*1*/Bar/*2*/ { } - -verify.errorExistsBetweenMarkers("1", "2"); -verify.numberOfErrorsInCurrentFile(1); +/// + +////class Foo extends /*1*/Bar/*2*/ { } + +verify.errorExistsBetweenMarkers("1", "2"); +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/squiggleIllegalInterfaceExtension.ts b/tests/cases/fourslash/squiggleIllegalInterfaceExtension.ts index 4946353360c..636ce23f686 100644 --- a/tests/cases/fourslash/squiggleIllegalInterfaceExtension.ts +++ b/tests/cases/fourslash/squiggleIllegalInterfaceExtension.ts @@ -1,8 +1,8 @@ -/// - -////var n = '';/**/ -////interface x extends /*1*/string/*2*/ {} - -verify.not.errorExistsBeforeMarker(); -verify.errorExistsBetweenMarkers("1", "2"); -verify.numberOfErrorsInCurrentFile(1); +/// + +////var n = '';/**/ +////interface x extends /*1*/string/*2*/ {} + +verify.not.errorExistsBeforeMarker(); +verify.errorExistsBetweenMarkers("1", "2"); +verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/squiggleIllegalSubclassOverride.ts b/tests/cases/fourslash/squiggleIllegalSubclassOverride.ts index fe9774d7bf9..bb7b40fd259 100644 --- a/tests/cases/fourslash/squiggleIllegalSubclassOverride.ts +++ b/tests/cases/fourslash/squiggleIllegalSubclassOverride.ts @@ -1,12 +1,12 @@ -/// - -////class Foo { -//// public x: number; -////} -//// -////class /*1*/Bar/*2*/ extends Foo { -//// public x: string; -////} - -verify.errorExistsBetweenMarkers("1", "2"); +/// + +////class Foo { +//// public x: number; +////} +//// +////class /*1*/Bar/*2*/ extends Foo { +//// public x: string; +////} + +verify.errorExistsBetweenMarkers("1", "2"); verify.numberOfErrorsInCurrentFile(1); \ No newline at end of file diff --git a/tests/cases/fourslash/squiggleUnclosedStringLiteral.ts b/tests/cases/fourslash/squiggleUnclosedStringLiteral.ts index 3d2dca0303b..cf4dc19ffb6 100644 --- a/tests/cases/fourslash/squiggleUnclosedStringLiteral.ts +++ b/tests/cases/fourslash/squiggleUnclosedStringLiteral.ts @@ -1,11 +1,11 @@ -/// - -////var x = /*1*/"asd -/////*2*/var y = 2; -verify.errorExistsAfterMarker("1"); -verify.not.errorExistsAfterMarker("2"); -verify.numberOfErrorsInCurrentFile(1); - - - - +/// + +////var x = /*1*/"asd +/////*2*/var y = 2; +verify.errorExistsAfterMarker("1"); +verify.not.errorExistsAfterMarker("2"); +verify.numberOfErrorsInCurrentFile(1); + + + + diff --git a/tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts b/tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts index 2ad60dbb6bc..59c78b5e5d6 100644 --- a/tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts +++ b/tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts @@ -1,13 +1,13 @@ -/// - -//// class TestClass { -//// public function foo(x: string): void; -//// public function foo(): void; -//// foo(x: any): void { -//// this.bar(/**/x); // should not error -//// } -//// } -//// - -goTo.marker(); +/// + +//// class TestClass { +//// public function foo(x: string): void; +//// public function foo(): void; +//// foo(x: any): void { +//// this.bar(/**/x); // should not error +//// } +//// } +//// + +goTo.marker(); verify.quickInfoExists(); \ No newline at end of file diff --git a/tests/cases/fourslash/syntacticClassificationsObjectLiteral.ts b/tests/cases/fourslash/syntacticClassificationsObjectLiteral.ts index a7e8f7b7b07..59642468ce9 100644 --- a/tests/cases/fourslash/syntacticClassificationsObjectLiteral.ts +++ b/tests/cases/fourslash/syntacticClassificationsObjectLiteral.ts @@ -1,4 +1,4 @@ -/// +/// ////var v = 10e0; ////var x = { diff --git a/tests/cases/fourslash/syntacticClassificationsTemplates1.ts b/tests/cases/fourslash/syntacticClassificationsTemplates1.ts index 4c79c047c81..8ee48fb8a11 100644 --- a/tests/cases/fourslash/syntacticClassificationsTemplates1.ts +++ b/tests/cases/fourslash/syntacticClassificationsTemplates1.ts @@ -1,4 +1,4 @@ -/// +/// ////var v = 10e0; ////var x = { diff --git a/tests/cases/fourslash/syntacticClassificationsTemplates2.ts b/tests/cases/fourslash/syntacticClassificationsTemplates2.ts index 19bad4b54a8..913dc039012 100644 --- a/tests/cases/fourslash/syntacticClassificationsTemplates2.ts +++ b/tests/cases/fourslash/syntacticClassificationsTemplates2.ts @@ -1,4 +1,4 @@ -/// +/// ////var tiredOfCanonicalExamples = ////`goodbye "${ `hello world` }" diff --git a/tests/cases/fourslash/toggleDuplicateFunctionDeclaration.ts b/tests/cases/fourslash/toggleDuplicateFunctionDeclaration.ts index a68bc7f7d0a..b8ed3ea9e5f 100644 --- a/tests/cases/fourslash/toggleDuplicateFunctionDeclaration.ts +++ b/tests/cases/fourslash/toggleDuplicateFunctionDeclaration.ts @@ -1,12 +1,12 @@ -/// - -//// class D { } -//// D(); - -var funcDecl = 'declare function D();'; - -goTo.bof(); -edit.insert(funcDecl); - -goTo.bof(); -edit.deleteAtCaret(funcDecl.length); +/// + +//// class D { } +//// D(); + +var funcDecl = 'declare function D();'; + +goTo.bof(); +edit.insert(funcDecl); + +goTo.bof(); +edit.deleteAtCaret(funcDecl.length); diff --git a/tests/cases/fourslash/typeAboveNumberLiteralExpressionStatement.ts b/tests/cases/fourslash/typeAboveNumberLiteralExpressionStatement.ts index ece781cbcb0..c28f7e5cba6 100644 --- a/tests/cases/fourslash/typeAboveNumberLiteralExpressionStatement.ts +++ b/tests/cases/fourslash/typeAboveNumberLiteralExpressionStatement.ts @@ -1,9 +1,9 @@ -/// - -//// -//// // foo -//// 1; - - -goTo.bof(); -edit.insert("var x;\n"); +/// + +//// +//// // foo +//// 1; + + +goTo.bof(); +edit.insert("var x;\n"); diff --git a/tests/cases/fourslash/typeCheckAfterAddingGenericParameter.ts b/tests/cases/fourslash/typeCheckAfterAddingGenericParameter.ts index fa312f3c711..5f8d3ed9e3c 100644 --- a/tests/cases/fourslash/typeCheckAfterAddingGenericParameter.ts +++ b/tests/cases/fourslash/typeCheckAfterAddingGenericParameter.ts @@ -1,22 +1,22 @@ -/// - -//// function f() { } -//// function f2(b: X): X { return null; } -//// class C { -//// public f() {} -//// f2(b): X { return null; } -//// } -//// -//// interface I { -//// f(); -//// f2(/*addParam*/a: X): X; -//// } -//// - -goTo.marker('addParam'); - -edit.insert(", X"); - -goTo.marker('addTypeParam'); - -edit.insert(", X"); +/// + +//// function f() { } +//// function f2(b: X): X { return null; } +//// class C { +//// public f() {} +//// f2(b): X { return null; } +//// } +//// +//// interface I { +//// f(); +//// f2(/*addParam*/a: X): X; +//// } +//// + +goTo.marker('addParam'); + +edit.insert(", X"); + +goTo.marker('addTypeParam'); + +edit.insert(", X"); diff --git a/tests/cases/fourslash/typeCheckObjectInArrayLiteral.ts b/tests/cases/fourslash/typeCheckObjectInArrayLiteral.ts index 621fe111bfb..5e321ec6b56 100644 --- a/tests/cases/fourslash/typeCheckObjectInArrayLiteral.ts +++ b/tests/cases/fourslash/typeCheckObjectInArrayLiteral.ts @@ -1,7 +1,7 @@ -/// - -//// declare function create(initialValues); -//// create([{}]); - -goTo.position(0); -edit.insert(''); +/// + +//// declare function create(initialValues); +//// create([{}]); + +goTo.position(0); +edit.insert(''); diff --git a/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts b/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts index c5abd2e0279..57246938325 100644 --- a/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts +++ b/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts @@ -1,20 +1,20 @@ -/// - -//// class Dictionary { -//// } -//// -//// module Maps { -//// class C1 extends D/*1*/ictionary { } -//// /*2*/ -//// } -//// - -// Sanity check: type name here should include the type parameter -goTo.marker('1'); -verify.quickInfoIs('class Dictionary'); - -// Add a similar class -- name does not match -goTo.marker('2'); -edit.insert("class C2 extends Dictionary { }"); -edit.moveLeft('ictionary { }'.length); -verify.quickInfoIs('class Dictionary'); +/// + +//// class Dictionary { +//// } +//// +//// module Maps { +//// class C1 extends D/*1*/ictionary { } +//// /*2*/ +//// } +//// + +// Sanity check: type name here should include the type parameter +goTo.marker('1'); +verify.quickInfoIs('class Dictionary'); + +// Add a similar class -- name does not match +goTo.marker('2'); +edit.insert("class C2 extends Dictionary { }"); +edit.moveLeft('ictionary { }'.length); +verify.quickInfoIs('class Dictionary'); diff --git a/tests/cases/fourslash/unclosedArrayErrorRecovery.ts b/tests/cases/fourslash/unclosedArrayErrorRecovery.ts index 3741b33ec58..3d9e4acea53 100644 --- a/tests/cases/fourslash/unclosedArrayErrorRecovery.ts +++ b/tests/cases/fourslash/unclosedArrayErrorRecovery.ts @@ -1,6 +1,6 @@ -/// - -////var table: number[; -/////**/table.push(1) - +/// + +////var table: number[; +/////**/table.push(1) + verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedCommentsInConstructor.ts b/tests/cases/fourslash/unclosedCommentsInConstructor.ts index 8bda1505baa..a81bfb1fbf2 100644 --- a/tests/cases/fourslash/unclosedCommentsInConstructor.ts +++ b/tests/cases/fourslash/unclosedCommentsInConstructor.ts @@ -1,8 +1,8 @@ -/// - -////class Foo { -//// constructor(/*/**/) { } -////} - -goTo.marker(); +/// + +////class Foo { +//// constructor(/*/**/) { } +////} + +goTo.marker(); // verify.completionListIsEmpty(); // TODO: difference between LS and FourSlash \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedFunctionErrorRecovery.ts b/tests/cases/fourslash/unclosedFunctionErrorRecovery.ts index 0f5007da2df..790d9ea689a 100644 --- a/tests/cases/fourslash/unclosedFunctionErrorRecovery.ts +++ b/tests/cases/fourslash/unclosedFunctionErrorRecovery.ts @@ -1,8 +1,8 @@ -/// - -////function alpha() { -//// -////function beta() { /*1*/alpha()/*2*/; } -//// - +/// + +////function alpha() { +//// +////function beta() { /*1*/alpha()/*2*/; } +//// + verify.not.errorExistsBetweenMarkers("1", "2"); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts b/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts index f9bfe7bdc1c..bcb79811a62 100644 --- a/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts +++ b/tests/cases/fourslash/unclosedFunctionErrorRecovery3.ts @@ -1,6 +1,6 @@ -/// - -//// class alpha { static beta() return 5; } } -//// /**/ var gamma = alpha.beta() * 5; - +/// + +//// class alpha { static beta() return 5; } } +//// /**/ var gamma = alpha.beta() * 5; + verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedMultilineStringLiteralErrorRecovery.ts b/tests/cases/fourslash/unclosedMultilineStringLiteralErrorRecovery.ts index 357d419a927..cf3a51c9f0f 100644 --- a/tests/cases/fourslash/unclosedMultilineStringLiteralErrorRecovery.ts +++ b/tests/cases/fourslash/unclosedMultilineStringLiteralErrorRecovery.ts @@ -1,10 +1,10 @@ -/// - -////function alpha() { -//// var x = "x\ -//// -//// /**/ -//// var y = 1; -////} - +/// + +////function alpha() { +//// var x = "x\ +//// +//// /**/ +//// var y = 1; +////} + verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedStringLiteralAutoformating.ts b/tests/cases/fourslash/unclosedStringLiteralAutoformating.ts index 3c3afd93548..2f3c0e7494b 100644 --- a/tests/cases/fourslash/unclosedStringLiteralAutoformating.ts +++ b/tests/cases/fourslash/unclosedStringLiteralAutoformating.ts @@ -1,10 +1,10 @@ -/// - -////var x = /*1*/"asd/*2*/ -////class Foo { -//// /**/ - -//verify.errorExistsBetweenMarkers("1", "2"); -goTo.marker(); -edit.insert("}"); +/// + +////var x = /*1*/"asd/*2*/ +////class Foo { +//// /**/ + +//verify.errorExistsBetweenMarkers("1", "2"); +goTo.marker(); +edit.insert("}"); verify.currentLineContentIs("}"); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery2.ts b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery2.ts index a6be78c6b5a..ccae2bd4a79 100644 --- a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery2.ts +++ b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery2.ts @@ -1,12 +1,12 @@ -/// - -////function alpha() { -//// -//// var x = "x\ -//// var y = 1; -//// function beta() { } -//// beta(; -//// /**/ -////} -verify.not.errorExistsAfterMarker(); - +/// + +////function alpha() { +//// +//// var x = "x\ +//// var y = 1; +//// function beta() { } +//// beta(; +//// /**/ +////} +verify.not.errorExistsAfterMarker(); + diff --git a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery3.ts b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery3.ts index a2d94e683aa..b1ef837a982 100644 --- a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery3.ts +++ b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery3.ts @@ -1,11 +1,11 @@ -/// - -////function alpha() { -//// -//// var x = "x\ -//// -//// /**/var y = 1; -//// -////} - +/// + +////function alpha() { +//// +//// var x = "x\ +//// +//// /**/var y = 1; +//// +////} + verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery4.ts b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery4.ts index 48c49f5064c..4d849a15334 100644 --- a/tests/cases/fourslash/unclosedStringLiteralErrorRecovery4.ts +++ b/tests/cases/fourslash/unclosedStringLiteralErrorRecovery4.ts @@ -1,9 +1,9 @@ -/// - -////function alpha() { -//// var x = "x -/////**/var y = "y"; -////} - -goTo.marker(); +/// + +////function alpha() { +//// var x = "x +/////**/var y = "y"; +////} + +goTo.marker(); verify.not.errorExistsAfterMarker(); \ No newline at end of file diff --git a/tests/cases/fourslash/underscoreTyping1.ts b/tests/cases/fourslash/underscoreTyping1.ts index fddafe5e88e..be7d20427e2 100644 --- a/tests/cases/fourslash/underscoreTyping1.ts +++ b/tests/cases/fourslash/underscoreTyping1.ts @@ -1,6 +1,6 @@ /// - -// @module: CommonJS + +// @module: CommonJS //// interface Dictionary { //// [x: string]: T; diff --git a/tests/cases/fourslash/unknownVariableErrorRecovery.ts b/tests/cases/fourslash/unknownVariableErrorRecovery.ts index b2e6adba983..c10df493f38 100644 --- a/tests/cases/fourslash/unknownVariableErrorRecovery.ts +++ b/tests/cases/fourslash/unknownVariableErrorRecovery.ts @@ -1,9 +1,9 @@ -/// - -////var foo = [1, 2, 3]; -////for (var bar = 0; foo[bar] < 5; bear/**/++ ) { -//// foo[bar] = 0; -////} - -verify.not.errorExistsAfterMarker(); - +/// + +////var foo = [1, 2, 3]; +////for (var bar = 0; foo[bar] < 5; bear/**/++ ) { +//// foo[bar] = 0; +////} + +verify.not.errorExistsAfterMarker(); + diff --git a/tests/cases/fourslash/whiteSpaceTrimming.ts b/tests/cases/fourslash/whiteSpaceTrimming.ts index 3e842e5a3a4..a77726f3ec1 100644 --- a/tests/cases/fourslash/whiteSpaceTrimming.ts +++ b/tests/cases/fourslash/whiteSpaceTrimming.ts @@ -1,10 +1,10 @@ -/// +/// ////if (true) { -//// // -//// /*err*/} - -goTo.marker('err'); -edit.insert("\n"); - -verify.currentFileContentIs("if (true) { \n // \n\n}"); +//// // +//// /*err*/} + +goTo.marker('err'); +edit.insert("\n"); + +verify.currentFileContentIs("if (true) { \n // \n\n}");