From 430f3613534877b4e1f1e8a26c958f231e1eccbd Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 7 Oct 2014 11:30:27 -0700 Subject: [PATCH] Enabling more test cases --- .../addMemberToModule.ts | 2 +- .../basicClassMembers.ts | 0 .../bestCommonTypeObjectLiterals1.ts | 20 +- .../cloduleAsBaseClass2.ts | 0 .../cloduleTypeOf1.ts | 8 +- .../cloduleWithRecursiveReference.ts | 4 +- .../completionListWithModulesFromModule.ts | 37 +-- ...pletionListWithModulesInsideModuleScope.ts | 106 ++++----- ...letionListWithModulesOutsideModuleScope.ts | 18 +- ...etionListWithModulesOutsideModuleScope2.ts | 10 +- .../contextualTyping.ts | 220 +++++++++--------- .../contextualTypingFromTypeAssertion1.ts | 7 + .../contextualTypingGenericFunction1.ts | 20 ++ .../contextualTypingOfArrayLiterals1.ts | 24 +- ...ontextualTypingOfGenericCallSignatures1.ts | 4 +- ...ontextualTypingOfGenericCallSignatures2.ts | 4 +- .../contextualTypingReturnExpressions.ts | 13 ++ .../defaultParamsAndContextualTypes.ts | 4 +- ...erivedTypeIndexerWithGenericConstraints.ts | 4 +- .../distinctTypesInCallbacksWithSameNames.ts | 0 .../duplicateIndexers.ts | 4 +- .../duplicateTypeParameters.ts | 2 +- tests/cases/fourslash/emptyArrayInference.ts | 10 + ...ariableDeclOfMergedVariableAndClassDecl.ts | 2 +- .../exportEqualCallableInterface.ts | 0 .../exportEqualTypes.ts | 12 +- .../extendArray.ts | 8 +- .../extendArrayInterfaceMember.ts | 8 +- .../extendInterfaceOverloadedMethod.ts | 4 +- .../extendsTArray.ts | 4 +- .../externalModuleIntellisense.ts | 0 .../externalModuleWithExportAssignment.ts | 61 ++--- .../funduleWithRecursiveReference.ts | 4 +- ...genericCallSignaturesInNonGenericTypes1.ts | 4 +- ...genericCallSignaturesInNonGenericTypes2.ts | 4 +- .../genericCallsWithOptionalParams1.ts | 8 +- .../genericCombinatorWithConstraints1.ts | 13 ++ tests/cases/fourslash/genericCombinators1.ts | 101 ++++++++ tests/cases/fourslash/genericCombinators2.ts | 136 +++++++++++ .../genericCombinators3.ts | 10 +- ...genericDerivedTypeAcrossModuleBoundary1.ts | 8 +- .../fourslash/genericFunctionReturnType.ts | 12 +- .../fourslash/genericFunctionReturnType2.ts | 12 +- .../genericMapTyping1.ts | 18 +- .../genericTypeArgumentInference1.ts | 40 ++++ .../genericTypeArgumentInference2.ts | 40 ++++ .../genericTypeParamUnrelatedToArguments1.ts | 12 +- .../genericTypeWithMultipleBases1.ts | 6 +- .../genericWithSpecializedProperties1.ts | 24 ++ .../genericWithSpecializedProperties2.ts | 23 ++ .../genericWithSpecializedProperties3.ts | 24 ++ .../incrementalResolveAccessor.ts | 2 +- tests/cases/fourslash/indexerReturnTypes1.ts | 111 +++++++++ .../instanceTypesForGenericType1.ts | 6 +- .../intellisenseInObjectLiteral.ts | 4 +- .../memberListOfModuleInAnotherModule.ts | 37 +++ ...mergedDeclarationsWithExportAssignment1.ts | 15 +- .../missingMethodAfterEditAfterImport.ts | 4 +- .../moduleVariables.ts | 6 +- .../multiModuleFundule1.ts | 8 +- .../nameOfRetypedClassInModule.ts | 16 +- tests/cases/fourslash/noTypeParameterInLHS.ts | 11 + tests/cases/fourslash/numericPropertyNames.ts | 6 + .../objectLiteralCallSignatures.ts | 8 +- .../fourslash/overloadOnConstCallSignature.ts | 6 +- .../overloadQuickInfo.ts | 2 +- .../promiseTyping1.ts | 6 +- .../promiseTyping2.ts | 14 +- tests/cases/fourslash/prototypeProperty.ts | 11 + .../recursiveClassReference.ts | 2 +- .../cases/fourslash/recursiveObjectLiteral.ts | 6 + tests/cases/fourslash/regexp.ts | 6 + .../restParamsContextuallyTyped.ts | 6 +- .../returnTypeOfGenericFunction1.ts | 4 +- .../selfReferencedExternalModule.ts | 4 +- .../selfReferencedExternalModule2.ts | 8 +- .../staticPrototypePropertyOnClass.ts | 8 +- .../stringPropertyNames1.ts | 4 +- .../stringPropertyNames2.ts | 4 +- ...symbolNameAtUnparseableFunctionOverload.ts | 0 .../thisBindingInLambda.ts | 2 +- .../transitiveExportImports.ts | 2 +- .../typeCheckAfterResolve.ts | 2 +- .../typeOfAFundule.ts | 4 +- .../typeOfThisInStatics.ts | 8 +- .../typeParameterListInQuickInfoAfterEdit.ts | 4 +- .../fourslash/typedGenericPrototypeMember.ts | 13 ++ tests/cases/fourslash/underscoreTypings1.ts | 62 +++++ .../verifySingleFileEmitOutput1.ts | 4 +- tests/cases/fourslash/widenedTypes.ts | 18 ++ .../automaticConstructorToggling.ts | 32 +-- ...foreSemanticDiagnosticsInArrowFunction1.ts | 2 +- .../contextualTypingFromTypeAssertion1.ts | 7 - .../contextualTypingGenericFunction1.ts | 20 -- .../contextualTypingReturnExpressions.ts | 13 -- .../fourslash_old/emptyArrayInference.ts | 10 - .../externalModuleWithExportAssignment.ts | 87 ------- .../genericCombinatorWithConstraints1.ts | 13 -- .../fourslash_old/genericCombinators1.ts | 101 -------- .../fourslash_old/genericCombinators2.ts | 136 ----------- .../genericFunctionReturnType.ts | 21 -- .../genericFunctionReturnType2.ts | 24 -- .../genericTypeArgumentInference1.ts | 40 ---- .../genericTypeArgumentInference2.ts | 40 ---- .../genericWithSpecializedProperties1.ts | 24 -- .../genericWithSpecializedProperties2.ts | 23 -- .../genericWithSpecializedProperties3.ts | 24 -- .../fourslash_old/indexerReturnTypes1.ts | 111 --------- .../memberListOfModuleInAnotherModule.ts | 38 --- .../fourslash_old/noTypeParameterInLHS.ts | 11 - .../fourslash_old/numericPropertyNames.ts | 6 - .../overloadOnConstCallSignature.ts | 18 -- tests/cases/fourslash_old/proto.ts | 8 +- .../cases/fourslash_old/prototypeProperty.ts | 11 - .../fourslash_old/recursiveObjectLiteral.ts | 6 - tests/cases/fourslash_old/regexp.ts | 6 - tests/cases/fourslash_old/restArgType.ts | 66 +++--- .../typedGenericPrototypeMember.ts | 13 -- .../cases/fourslash_old/underscoreTypings1.ts | 62 ----- tests/cases/fourslash_old/widenedTypes.ts | 18 -- 120 files changed, 1204 insertions(+), 1350 deletions(-) rename tests/cases/{fourslash_old => fourslash}/addMemberToModule.ts (91%) rename tests/cases/{fourslash_old => fourslash}/basicClassMembers.ts (100%) rename tests/cases/{fourslash_old => fourslash}/bestCommonTypeObjectLiterals1.ts (51%) rename tests/cases/{fourslash_old => fourslash}/cloduleAsBaseClass2.ts (100%) rename tests/cases/{fourslash_old => fourslash}/cloduleTypeOf1.ts (71%) rename tests/cases/{fourslash_old => fourslash}/cloduleWithRecursiveReference.ts (67%) rename tests/cases/{fourslash_old => fourslash}/completionListWithModulesFromModule.ts (87%) rename tests/cases/{fourslash_old => fourslash}/completionListWithModulesInsideModuleScope.ts (70%) rename tests/cases/{fourslash_old => fourslash}/completionListWithModulesOutsideModuleScope.ts (92%) rename tests/cases/{fourslash_old => fourslash}/completionListWithModulesOutsideModuleScope2.ts (95%) rename tests/cases/{fourslash_old => fourslash}/contextualTyping.ts (59%) create mode 100644 tests/cases/fourslash/contextualTypingFromTypeAssertion1.ts create mode 100644 tests/cases/fourslash/contextualTypingGenericFunction1.ts rename tests/cases/{fourslash_old => fourslash}/contextualTypingOfArrayLiterals1.ts (58%) rename tests/cases/{fourslash_old => fourslash}/contextualTypingOfGenericCallSignatures1.ts (60%) rename tests/cases/{fourslash_old => fourslash}/contextualTypingOfGenericCallSignatures2.ts (75%) create mode 100644 tests/cases/fourslash/contextualTypingReturnExpressions.ts rename tests/cases/{fourslash_old => fourslash}/defaultParamsAndContextualTypes.ts (76%) rename tests/cases/{fourslash_old => fourslash}/derivedTypeIndexerWithGenericConstraints.ts (77%) rename tests/cases/{fourslash_old => fourslash}/distinctTypesInCallbacksWithSameNames.ts (100%) rename tests/cases/{fourslash_old => fourslash}/duplicateIndexers.ts (68%) rename tests/cases/{fourslash_old => fourslash}/duplicateTypeParameters.ts (73%) create mode 100644 tests/cases/fourslash/emptyArrayInference.ts rename tests/cases/{fourslash_old => fourslash}/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts (84%) rename tests/cases/{fourslash_old => fourslash}/exportEqualCallableInterface.ts (100%) rename tests/cases/{fourslash_old => fourslash}/exportEqualTypes.ts (60%) rename tests/cases/{fourslash_old => fourslash}/extendArray.ts (59%) rename tests/cases/{fourslash_old => fourslash}/extendArrayInterfaceMember.ts (72%) rename tests/cases/{fourslash_old => fourslash}/extendInterfaceOverloadedMethod.ts (76%) rename tests/cases/{fourslash_old => fourslash}/extendsTArray.ts (67%) rename tests/cases/{fourslash_old => fourslash}/externalModuleIntellisense.ts (100%) rename tests/cases/{fourslash_old => fourslash}/funduleWithRecursiveReference.ts (65%) rename tests/cases/{fourslash_old => fourslash}/genericCallSignaturesInNonGenericTypes1.ts (75%) rename tests/cases/{fourslash_old => fourslash}/genericCallSignaturesInNonGenericTypes2.ts (62%) rename tests/cases/{fourslash_old => fourslash}/genericCallsWithOptionalParams1.ts (61%) create mode 100644 tests/cases/fourslash/genericCombinatorWithConstraints1.ts create mode 100644 tests/cases/fourslash/genericCombinators1.ts create mode 100644 tests/cases/fourslash/genericCombinators2.ts rename tests/cases/{fourslash_old => fourslash}/genericCombinators3.ts (53%) rename tests/cases/{fourslash_old => fourslash}/genericDerivedTypeAcrossModuleBoundary1.ts (64%) rename tests/cases/{fourslash_old => fourslash}/genericMapTyping1.ts (72%) create mode 100644 tests/cases/fourslash/genericTypeArgumentInference1.ts create mode 100644 tests/cases/fourslash/genericTypeArgumentInference2.ts rename tests/cases/{fourslash_old => fourslash}/genericTypeParamUnrelatedToArguments1.ts (58%) rename tests/cases/{fourslash_old => fourslash}/genericTypeWithMultipleBases1.ts (54%) create mode 100644 tests/cases/fourslash/genericWithSpecializedProperties1.ts create mode 100644 tests/cases/fourslash/genericWithSpecializedProperties2.ts create mode 100644 tests/cases/fourslash/genericWithSpecializedProperties3.ts rename tests/cases/{fourslash_old => fourslash}/incrementalResolveAccessor.ts (79%) create mode 100644 tests/cases/fourslash/indexerReturnTypes1.ts rename tests/cases/{fourslash_old => fourslash}/instanceTypesForGenericType1.ts (62%) rename tests/cases/{fourslash_old => fourslash}/intellisenseInObjectLiteral.ts (60%) create mode 100644 tests/cases/fourslash/memberListOfModuleInAnotherModule.ts rename tests/cases/{fourslash_old => fourslash}/mergedDeclarationsWithExportAssignment1.ts (64%) rename tests/cases/{fourslash_old => fourslash}/missingMethodAfterEditAfterImport.ts (79%) rename tests/cases/{fourslash_old => fourslash}/moduleVariables.ts (63%) rename tests/cases/{fourslash_old => fourslash}/multiModuleFundule1.ts (68%) rename tests/cases/{fourslash_old => fourslash}/nameOfRetypedClassInModule.ts (50%) create mode 100644 tests/cases/fourslash/noTypeParameterInLHS.ts create mode 100644 tests/cases/fourslash/numericPropertyNames.ts rename tests/cases/{fourslash_old => fourslash}/objectLiteralCallSignatures.ts (60%) rename tests/cases/{fourslash_old => fourslash}/overloadQuickInfo.ts (90%) rename tests/cases/{fourslash_old => fourslash}/promiseTyping1.ts (84%) rename tests/cases/{fourslash_old => fourslash}/promiseTyping2.ts (74%) create mode 100644 tests/cases/fourslash/prototypeProperty.ts rename tests/cases/{fourslash_old => fourslash}/recursiveClassReference.ts (84%) create mode 100644 tests/cases/fourslash/recursiveObjectLiteral.ts create mode 100644 tests/cases/fourslash/regexp.ts rename tests/cases/{fourslash_old => fourslash}/restParamsContextuallyTyped.ts (50%) rename tests/cases/{fourslash_old => fourslash}/returnTypeOfGenericFunction1.ts (67%) rename tests/cases/{fourslash_old => fourslash}/selfReferencedExternalModule.ts (56%) rename tests/cases/{fourslash_old => fourslash}/selfReferencedExternalModule2.ts (62%) rename tests/cases/{fourslash_old => fourslash}/staticPrototypePropertyOnClass.ts (59%) rename tests/cases/{fourslash_old => fourslash}/stringPropertyNames1.ts (63%) rename tests/cases/{fourslash_old => fourslash}/stringPropertyNames2.ts (64%) rename tests/cases/{fourslash_old => fourslash}/symbolNameAtUnparseableFunctionOverload.ts (100%) rename tests/cases/{fourslash_old => fourslash}/thisBindingInLambda.ts (78%) rename tests/cases/{fourslash_old => fourslash}/transitiveExportImports.ts (75%) rename tests/cases/{fourslash_old => fourslash}/typeCheckAfterResolve.ts (93%) rename tests/cases/{fourslash_old => fourslash}/typeOfAFundule.ts (67%) rename tests/cases/{fourslash_old => fourslash}/typeOfThisInStatics.ts (52%) rename tests/cases/{fourslash_old => fourslash}/typeParameterListInQuickInfoAfterEdit.ts (82%) create mode 100644 tests/cases/fourslash/typedGenericPrototypeMember.ts create mode 100644 tests/cases/fourslash/underscoreTypings1.ts rename tests/cases/{fourslash_old => fourslash}/verifySingleFileEmitOutput1.ts (78%) create mode 100644 tests/cases/fourslash/widenedTypes.ts delete mode 100644 tests/cases/fourslash_old/contextualTypingFromTypeAssertion1.ts delete mode 100644 tests/cases/fourslash_old/contextualTypingGenericFunction1.ts delete mode 100644 tests/cases/fourslash_old/contextualTypingReturnExpressions.ts delete mode 100644 tests/cases/fourslash_old/emptyArrayInference.ts delete mode 100644 tests/cases/fourslash_old/externalModuleWithExportAssignment.ts delete mode 100644 tests/cases/fourslash_old/genericCombinatorWithConstraints1.ts delete mode 100644 tests/cases/fourslash_old/genericCombinators1.ts delete mode 100644 tests/cases/fourslash_old/genericCombinators2.ts delete mode 100644 tests/cases/fourslash_old/genericFunctionReturnType.ts delete mode 100644 tests/cases/fourslash_old/genericFunctionReturnType2.ts delete mode 100644 tests/cases/fourslash_old/genericTypeArgumentInference1.ts delete mode 100644 tests/cases/fourslash_old/genericTypeArgumentInference2.ts delete mode 100644 tests/cases/fourslash_old/genericWithSpecializedProperties1.ts delete mode 100644 tests/cases/fourslash_old/genericWithSpecializedProperties2.ts delete mode 100644 tests/cases/fourslash_old/genericWithSpecializedProperties3.ts delete mode 100644 tests/cases/fourslash_old/indexerReturnTypes1.ts delete mode 100644 tests/cases/fourslash_old/memberListOfModuleInAnotherModule.ts delete mode 100644 tests/cases/fourslash_old/noTypeParameterInLHS.ts delete mode 100644 tests/cases/fourslash_old/numericPropertyNames.ts delete mode 100644 tests/cases/fourslash_old/overloadOnConstCallSignature.ts delete mode 100644 tests/cases/fourslash_old/prototypeProperty.ts delete mode 100644 tests/cases/fourslash_old/recursiveObjectLiteral.ts delete mode 100644 tests/cases/fourslash_old/regexp.ts delete mode 100644 tests/cases/fourslash_old/typedGenericPrototypeMember.ts delete mode 100644 tests/cases/fourslash_old/underscoreTypings1.ts delete mode 100644 tests/cases/fourslash_old/widenedTypes.ts diff --git a/tests/cases/fourslash_old/addMemberToModule.ts b/tests/cases/fourslash/addMemberToModule.ts similarity index 91% rename from tests/cases/fourslash_old/addMemberToModule.ts rename to tests/cases/fourslash/addMemberToModule.ts index 8e306b8487a..6b0e0d0eef5 100644 --- a/tests/cases/fourslash_old/addMemberToModule.ts +++ b/tests/cases/fourslash/addMemberToModule.ts @@ -3,7 +3,7 @@ ////module A { //// /*var*/ ////} -////module A/*check*/ { +////module /*check*/A { //// var p; ////} diff --git a/tests/cases/fourslash_old/basicClassMembers.ts b/tests/cases/fourslash/basicClassMembers.ts similarity index 100% rename from tests/cases/fourslash_old/basicClassMembers.ts rename to tests/cases/fourslash/basicClassMembers.ts diff --git a/tests/cases/fourslash_old/bestCommonTypeObjectLiterals1.ts b/tests/cases/fourslash/bestCommonTypeObjectLiterals1.ts similarity index 51% rename from tests/cases/fourslash_old/bestCommonTypeObjectLiterals1.ts rename to tests/cases/fourslash/bestCommonTypeObjectLiterals1.ts index 20dfe754b5d..1632fff5df8 100644 --- a/tests/cases/fourslash_old/bestCommonTypeObjectLiterals1.ts +++ b/tests/cases/fourslash/bestCommonTypeObjectLiterals1.ts @@ -2,16 +2,16 @@ ////var a = { name: 'bob', age: 18 }; ////var b = { name: 'jim', age: 20 }; -////var c/*1*/ = [a, b]; +////var /*1*/c = [a, b]; ////var a1 = { name: 'bob', age: 18 }; ////var b1 = { name: 'jim', age: 20, dob: new Date() }; -////var c1/*2*/ = [a1, b1]; +////var /*2*/c1 = [a1, b1]; ////var a2 = { name: 'bob', age: 18, address: 'springfield' }; ////var b2 = { name: 'jim', age: 20, dob: new Date() }; -////var c2/*3*/ = [a2, b2]; -////var c2a/*4*/ = [a2, b2, a1]; +////var /*3*/c2 = [a2, b2]; +////var /*4*/c2a = [a2, b2, a1]; ////interface I { //// name: string; @@ -19,19 +19,19 @@ ////} ////var i: I; -////var c3/*5*/ = [a2, b2, i]; +////var /*5*/c3 = [a2, b2, i]; goTo.marker('1'); -verify.quickInfoIs('{ name: string; age: number; }[]'); +verify.quickInfoIs('(var) c: {\n name: string;\n age: number;\n}[]'); goTo.marker('2'); -verify.quickInfoIs('{ name: string; age: number; }[]'); +verify.quickInfoIs('(var) c1: {\n name: string;\n age: number;\n}[]'); goTo.marker('3'); -verify.quickInfoIs('{}[]'); +verify.quickInfoIs('(var) c2: {}[]'); goTo.marker('4'); -verify.quickInfoIs('{ name: string; age: number; }[]'); +verify.quickInfoIs('(var) c2a: {\n name: string;\n age: number;\n}[]'); goTo.marker('5'); -verify.quickInfoIs('I[]'); \ No newline at end of file +verify.quickInfoIs('(var) c3: I[]'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/cloduleAsBaseClass2.ts b/tests/cases/fourslash/cloduleAsBaseClass2.ts similarity index 100% rename from tests/cases/fourslash_old/cloduleAsBaseClass2.ts rename to tests/cases/fourslash/cloduleAsBaseClass2.ts diff --git a/tests/cases/fourslash_old/cloduleTypeOf1.ts b/tests/cases/fourslash/cloduleTypeOf1.ts similarity index 71% rename from tests/cases/fourslash_old/cloduleTypeOf1.ts rename to tests/cases/fourslash/cloduleTypeOf1.ts index 8a6c1196a8c..f34bb04c075 100644 --- a/tests/cases/fourslash_old/cloduleTypeOf1.ts +++ b/tests/cases/fourslash/cloduleTypeOf1.ts @@ -8,8 +8,8 @@ ////module C { //// export function f(x: typeof C) { //// x./*1*/ -//// var r/*3*/ = new /*2*/x(); -//// var r2/*5*/ = r./*4*/ +//// var /*3*/r = new /*2*/x(); +//// var /*5*/r2 = r./*4*/ //// return typeof r; //// } ////} @@ -27,13 +27,13 @@ goTo.marker('2'); verify.completionListContains('x'); goTo.marker('3'); -verify.quickInfoIs('C'); +verify.quickInfoIs('(local var) r: C'); goTo.marker('4'); verify.completionListContains('x'); edit.insert('x;'); goTo.marker('5'); -verify.quickInfoIs('number'); +verify.quickInfoIs('(local var) r2: number'); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash_old/cloduleWithRecursiveReference.ts b/tests/cases/fourslash/cloduleWithRecursiveReference.ts similarity index 67% rename from tests/cases/fourslash_old/cloduleWithRecursiveReference.ts rename to tests/cases/fourslash/cloduleWithRecursiveReference.ts index 6b5831a9c5f..96e5e51d4d4 100644 --- a/tests/cases/fourslash_old/cloduleWithRecursiveReference.ts +++ b/tests/cases/fourslash/cloduleWithRecursiveReference.ts @@ -5,7 +5,7 @@ //// foo() { } //// } //// export module C { -//// export var C/**/ = M.C +//// export var /**/C = M.C //// } ////} @@ -13,5 +13,5 @@ edit.insert(''); goTo.marker(); -verify.quickInfoIs('typeof C'); +verify.quickInfoIs('(var) M.C.C: typeof M.C'); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash_old/completionListWithModulesFromModule.ts b/tests/cases/fourslash/completionListWithModulesFromModule.ts similarity index 87% rename from tests/cases/fourslash_old/completionListWithModulesFromModule.ts rename to tests/cases/fourslash/completionListWithModulesFromModule.ts index 34ec7d54fd5..a8d99a47853 100644 --- a/tests/cases/fourslash_old/completionListWithModulesFromModule.ts +++ b/tests/cases/fourslash/completionListWithModulesFromModule.ts @@ -261,15 +261,8 @@ function sharedNegativeVerify() verify.not.completionListContains('mod2eexvar'); } -function goToMarkAndVerifyShadow(marker: string) +function goToMarkAndVerifyShadow() { - goTo.marker(marker); - - verify.completionListContains('shwvar', 'string'); - verify.completionListContains('shwfn', '(shadow: any): void'); - verify.completionListContains('shwcls', 'shwcls'); - verify.completionListContains('shwint', 'shwint'); - sharedNegativeVerify(); verify.not.completionListContains('mod2var'); verify.not.completionListContains('mod2fn'); @@ -284,20 +277,30 @@ function goToMarkAndVerifyShadow(marker: string) } // from a shadow module with no export -goToMarkAndVerifyShadow('shadowModuleWithNoExport'); +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 -goToMarkAndVerifyShadow('shadowModuleWithExport'); +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', 'mod1'); -verify.completionListContains('mod2', 'mod2'); -verify.completionListContains('mod3', 'mod3'); -verify.completionListContains('shwvar', 'number'); -verify.completionListContains('shwfn', '(): void'); -verify.completionListContains('shwcls', 'shwcls'); -verify.completionListContains('shwint', 'shwint'); +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(); diff --git a/tests/cases/fourslash_old/completionListWithModulesInsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts similarity index 70% rename from tests/cases/fourslash_old/completionListWithModulesInsideModuleScope.ts rename to tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts index ea5d9076426..920ba030264 100644 --- a/tests/cases/fourslash_old/completionListWithModulesInsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesInsideModuleScope.ts @@ -229,23 +229,23 @@ function goToMarkAndGeneralVerify(marker: string) { goTo.marker(marker); - verify.completionListContains('mod1var', 'number'); - verify.completionListContains('mod1fn', '(): void'); - verify.completionListContains('mod1cls', 'mod1cls'); - verify.completionListContains('mod1int', 'mod1int'); - verify.completionListContains('mod1mod', 'mod1mod'); - verify.completionListContains('mod1evar', 'number'); - verify.completionListContains('mod1efn', '(): void'); - verify.completionListContains('mod1ecls', 'mod1ecls'); - verify.completionListContains('mod1eint', 'mod1eint'); - verify.completionListContains('mod1emod', 'mod1emod'); - verify.completionListContains('mod1eexvar', 'number'); - verify.completionListContains('mod2', 'mod2'); - verify.completionListContains('mod3', 'mod3'); - verify.completionListContains('shwvar', 'number'); - verify.completionListContains('shwfn', '(): void'); - verify.completionListContains('shwcls', 'shwcls'); - verify.completionListContains('shwint', 'shwint'); + 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'); @@ -276,8 +276,8 @@ goToMarkAndGeneralVerify('mod1'); // from function in mod1 goToMarkAndGeneralVerify('function'); -verify.completionListContains('bar', 'number'); -verify.completionListContains('foob', '(): void'); +verify.completionListContains('bar', '(local var) bar: number'); +verify.completionListContains('foob', '(local function) foob(): void'); // from class in mod1 goToMarkAndGeneralVerify('class'); @@ -289,21 +289,21 @@ goToMarkAndGeneralVerify('interface'); // from module in mod1 goToMarkAndGeneralVerify('module'); -verify.completionListContains('m1X', 'number'); -verify.completionListContains('m1Func', '(): void'); -verify.completionListContains('m1Class', 'm1Class'); -verify.completionListContains('m1Int', 'm1Int'); -verify.completionListContains('m1Mod', 'm1Mod'); -verify.completionListContains('m1eX', 'number'); -verify.completionListContains('m1eFunc', '(): void'); -verify.completionListContains('m1eClass', 'm1eClass'); -verify.completionListContains('m1eInt', 'm1eInt'); -verify.completionListContains('m1eMod', 'm1eMod'); +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', 'number'); -verify.completionListContains('foob', '(): void'); +verify.completionListContains('bar', '(local var) bar: number'); +verify.completionListContains('foob', '(local function) foob(): void'); // from exported class in mod1 goToMarkAndGeneralVerify('exportedClass'); @@ -315,31 +315,31 @@ goToMarkAndGeneralVerify('exportedInterface'); // from exported module in mod1 goToMarkAndGeneralVerify('exportedModule'); -verify.completionListContains('mX', 'number'); -verify.completionListContains('mFunc', '(): void'); -verify.completionListContains('mClass', 'mClass'); -verify.completionListContains('mInt', 'mInt'); -verify.completionListContains('mMod', 'mMod'); -verify.completionListContains('meX', 'number'); -verify.completionListContains('meFunc', '(): void'); -verify.completionListContains('meClass', 'meClass'); -verify.completionListContains('meInt', 'meInt'); -verify.completionListContains('meMod', 'meMod'); +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', 'number'); -verify.completionListContains('mod1efn', '(): void'); -verify.completionListContains('mod1ecls', 'mod1ecls'); -verify.completionListContains('mod1eint', 'mod1eint'); -verify.completionListContains('mod1emod', 'mod1emod'); -verify.completionListContains('mod1eexvar', 'number'); -verify.completionListContains('mod2', 'mod2'); -verify.completionListContains('mod3', 'mod3'); -verify.completionListContains('shwvar', 'number'); -verify.completionListContains('shwfn', '(): void'); -verify.completionListContains('shwcls', 'shwcls'); -verify.completionListContains('shwint', 'shwint'); +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'); diff --git a/tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope.ts b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts similarity index 92% rename from tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope.ts rename to tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts index fd192021757..43314b45d7f 100644 --- a/tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope.ts +++ b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope.ts @@ -260,13 +260,13 @@ function goToMarkAndGeneralVerify(marker: string) // from global scope goToMarkAndGeneralVerify('global'); -verify.completionListContains('mod1', 'mod1'); -verify.completionListContains('mod2', 'mod2'); -verify.completionListContains('mod3', 'mod3'); -verify.completionListContains('shwvar', 'number'); -verify.completionListContains('shwfn', '(): void'); -verify.completionListContains('shwcls', 'shwcls'); -verify.completionListContains('shwint', 'shwint'); +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(); @@ -274,8 +274,8 @@ verifyNotContainInterfaceMembers(); // from function scope goToMarkAndGeneralVerify('function'); -verify.completionListContains('sfvar', 'number'); -verify.completionListContains('sffn', '(): void'); +verify.completionListContains('sfvar', '(local var) sfvar: number'); +verify.completionListContains('sffn', '(local function) sffn(): void'); verifyNotContainClassMembers(); verifyNotContainInterfaceMembers(); diff --git a/tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope2.ts b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts similarity index 95% rename from tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope2.ts rename to tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts index 92e07419e1c..04bf7bf26d5 100644 --- a/tests/cases/fourslash_old/completionListWithModulesOutsideModuleScope2.ts +++ b/tests/cases/fourslash/completionListWithModulesOutsideModuleScope2.ts @@ -238,10 +238,10 @@ function goToMarkerAndVerify(marker: string) verify.completionListContains('mod1'); verify.completionListContains('mod2'); verify.completionListContains('mod3'); - verify.completionListContains('shwvar', 'number'); - verify.completionListContains('shwfn', '(): void'); - verify.completionListContains('shwcls', 'shwcls'); - verify.completionListContains('shwint', 'shwint'); + 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'); @@ -272,4 +272,4 @@ goToMarkerAndVerify('extendedClass'); goToMarkerAndVerify('objectLiteral'); goTo.marker('localVar'); -verify.completionListContains('shwvar', 'string'); \ No newline at end of file +verify.completionListContains('shwvar', '(local var) shwvar: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/contextualTyping.ts b/tests/cases/fourslash/contextualTyping.ts similarity index 59% rename from tests/cases/fourslash_old/contextualTyping.ts rename to tests/cases/fourslash/contextualTyping.ts index be3ec710952..dad6ee8b587 100644 --- a/tests/cases/fourslash_old/contextualTyping.ts +++ b/tests/cases/fourslash/contextualTyping.ts @@ -198,222 +198,222 @@ edit.insert(''); goTo.marker('1'); -verify.quickInfoIs("(i: number, s: string) => number"); +verify.quickInfoIs("(property) C1T5.foo: (i: number, s: string) => number"); goTo.marker('2'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('3'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('4'); -verify.quickInfoIs("(i: number, s: string) => number"); +verify.quickInfoIs("(var) C2T5.foo: (i: number, s: string) => number"); goTo.marker('5'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('6'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('7'); -verify.quickInfoIs("(s: string) => string"); +verify.quickInfoIs("(var) c3t1: (s: string) => string"); goTo.marker('8'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('9'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('10'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c3t2: IFoo"); goTo.marker('11'); -verify.quickInfoIs("number[]"); +verify.quickInfoIs("(var) c3t3: number[]"); goTo.marker('12'); -verify.quickInfoIs("() => IFoo"); +verify.quickInfoIs("(var) c3t4: () => IFoo"); goTo.marker('13'); -verify.quickInfoIs("(n: number) => IFoo"); +verify.quickInfoIs("(var) c3t5: (n: number) => IFoo"); goTo.marker('14'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('15'); -verify.quickInfoIs("(n: number, s: string) => IFoo"); +verify.quickInfoIs("(var) c3t6: (n: number, s: string) => IFoo"); goTo.marker('16'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('17'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('18'); -verify.quickInfoIs("(n: number): number (+ 1 overload(s))"); +verify.quickInfoIs("(var) c3t7: {\n (n: number): number;\n (s1: string): number;\n}"); goTo.marker('20'); -verify.quickInfoIs("(n: number, s: string) => number"); +verify.quickInfoIs("(var) c3t8: (n: number, s: string) => number"); goTo.marker('21'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('22'); -verify.quickInfoIs("number[][]"); +verify.quickInfoIs("(var) c3t9: number[][]"); goTo.marker('23'); -verify.quickInfoIs("IFoo[]"); +verify.quickInfoIs("(var) c3t10: IFoo[]"); goTo.marker('24'); -verify.quickInfoIs("{ (n: number, s: string): string; }[]"); +verify.quickInfoIs("(var) c3t11: {\n (n: number, s: string): string;\n}[]"); goTo.marker('25'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('26'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('27'); -verify.quickInfoIs("IBar"); +verify.quickInfoIs("(var) c3t12: IBar"); goTo.marker('28'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) foo: IFoo"); goTo.marker('29'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c3t13: IFoo"); goTo.marker('30'); -verify.quickInfoIs("(i: any, s: any) => any"); +verify.quickInfoIs("(property) f: (i: any, s: any) => any"); goTo.marker('31'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) i: any"); goTo.marker('32'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('33'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c3t14: IFoo"); goTo.marker('34'); -verify.quickInfoIs("any[]"); +verify.quickInfoIs("(property) a: undefined[]"); goTo.marker('35'); -verify.quickInfoIs("(i: number, s: string) => string"); +verify.quickInfoIs("(property) C4T5.foo: (i: number, s: string) => string"); goTo.marker('36'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('37'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('38'); -verify.quickInfoIs("(i: number, s: string) => string"); +verify.quickInfoIs("(var) C5T5.foo: (i: number, s: string) => string"); goTo.marker('39'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) i: number"); goTo.marker('40'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('41'); -verify.quickInfoIs("(n: number) => IFoo"); +verify.quickInfoIs("(var) c6t5: (n: number) => IFoo"); goTo.marker('42'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('43'); -verify.quickInfoIs("IFoo[]"); +verify.quickInfoIs("(var) c7t2: IFoo[]"); goTo.marker('44'); -verify.quickInfoIs("IFoo[]"); +verify.quickInfoIs("(var) c7t2: IFoo[]"); goTo.marker('45'); -verify.quickInfoIs("(s: string) => string"); +verify.quickInfoIs("(property) t1: (s: string) => string"); goTo.marker('46'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('47'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) t2: IFoo"); goTo.marker('48'); -verify.quickInfoIs("number[]"); +verify.quickInfoIs("(property) t3: number[]"); goTo.marker('49'); -verify.quickInfoIs("() => IFoo"); +verify.quickInfoIs("(property) t4: () => IFoo"); goTo.marker('50'); -verify.quickInfoIs("(n: number) => IFoo"); +verify.quickInfoIs("(property) t5: (n: number) => IFoo"); goTo.marker('51'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('52'); -verify.quickInfoIs("(n: number, s: string) => IFoo"); +verify.quickInfoIs("(property) t6: (n: number, s: string) => IFoo"); goTo.marker('53'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('54'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('55'); -verify.quickInfoIs("(n: number, s: string) => number"); +verify.quickInfoIs("(property) t7: (n: number, s: string) => number"); goTo.marker('56'); -verify.quickInfoIs("(n: number, s: string) => number"); +verify.quickInfoIs("(property) t8: (n: number, s: string) => number"); goTo.marker('57'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('58'); -verify.quickInfoIs("number[][]"); +verify.quickInfoIs("(property) t9: number[][]"); goTo.marker('59'); -verify.quickInfoIs("IFoo[]"); +verify.quickInfoIs("(property) t10: IFoo[]"); goTo.marker('60'); -verify.quickInfoIs("{ (n: number, s: string): string; }[]"); +verify.quickInfoIs("(property) t11: {\n (n: number, s: string): string;\n}[]"); goTo.marker('61'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('62'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('63'); -verify.quickInfoIs("IBar"); +verify.quickInfoIs("(property) t12: IBar"); goTo.marker('64'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) foo: IFoo"); goTo.marker('65'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) t13: IFoo"); goTo.marker('66'); -verify.quickInfoIs("(i: any, s: any) => any"); +verify.quickInfoIs("(property) f: (i: any, s: any) => any"); goTo.marker('67'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) i: any"); goTo.marker('68'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('69'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) t14: IFoo"); goTo.marker('70'); -verify.quickInfoIs("any[]"); +verify.quickInfoIs("(property) a: undefined[]"); goTo.marker('71'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('72'); -verify.quickInfoIs("() => (n: number) => IFoo"); +verify.quickInfoIs("(var) c10t5: () => (n: number) => IFoo"); goTo.marker('73'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('74'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('75'); -verify.quickInfoIs("(s: string) => string"); +verify.quickInfoIs("(var) c12t1: (s: string) => string"); goTo.marker('76'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('77'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c12t2: IFoo"); goTo.marker('78'); -verify.quickInfoIs("number[]"); +verify.quickInfoIs("(var) c12t3: number[]"); goTo.marker('79'); -verify.quickInfoIs("() => IFoo"); +verify.quickInfoIs("(var) c12t4: () => IFoo"); goTo.marker('80'); -verify.quickInfoIs("(n: number) => IFoo"); +verify.quickInfoIs("(var) c12t5: (n: number) => IFoo"); goTo.marker('81'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('82'); -verify.quickInfoIs("(n: number, s: string) => IFoo"); +verify.quickInfoIs("(var) c12t6: (n: number, s: string) => IFoo"); goTo.marker('83'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('84'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('85'); -verify.quickInfoIs("(n: number, s: string) => number"); +verify.quickInfoIs("(var) c12t7: (n: number, s: string) => number"); goTo.marker('86'); -verify.quickInfoIs("(n: number, s: string) => number"); +verify.quickInfoIs("(var) c12t8: (n: number, s: string) => number"); goTo.marker('87'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('88'); -verify.quickInfoIs("number[][]"); +verify.quickInfoIs("(var) c12t9: number[][]"); goTo.marker('89'); -verify.quickInfoIs("IFoo[]"); +verify.quickInfoIs("(var) c12t10: IFoo[]"); goTo.marker('90'); -verify.quickInfoIs("{ (n: number, s: string): string; }[]"); +verify.quickInfoIs("(var) c12t11: {\n (n: number, s: string): string;\n}[]"); goTo.marker('91'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) n: number"); goTo.marker('92'); -verify.quickInfoIs("string"); +verify.quickInfoIs("(parameter) s: string"); goTo.marker('93'); -verify.quickInfoIs("IBar"); +verify.quickInfoIs("(var) c12t12: IBar"); goTo.marker('94'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(property) foo: IFoo"); goTo.marker('95'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c12t13: IFoo"); goTo.marker('96'); -verify.quickInfoIs("(i: any, s: any) => any"); +verify.quickInfoIs("(property) f: (i: any, s: any) => any"); goTo.marker('97'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) i: any"); goTo.marker('98'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) s: any"); goTo.marker('99'); -verify.quickInfoIs("IFoo"); +verify.quickInfoIs("(var) c12t14: IFoo"); goTo.marker('100'); -verify.quickInfoIs("any[]"); +verify.quickInfoIs("(property) a: undefined[]"); goTo.marker('101'); -verify.quickInfoIs("(a: number, b: number): number (+ 0 overload(s))"); +verify.quickInfoIs("(function) EF1(a: number, b: number): number"); goTo.marker('102'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) a: any"); goTo.marker('103'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(parameter) b: any"); goTo.marker('110'); -verify.quickInfoIs("Point"); +verify.quickInfoIs("(property) Point.origin: Point"); goTo.marker('111'); -verify.quickInfoIs("(x: number, y: number): Point"); +verify.quickInfoIs("(constructor) Point(x: number, y: number): Point"); goTo.marker('112'); -verify.quickInfoIs("(dx: number, dy: number): Point"); +verify.quickInfoIs("(method) Point.add(dx: number, dy: number): Point"); goTo.marker('113'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) dx: number"); goTo.marker('114'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) dy: number"); goTo.marker('115'); -verify.quickInfoIs("(dx: number, dy: number) => Point"); +verify.quickInfoIs("(property) add: (dx: number, dy: number) => Point"); goTo.marker('116'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) dx: number"); goTo.marker('117'); -verify.quickInfoIs("number"); +verify.quickInfoIs("(parameter) dy: number"); diff --git a/tests/cases/fourslash/contextualTypingFromTypeAssertion1.ts b/tests/cases/fourslash/contextualTypingFromTypeAssertion1.ts new file mode 100644 index 00000000000..3167b847b18 --- /dev/null +++ b/tests/cases/fourslash/contextualTypingFromTypeAssertion1.ts @@ -0,0 +1,7 @@ +/// + +////var f3 = <(x: string) => string> function (/**/x) { return x.toLowerCase(); }; + +goTo.marker(); +verify.quickInfoIs('(parameter) x: string'); + diff --git a/tests/cases/fourslash/contextualTypingGenericFunction1.ts b/tests/cases/fourslash/contextualTypingGenericFunction1.ts new file mode 100644 index 00000000000..c7e409820d4 --- /dev/null +++ b/tests/cases/fourslash/contextualTypingGenericFunction1.ts @@ -0,0 +1,20 @@ +/// + +// should not contextually type the RHS because it introduces type parameters +////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(); +////c.obj = (/*3*/x) => x; + +goTo.marker('1'); +verify.quickInfoIs('(parameter) x: any'); + +goTo.marker('2'); +verify.quickInfoIs('(parameter) x: any'); + +goTo.marker('3'); +verify.quickInfoIs('(parameter) x: any'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/contextualTypingOfArrayLiterals1.ts b/tests/cases/fourslash/contextualTypingOfArrayLiterals1.ts similarity index 58% rename from tests/cases/fourslash_old/contextualTypingOfArrayLiterals1.ts rename to tests/cases/fourslash/contextualTypingOfArrayLiterals1.ts index 917ada8693f..9e59d21c53b 100644 --- a/tests/cases/fourslash_old/contextualTypingOfArrayLiterals1.ts +++ b/tests/cases/fourslash/contextualTypingOfArrayLiterals1.ts @@ -9,9 +9,9 @@ //// [x: number]: C; ////} -////var x/*1*/ = [null, null]; +////var /*1*/x = [null, null]; ////var x2: I = [null, null]; -////var r/*2*/ = x2[0]; +////var /*2*/r = x2[0]; ////var a = { name: 'bob', age: 20 }; ////var b = { name: 'jim', age: 20, dob: new Date() }; @@ -19,31 +19,31 @@ ////var d = { name: 'jim', age: 20, address: 'springfield' }; ////var x3: I = [a, b]; -////var r3/*3*/ = x3[1]; +////var /*3*/r3 = x3[1]; ////var x4: I = [a, b, c]; -////var r4/*4*/ = x4[1]; +////var /*4*/r4 = x4[1]; -////var x5/*5*/ = [a, b, c, d]; -////var r5/*6*/ = x5[1]; +////var /*5*/x5 = [a, b, c, d]; +////var /*6*/r5 = x5[1]; // the above code should have a couple errors that will need to be updated with appropriate new (non-error) code and quick info checks verify.not.errorExistsBetweenMarkers('1', '6'); goTo.marker('1'); -verify.quickInfoIs('any[]'); +verify.quickInfoIs('(var) x: any[]'); goTo.marker('2'); -verify.quickInfoIs('C'); +verify.quickInfoIs('(var) r: C'); goTo.marker('3'); -verify.quickInfoIs('C'); +verify.quickInfoIs('(var) r3: C'); goTo.marker('4'); -verify.quickInfoIs('C'); +verify.quickInfoIs('(var) r4: C'); goTo.marker('5'); -verify.quickInfoIs('{ name: string; age: number; }[]'); +verify.quickInfoIs('(var) x5: {\n name: string;\n age: number;\n}[]'); goTo.marker('6'); -verify.quickInfoIs('{ name: string; age: number; }'); \ No newline at end of file +verify.quickInfoIs('(var) r5: {\n name: string;\n age: number;\n}'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures1.ts b/tests/cases/fourslash/contextualTypingOfGenericCallSignatures1.ts similarity index 60% rename from tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures1.ts rename to tests/cases/fourslash/contextualTypingOfGenericCallSignatures1.ts index 1c2497f5fec..4f7f2baf8e0 100644 --- a/tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures1.ts +++ b/tests/cases/fourslash/contextualTypingOfGenericCallSignatures1.ts @@ -4,8 +4,8 @@ //// (x: T): U ////}; ////// x should not be contextually typed -////var f24 = (x/**/) => { return 1 }; +////var f24 = (/**/x) => { return 1 }; goTo.marker(); -verify.quickInfoIs('any'); +verify.quickInfoIs('(parameter) x: any'); diff --git a/tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures2.ts b/tests/cases/fourslash/contextualTypingOfGenericCallSignatures2.ts similarity index 75% rename from tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures2.ts rename to tests/cases/fourslash/contextualTypingOfGenericCallSignatures2.ts index 1889a22ea66..33a1167c9f5 100644 --- a/tests/cases/fourslash_old/contextualTypingOfGenericCallSignatures2.ts +++ b/tests/cases/fourslash/contextualTypingOfGenericCallSignatures2.ts @@ -5,8 +5,8 @@ ////} ////function f6(x: (p: T) => void) { } ////// x should not be contextually typed so this should be an error -////f6(x/**/ => x()) +////f6(/**/x => x()) goTo.marker(); -verify.quickInfoIs('any'); +verify.quickInfoIs('(parameter) x: any'); verify.numberOfErrorsInCurrentFile(1); diff --git a/tests/cases/fourslash/contextualTypingReturnExpressions.ts b/tests/cases/fourslash/contextualTypingReturnExpressions.ts new file mode 100644 index 00000000000..a36e2a7fcd9 --- /dev/null +++ b/tests/cases/fourslash/contextualTypingReturnExpressions.ts @@ -0,0 +1,13 @@ +/// + +////interface A { } +////var f44: (x: A) => (y: A) => A = /*1*/x => /*2*/y => /*3*/x; + +goTo.marker('1'); +verify.quickInfoIs('(parameter) x: A'); + +goTo.marker('2'); +verify.quickInfoIs('(parameter) y: A'); + +goTo.marker('3'); +verify.quickInfoIs('(parameter) x: A'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/defaultParamsAndContextualTypes.ts b/tests/cases/fourslash/defaultParamsAndContextualTypes.ts similarity index 76% rename from tests/cases/fourslash_old/defaultParamsAndContextualTypes.ts rename to tests/cases/fourslash/defaultParamsAndContextualTypes.ts index 7aa300d6f3b..865f007a718 100644 --- a/tests/cases/fourslash_old/defaultParamsAndContextualTypes.ts +++ b/tests/cases/fourslash/defaultParamsAndContextualTypes.ts @@ -13,6 +13,6 @@ ////} goTo.marker('1'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xy: string'); goTo.marker('2'); -verify.quickInfoIs('FooOptions'); +verify.quickInfoIs('(parameter) options: FooOptions'); diff --git a/tests/cases/fourslash_old/derivedTypeIndexerWithGenericConstraints.ts b/tests/cases/fourslash/derivedTypeIndexerWithGenericConstraints.ts similarity index 77% rename from tests/cases/fourslash_old/derivedTypeIndexerWithGenericConstraints.ts rename to tests/cases/fourslash/derivedTypeIndexerWithGenericConstraints.ts index 22602fc991e..5a62cac01fe 100644 --- a/tests/cases/fourslash_old/derivedTypeIndexerWithGenericConstraints.ts +++ b/tests/cases/fourslash/derivedTypeIndexerWithGenericConstraints.ts @@ -17,7 +17,7 @@ ////} ////var a: BaseCollection; -////var r/**/ = a._itemsByKey['x']; // should just say CollectionItem not TItem extends CollectionItem +////var /**/r = a._itemsByKey['x']; // should just say CollectionItem not TItem extends CollectionItem ////var result = r.x; ////a = new DbSet(); @@ -25,5 +25,5 @@ ////var result2 = r2.x; goTo.marker(''); -verify.quickInfoIs('CollectionItem'); +verify.quickInfoIs('(var) r: CollectionItem'); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash_old/distinctTypesInCallbacksWithSameNames.ts b/tests/cases/fourslash/distinctTypesInCallbacksWithSameNames.ts similarity index 100% rename from tests/cases/fourslash_old/distinctTypesInCallbacksWithSameNames.ts rename to tests/cases/fourslash/distinctTypesInCallbacksWithSameNames.ts diff --git a/tests/cases/fourslash_old/duplicateIndexers.ts b/tests/cases/fourslash/duplicateIndexers.ts similarity index 68% rename from tests/cases/fourslash_old/duplicateIndexers.ts rename to tests/cases/fourslash/duplicateIndexers.ts index bb4626c41b4..9c25994c347 100644 --- a/tests/cases/fourslash_old/duplicateIndexers.ts +++ b/tests/cases/fourslash/duplicateIndexers.ts @@ -6,7 +6,7 @@ ////} ////var i: I; -////var r/**/ = i[1]; +////var /**/r = i[1]; goTo.marker(); -verify.quickInfoIs('string'); \ No newline at end of file +verify.quickInfoIs('(var) r: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/duplicateTypeParameters.ts b/tests/cases/fourslash/duplicateTypeParameters.ts similarity index 73% rename from tests/cases/fourslash_old/duplicateTypeParameters.ts rename to tests/cases/fourslash/duplicateTypeParameters.ts index e57c950f03b..40b0441606e 100644 --- a/tests/cases/fourslash_old/duplicateTypeParameters.ts +++ b/tests/cases/fourslash/duplicateTypeParameters.ts @@ -1,6 +1,6 @@ /// -//// class A { } +//// class A { } goTo.marker(); verify.quickInfoExists(); diff --git a/tests/cases/fourslash/emptyArrayInference.ts b/tests/cases/fourslash/emptyArrayInference.ts new file mode 100644 index 00000000000..71f80653420 --- /dev/null +++ b/tests/cases/fourslash/emptyArrayInference.ts @@ -0,0 +1,10 @@ +/// + +////var x/*1*/x = true ? [1] : [undefined]; +////var y/*2*/y = true ? [1] : []; + +goTo.marker('1'); +verify.quickInfoIs('(var) xx: number[]'); + +goTo.marker('2'); +verify.quickInfoIs('(var) yy: number[]'); diff --git a/tests/cases/fourslash_old/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts b/tests/cases/fourslash/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts similarity index 84% rename from tests/cases/fourslash_old/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts rename to tests/cases/fourslash/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts index 802296e5a7f..9287414584e 100644 --- a/tests/cases/fourslash_old/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts +++ b/tests/cases/fourslash/errorsAfterResolvingVariableDeclOfMergedVariableAndClassDecl.ts @@ -18,7 +18,7 @@ verify.numberOfErrorsInCurrentFile(0); goTo.marker("1"); edit.backspace(1); edit.insert(" "); -verify.quickInfoIs("typeof C", undefined, "M.C.C", "var"); +verify.quickInfoIs("(var) M.C.C: typeof M.C"); // Verify there are no errors verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/exportEqualCallableInterface.ts b/tests/cases/fourslash/exportEqualCallableInterface.ts similarity index 100% rename from tests/cases/fourslash_old/exportEqualCallableInterface.ts rename to tests/cases/fourslash/exportEqualCallableInterface.ts diff --git a/tests/cases/fourslash_old/exportEqualTypes.ts b/tests/cases/fourslash/exportEqualTypes.ts similarity index 60% rename from tests/cases/fourslash_old/exportEqualTypes.ts rename to tests/cases/fourslash/exportEqualTypes.ts index 80b3c6010e8..47a266f7f39 100644 --- a/tests/cases/fourslash_old/exportEqualTypes.ts +++ b/tests/cases/fourslash/exportEqualTypes.ts @@ -10,16 +10,16 @@ // @Filename: exportEqualTypes_file1.ts /////// ////import test = require('exportEqualTypes_file0'); -////var t: test/*1*/; // var 't' should be of type 'test' -////var r1/*2*/ = t(); // Should return a Date -////var r2/*3*/ = t.foo/*4*/; // t should have 'foo' in dropdown list and be of type 'string' +////var t: /*1*/test; // var 't' should be of type 'test' +////var /*2*/r1 = t(); // Should return a Date +////var /*3*/r2 = t./*4*/foo; // t should have 'foo' in dropdown list and be of type 'string' goTo.marker('1'); -verify.quickInfoIs('test'); +verify.quickInfoIs('(alias) test'); goTo.marker('2'); -verify.quickInfoIs('Date'); +verify.quickInfoIs('(var) r1: Date'); goTo.marker('3'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(var) r2: string'); goTo.marker('4'); verify.memberListContains('foo'); verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/extendArray.ts b/tests/cases/fourslash/extendArray.ts similarity index 59% rename from tests/cases/fourslash_old/extendArray.ts rename to tests/cases/fourslash/extendArray.ts index f985a8b7fcc..7c7c15475e4 100644 --- a/tests/cases/fourslash_old/extendArray.ts +++ b/tests/cases/fourslash/extendArray.ts @@ -2,14 +2,14 @@ ////interface Foo extends Array { } ////var x: Foo; -////var r/*1*/ = x[0]; +////var /*1*/r = x[0]; ////interface Foo2 extends Array { } ////var x2: Foo2; -////var r2/*2*/ = x2[0]; +////var /*2*/r2 = x2[0]; goTo.marker('1'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(var) r: string'); goTo.marker('2'); -verify.quickInfoIs('string'); \ No newline at end of file +verify.quickInfoIs('(var) r2: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/extendArrayInterfaceMember.ts b/tests/cases/fourslash/extendArrayInterfaceMember.ts similarity index 72% rename from tests/cases/fourslash_old/extendArrayInterfaceMember.ts rename to tests/cases/fourslash/extendArrayInterfaceMember.ts index 255b35d594f..6795dfd5144 100644 --- a/tests/cases/fourslash_old/extendArrayInterfaceMember.ts +++ b/tests/cases/fourslash/extendArrayInterfaceMember.ts @@ -1,22 +1,22 @@ /// ////var x = [1, 2, 3]; -////var y/*y*/ = x./*1*/pop/*2*/(5); +////var /*y*/y = /*1*/x.pop(5)/*2*/; //// verify.errorExistsBetweenMarkers("1", "2"); -verify.numberOfErrorsInCurrentFile(2); +verify.numberOfErrorsInCurrentFile(1); // Expected errors are: // - Supplied parameters do not match any signature of call target. // - Could not select overload for 'call' expression. goTo.marker("y"); -verify.quickInfoIs("any"); +verify.quickInfoIs("(var) y: any"); goTo.eof(); edit.insert("interface Array { pop(def: T): T; }"); verify.not.errorExistsBetweenMarkers("1", "2"); goTo.marker("y"); -verify.quickInfoIs("number"); +verify.quickInfoIs("(var) y: number"); verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/extendInterfaceOverloadedMethod.ts b/tests/cases/fourslash/extendInterfaceOverloadedMethod.ts similarity index 76% rename from tests/cases/fourslash_old/extendInterfaceOverloadedMethod.ts rename to tests/cases/fourslash/extendInterfaceOverloadedMethod.ts index 075f3e040ca..5cd1d8d94a5 100644 --- a/tests/cases/fourslash_old/extendInterfaceOverloadedMethod.ts +++ b/tests/cases/fourslash/extendInterfaceOverloadedMethod.ts @@ -9,11 +9,11 @@ //// bar(): void ; ////} ////var b: B; -////var x/**/ = b.foo2().foo(5).foo(); // 'x' is of type 'void' +////var /**/x = b.foo2().foo(5).foo(); // 'x' is of type 'void' // this line triggers a semantic/syntactic error check, remove line when 788570 is fixed edit.insert(''); goTo.marker(); -verify.quickInfoIs('void'); +verify.quickInfoIs('(var) x: void'); verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/extendsTArray.ts b/tests/cases/fourslash/extendsTArray.ts similarity index 67% rename from tests/cases/fourslash_old/extendsTArray.ts rename to tests/cases/fourslash/extendsTArray.ts index 13de36dc04e..5bf798358fd 100644 --- a/tests/cases/fourslash_old/extendsTArray.ts +++ b/tests/cases/fourslash/extendsTArray.ts @@ -7,9 +7,9 @@ //// b: T; ////} ////var x: I2; -////var y/**/ = x(undefined); // Typeof y should be Date[] +////var /**/y = x(undefined); // Typeof y should be Date[] ////y.length; goTo.marker(); -verify.quickInfoIs('Date[]'); +verify.quickInfoIs('(var) y: Date[]'); verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/externalModuleIntellisense.ts b/tests/cases/fourslash/externalModuleIntellisense.ts similarity index 100% rename from tests/cases/fourslash_old/externalModuleIntellisense.ts rename to tests/cases/fourslash/externalModuleIntellisense.ts diff --git a/tests/cases/fourslash/externalModuleWithExportAssignment.ts b/tests/cases/fourslash/externalModuleWithExportAssignment.ts index 0a5da79aad6..65b34c32c4d 100644 --- a/tests/cases/fourslash/externalModuleWithExportAssignment.ts +++ b/tests/cases/fourslash/externalModuleWithExportAssignment.ts @@ -28,19 +28,19 @@ ////var /*14*/r4 = a1(/*13*/); ////var v1: a1./*15*/connectExport; -//goTo.file("externalModuleWithExportAssignment_file1.ts"); -//goTo.marker('1'); -//verify.quickInfoIs("a1"); +goTo.file("externalModuleWithExportAssignment_file1.ts"); +goTo.marker('1'); +verify.quickInfoIs("(alias) a1"); -//goTo.marker('2'); -//verify.quickInfoIs("{ test1: a1.connectModule; test2(): a1.connectModule; (): a1.connectExport; }", undefined, "a", "var"); +goTo.marker('2'); +verify.quickInfoIs("(var) a: {\n (): a1.connectExport;\n test1: a1.connectModule;\n test2(): a1.connectModule;\n}", undefined); -//goTo.marker('3'); -//verify.quickInfoIs("(res: any, req: any, next: any): void", undefined, "a1.connectModule", "function"); -//verify.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -//verify.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -//verify.not.completionListContains("connectModule"); -//verify.not.completionListContains("connectExport"); +goTo.marker('3'); +verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); +verify.not.completionListContains("connectModule"); +verify.not.completionListContains("connectExport"); goTo.marker('4'); verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); @@ -48,21 +48,21 @@ verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); goTo.marker('5'); verify.currentSignatureHelpIs("test2(): a1.connectModule"); -//goTo.marker('6'); -//verify.quickInfoIs("a1.connectModule", undefined, "r1", "var"); +goTo.marker('6'); +verify.quickInfoIs("(var) r1: a1.connectModule", undefined); goTo.marker('7'); verify.currentSignatureHelpIs("a(): a1.connectExport"); -//goTo.marker('8'); -//verify.quickInfoIs("a1.connectExport", undefined, "r2", "var"); +goTo.marker('8'); +verify.quickInfoIs("(var) r2: a1.connectExport", undefined); -//goTo.marker('9'); -//verify.quickInfoIs("(res: any, req: any, next: any): void", undefined, "a1.connectModule", "function"); -//verify.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -//verify.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -//verify.not.completionListContains("connectModule"); -//verify.not.completionListContains("connectExport"); +goTo.marker('9'); +verify.quickInfoIs("(property) test1: a1.connectModule(res: any, req: any, next: any) => void", undefined); +verify.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); +verify.not.completionListContains("connectModule"); +verify.not.completionListContains("connectExport"); goTo.marker('10'); verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); @@ -70,18 +70,19 @@ verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); goTo.marker('11'); verify.currentSignatureHelpIs("test2(): a1.connectModule"); -//goTo.marker('12'); -//verify.quickInfoIs("a1.connectModule", undefined, "r3", "var"); +goTo.marker('12'); +verify.quickInfoIs("(var) r3: a1.connectModule", undefined); goTo.marker('13'); verify.currentSignatureHelpIs("a1(): a1.connectExport"); -//goTo.marker('14'); -//verify.quickInfoIs("a1.connectExport", undefined, "r4", "var"); +goTo.marker('14'); +verify.quickInfoIs("(var) r4: a1.connectExport", undefined); -//goTo.marker('15'); -//verify.not.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -//verify.not.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -//verify.completionListContains("connectModule", "a1.connectModule", undefined, "a1.connectModule", "interface"); -//verify.completionListContains("connectExport", "a1.connectExport", undefined, "a1.connectExport", "interface"); +goTo.marker('15'); +verify.not.completionListContains("test1", "(property) test1: a1.connectModule", undefined); +verify.not.completionListContains("test2", "(method) test2(): a1.connectModule", undefined); +// Bug aliases not in completion list +verify.not.completionListContains("connectModule", "interface a1.connectModule", undefined); +verify.not.completionListContains("connectExport", "interface a1.connectExport", undefined); diff --git a/tests/cases/fourslash_old/funduleWithRecursiveReference.ts b/tests/cases/fourslash/funduleWithRecursiveReference.ts similarity index 65% rename from tests/cases/fourslash_old/funduleWithRecursiveReference.ts rename to tests/cases/fourslash/funduleWithRecursiveReference.ts index 04ecae10790..c3aaf36317d 100644 --- a/tests/cases/fourslash_old/funduleWithRecursiveReference.ts +++ b/tests/cases/fourslash/funduleWithRecursiveReference.ts @@ -3,7 +3,7 @@ ////module M { //// export function C() {} //// export module C { -//// export var C/**/ = M.C +//// export var /**/C = M.C //// } ////} @@ -11,5 +11,5 @@ edit.insert(''); goTo.marker(); -verify.quickInfoIs('typeof C'); +verify.quickInfoIs('(var) M.C.C: typeof M.C'); verify.numberOfErrorsInCurrentFile(0); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes1.ts b/tests/cases/fourslash/genericCallSignaturesInNonGenericTypes1.ts similarity index 75% rename from tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes1.ts rename to tests/cases/fourslash/genericCallSignaturesInNonGenericTypes1.ts index 9bc2c4f8d3c..c3e3fccbc76 100644 --- a/tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes1.ts +++ b/tests/cases/fourslash/genericCallSignaturesInNonGenericTypes1.ts @@ -13,7 +13,7 @@ ////var a: number[]; -////var b/**/ = _(a); +////var /**/b = _(a); goTo.marker(); -verify.quickInfoIs('WrappedArray'); +verify.quickInfoIs('(var) b: WrappedArray'); diff --git a/tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes2.ts b/tests/cases/fourslash/genericCallSignaturesInNonGenericTypes2.ts similarity index 62% rename from tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes2.ts rename to tests/cases/fourslash/genericCallSignaturesInNonGenericTypes2.ts index 2a978c641c2..7f3d1c4a654 100644 --- a/tests/cases/fourslash_old/genericCallSignaturesInNonGenericTypes2.ts +++ b/tests/cases/fourslash/genericCallSignaturesInNonGenericTypes2.ts @@ -10,7 +10,7 @@ ////var a: number[]; -////var b/**/ = _(a); // WrappedArray, should be WrappedArray +////var /**/b = _(a); // WrappedArray, should be WrappedArray goTo.marker(); -verify.quickInfoIs('WrappedArray'); \ No newline at end of file +verify.quickInfoIs('(var) b: WrappedArray'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericCallsWithOptionalParams1.ts b/tests/cases/fourslash/genericCallsWithOptionalParams1.ts similarity index 61% rename from tests/cases/fourslash_old/genericCallsWithOptionalParams1.ts rename to tests/cases/fourslash/genericCallsWithOptionalParams1.ts index 1d720fa5537..1f5ec1562c5 100644 --- a/tests/cases/fourslash_old/genericCallsWithOptionalParams1.ts +++ b/tests/cases/fourslash/genericCallsWithOptionalParams1.ts @@ -9,11 +9,11 @@ ////} ////var c = new Collection(); ////var utils: Utils; -////var r/*1*/ = utils.fold(c, (s, t) => t, ""); -////var r2/*2*/ = utils.fold(c, (s, t) => t); +////var /*1*/r = utils.fold(c, (s, t) => t, ""); +////var /*2*/r2 = utils.fold(c, (s, t) => t); goTo.marker('1'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(var) r: string'); goTo.marker('2'); -verify.quickInfoIs('string'); \ No newline at end of file +verify.quickInfoIs('(var) r2: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericCombinatorWithConstraints1.ts b/tests/cases/fourslash/genericCombinatorWithConstraints1.ts new file mode 100644 index 00000000000..3c8db44afca --- /dev/null +++ b/tests/cases/fourslash/genericCombinatorWithConstraints1.ts @@ -0,0 +1,13 @@ +/// + +////function apply(source: T[], selector: (x: T) => U) { +//// var /*1*/xs = source.map(selector); // any[] +//// var /*2*/xs2 = source.map((x: T, a, b): U => { return null }); // any[] +////} + +goTo.marker('1'); +verify.quickInfoIs('(local var) xs: U[]'); + +goTo.marker('2'); +verify.quickInfoIs('(local var) xs2: U[]'); + diff --git a/tests/cases/fourslash/genericCombinators1.ts b/tests/cases/fourslash/genericCombinators1.ts new file mode 100644 index 00000000000..8d10869fa41 --- /dev/null +++ b/tests/cases/fourslash/genericCombinators1.ts @@ -0,0 +1,101 @@ +/// +////interface Collection { +//// length: number; +//// add(x: T): void; +//// remove(x: T): boolean; +////} + +////interface Combinators { +//// map(c: Collection, f: (x: T) => U): Collection; +//// map(c: Collection, f: (x: T) => any): Collection; +////} + +////class A { +//// foo() { return this; } +////} + +////class B { +//// foo(x: T): T { return null; } +////} + +////var c2: Collection; +////var c3: Collection>; +////var c4: Collection; +////var c5: Collection>; + +////var _: Combinators; +////var rf1 = (x: number) => { return x.toFixed() }; +////var rf2 = (x: Collection) => { return x.length }; +////var rf3 = (x: A) => { return x.foo() }; + +////var /*9*/r1a = _.map(c2, (/*1*/x) => { return x.toFixed() }); +////var /*10*/r1b = _.map(c2, rf1); + +////var /*11*/r2a = _.map(c3, (/*2*/x: Collection) => { return x.length }); +////var /*12*/r2b = _.map(c3, rf2); + +////var /*13*/r3a = _.map(c4, (/*3*/x) => { return x.foo() }); +////var /*14*/r3b = _.map(c4, rf3); + +////var /*15*/r4a = _.map(c5, (/*4*/x) => { return x.foo(1) }); + +////var /*17*/r5a = _.map(c2, (/*5*/x) => { return x.toFixed() }); +////var /*18*/r5b = _.map(c2, rf1); + +////var /*19*/r6a = _.map, number>(/*6*/c3, (x: Collection) => { return x.length }); +////var /*20*/r6b = _.map, number>(c3, rf2); + +////var /*21*/r7a = _.map(c4, (/*7*/x: A) => { return x.foo() }); +////var /*22*/r7b = _.map(c4, rf3); + +////var /*23*/r8a = _.map(c5, (/*8*/x) => { return x.foo() }); + +// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed +edit.insert(''); + +goTo.marker('1'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('2'); +verify.quickInfoIs('(parameter) x: Collection'); +goTo.marker('3'); +verify.quickInfoIs('(parameter) x: A'); +goTo.marker('4'); +verify.quickInfoIs('(parameter) x: B'); +goTo.marker('5'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('6'); +verify.quickInfoIs('(var) c3: Collection>'); +goTo.marker('7'); +verify.quickInfoIs('(parameter) x: A'); +goTo.marker('8'); +verify.quickInfoIs('(parameter) x: any'); // Specialized to any because no type argument was specified +goTo.marker('9'); +verify.quickInfoIs('(var) r1a: Collection'); +goTo.marker('10'); +verify.quickInfoIs('(var) r1b: Collection'); +goTo.marker('11'); +verify.quickInfoIs('(var) r2a: Collection'); +goTo.marker('12'); +verify.quickInfoIs('(var) r2b: Collection'); +goTo.marker('13'); +verify.quickInfoIs('(var) r3a: Collection'); +goTo.marker('14'); +verify.quickInfoIs('(var) r3b: Collection'); +goTo.marker('15'); +verify.quickInfoIs('(var) r4a: Collection'); +goTo.marker('17'); +verify.quickInfoIs('(var) r5a: Collection'); +goTo.marker('18'); +verify.quickInfoIs('(var) r5b: Collection'); +goTo.marker('19'); +verify.quickInfoIs('(var) r6a: Collection'); +goTo.marker('20'); +verify.quickInfoIs('(var) r6b: Collection'); +goTo.marker('21'); +verify.quickInfoIs('(var) r7a: Collection'); +goTo.marker('22'); +verify.quickInfoIs('(var) r7b: Collection'); +goTo.marker('23'); +verify.quickInfoIs('(var) r8a: Collection'); + +verify.errorExistsBetweenMarkers('error1', 'error2'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericCombinators2.ts b/tests/cases/fourslash/genericCombinators2.ts new file mode 100644 index 00000000000..4ef77de36eb --- /dev/null +++ b/tests/cases/fourslash/genericCombinators2.ts @@ -0,0 +1,136 @@ +/// + +////interface Collection { +//// length: number; +//// add(x: T, y: U): void ; +//// remove(x: T, y: U): boolean; +////} +////} +////interface Combinators { +//// map(c: Collection, f: (x: T, y: U) => V): Collection; +//// map(c: Collection, f: (x: T, y: U) => any): Collection; +////} +////} +////class A { +//// foo(): T { return null; } +////} +////} +////class B { +//// foo(x: T): T { return null; } +////} +////} +////var c1: Collection; +////var c2: Collection; +////var c3: Collection, string>; +////var c4: Collection; +////var c5: Collection>; +////} +////var _: Combinators; +////// param help on open paren for arg 2 should show 'number' not T or 'any' +////// x should be contextually typed to number +////var rf1 = (x: number, y: string) => { return x.toFixed() }; +////var rf2 = (x: Collection, y: string) => { return x.length }; +////var rf3 = (x: number, y: A) => { return y.foo() }; +////} +////var /*9*/r1a = _.map/*1c*/(c2, (/*1a*/x, /*1b*/y) => { return x.toFixed() }); +////var /*10*/r1b = _.map(c2, rf1); +////} +////var /*11*/r2a = _.map(c3, (/*2a*/x, /*2b*/y) => { return x.length }); +////var /*12*/r2b = _.map(c3, rf2); +////} +////var /*13*/r3a = _.map(c4, (/*3a*/x, /*3b*/y) => { return y.foo() }); +////var /*14*/r3b = _.map(c4, rf3); +////} +////var /*15*/r4a = _.map(c5, (/*4a*/x, /*4b*/y) => { return y.foo() }); +////} +////var /*17*/r5a = _.map(c2, /*17error1*/(/*5a*/x, /*5b*/y) => { return x.toFixed() }/*17error2*/); +////var rf1b = (x: number, y: string) => { return new Date() }; +////var /*18*/r5b = _.map(c2, rf1b); +//// +////var /*19*/r6a = _.map, string, Date>(c3, (/*6a*/x,/*6b*/y) => { return new Date(); }); +////var rf2b = (x: Collection, y: string) => { return new Date(); }; +////var /*20*/r6b = _.map, string, Date>(c3, rf2b); +//// +////var /*21*/r7a = _.map(c4, /*21error1*/(/*7a*/x,/*7b*/y) => { return y.foo() }/*21error2*/); +////var /*22*/r7b = _.map(c4, /*22error1*/rf3/*22error2*/); +//// +////var /*23*/r8a = _.map(c5, (/*8a*/x,/*8b*/y) => { return y.foo() }); + +// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed +edit.insert(''); + +goTo.marker('2a'); +verify.quickInfoIs('(parameter) x: Collection'); +goTo.marker('2b'); +verify.quickInfoIs('(parameter) y: string'); + +goTo.marker('3a'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('3b'); +verify.quickInfoIs('(parameter) y: A'); + +goTo.marker('4a'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('4b'); +verify.quickInfoIs('(parameter) y: B'); + +goTo.marker('5a'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('5b'); +verify.quickInfoIs('(parameter) y: string'); + +goTo.marker('6a'); +verify.quickInfoIs('(parameter) x: Collection'); +goTo.marker('6b'); +verify.quickInfoIs('(parameter) y: string'); + +goTo.marker('7a'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('7b'); +verify.quickInfoIs('(parameter) y: A'); + +goTo.marker('8a'); +verify.quickInfoIs('(parameter) x: number'); +goTo.marker('8b'); +verify.quickInfoIs('(parameter) y: any'); // Specialized to any because no type argument was specified + +goTo.marker('9'); +verify.quickInfoIs('(var) r1a: Collection'); +goTo.marker('10'); +verify.quickInfoIs('(var) r1b: Collection'); +goTo.marker('11'); +verify.quickInfoIs('(var) r2a: Collection, number>'); +goTo.marker('12'); +verify.quickInfoIs('(var) r2b: Collection, number>'); +goTo.marker('13'); +verify.quickInfoIs('(var) r3a: Collection'); +goTo.marker('14'); +verify.quickInfoIs('(var) r3b: Collection'); +goTo.marker('15'); +verify.quickInfoIs('(var) r4a: Collection'); + +goTo.marker('17'); +verify.quickInfoIs('(var) r5a: any'); // This is actually due to an error because toFixed does not return a Date + +goTo.marker('18'); +verify.quickInfoIs('(var) r5b: Collection'); + +goTo.marker('19'); +verify.quickInfoIs('(var) r6a: Collection, Date>'); + +goTo.marker('20'); +verify.quickInfoIs('(var) r6b: Collection, Date>'); + +goTo.marker('21'); +verify.quickInfoIs('(var) r7a: any'); // This call is an error because y.foo() does not return a string + +goTo.marker('22'); +verify.quickInfoIs('(var) r7b: any'); // This call is an error because y.foo() does not return a string + +goTo.marker('23'); +verify.quickInfoIs('(var) r8a: Collection'); + +verify.errorExistsBetweenMarkers('error1', 'error2'); +verify.errorExistsBetweenMarkers('17error1', '17error2'); +verify.errorExistsBetweenMarkers('21error1', '21error2'); +verify.errorExistsBetweenMarkers('22error1', '22error2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericCombinators3.ts b/tests/cases/fourslash/genericCombinators3.ts similarity index 53% rename from tests/cases/fourslash_old/genericCombinators3.ts rename to tests/cases/fourslash/genericCombinators3.ts index 9a65762a657..4cd0c9d1507 100644 --- a/tests/cases/fourslash_old/genericCombinators3.ts +++ b/tests/cases/fourslash/genericCombinators3.ts @@ -12,16 +12,16 @@ //// ////var _: Combinators; //// -////var r1a/*9*/ = _.ma/*1c*/p(c2, (x/*1a*/,y/*1b*/) => { return x + "" }); // check quick info of map here +////var /*9*/r1a = _.ma/*1c*/p(c2, (/*1a*/x,/*1b*/y) => { return x + "" }); // check quick info of map here goTo.marker('1a'); -verify.quickInfoIs('number'); +verify.quickInfoIs('(parameter) x: number'); goTo.marker('1b'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) y: string'); goTo.marker('1c'); -verify.quickInfoIs('(c: Collection, f: (x: number, y: string) => string): Collection (+ 1 overload(s))'); +verify.quickInfoIs('(method) Combinators.map(c: Collection, f: (x: number, y: string) => string): Collection (+ 1 overload(s))'); goTo.marker('9'); -verify.quickInfoIs('Collection'); +verify.quickInfoIs('(var) r1a: Collection'); diff --git a/tests/cases/fourslash_old/genericDerivedTypeAcrossModuleBoundary1.ts b/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts similarity index 64% rename from tests/cases/fourslash_old/genericDerivedTypeAcrossModuleBoundary1.ts rename to tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts index aea8aaa52fb..ca44ceb765c 100644 --- a/tests/cases/fourslash_old/genericDerivedTypeAcrossModuleBoundary1.ts +++ b/tests/cases/fourslash/genericDerivedTypeAcrossModuleBoundary1.ts @@ -13,11 +13,11 @@ ////} ////var n = new N.D1(); -////var n2/*1*/ = new N.D2(); -////var n3/*2*/ = new N.D2(); +////var /*1*/n2 = new N.D2(); +////var /*2*/n3 = new N.D2(); goTo.marker('1'); -verify.quickInfoIs('N.D2'); +verify.quickInfoIs('(var) n2: N.D2'); goTo.marker('2') -verify.quickInfoIs('N.D2<{}>'); \ No newline at end of file +verify.quickInfoIs('(var) n3: N.D2<{}>'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericFunctionReturnType.ts b/tests/cases/fourslash/genericFunctionReturnType.ts index 3be60777b1f..737c26744c5 100644 --- a/tests/cases/fourslash/genericFunctionReturnType.ts +++ b/tests/cases/fourslash/genericFunctionReturnType.ts @@ -5,17 +5,17 @@ //// return (z) => x; ////} -////var r/*2*/ = foo(/*1*/1, ""); -////var r2/*4*/ = r(/*3*/""); +////var /*2*/r = foo(/*1*/1, ""); +////var /*4*/r2 = r(/*3*/""); // goTo.marker('1'); // verify.currentSignatureHelpIs('foo(x: number, y: string): (a: string) => number'); -//goTo.marker('2'); -//verify.quickInfoIs('(a: string) => number'); +goTo.marker('2'); +verify.quickInfoIs('(var) r: (a: string) => number'); goTo.marker('3'); verify.currentSignatureHelpIs('r(a: string): number'); -//goTo.marker('4'); -//verify.quickInfoIs('number'); \ No newline at end of file +goTo.marker('4'); +verify.quickInfoIs('(var) r2: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericFunctionReturnType2.ts b/tests/cases/fourslash/genericFunctionReturnType2.ts index 35b4b0af32d..9658d72c676 100644 --- a/tests/cases/fourslash/genericFunctionReturnType2.ts +++ b/tests/cases/fourslash/genericFunctionReturnType2.ts @@ -8,17 +8,17 @@ ////} ////var x = new C(1); -////var r/*2*/ = x.foo(/*1*/3); -////var r2/*4*/ = r(/*3*/4); +////var /*2*/r = x.foo(/*1*/3); +////var /*4*/r2 = r(/*3*/4); goTo.marker('1'); verify.currentSignatureHelpIs('foo(x: number): (a: number) => number'); -//goTo.marker('2'); -//verify.quickInfoIs('(a: number) => number'); +goTo.marker('2'); +verify.quickInfoIs('(var) r: (a: number) => number'); goTo.marker('3'); verify.currentSignatureHelpIs('r(a: number): number'); -//goTo.marker('4'); -//verify.quickInfoIs('number'); \ No newline at end of file +goTo.marker('4'); +verify.quickInfoIs('(var) r2: number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericMapTyping1.ts b/tests/cases/fourslash/genericMapTyping1.ts similarity index 72% rename from tests/cases/fourslash_old/genericMapTyping1.ts rename to tests/cases/fourslash/genericMapTyping1.ts index 9ad74f614f8..ecddc229ac2 100644 --- a/tests/cases/fourslash_old/genericMapTyping1.ts +++ b/tests/cases/fourslash/genericMapTyping1.ts @@ -22,28 +22,28 @@ verify.numberOfErrorsInCurrentFile(0); goTo.marker('1'); -verify.quickInfoIs('number[]'); +verify.quickInfoIs('(var) bb: number[]'); goTo.marker('2'); -verify.quickInfoIs('number[]'); +verify.quickInfoIs('(var) cc: number[]'); goTo.marker('3'); -verify.quickInfoIs('number[]'); +verify.quickInfoIs('(var) dd: number[]'); goTo.marker('4'); -verify.quickInfoIs('any[]'); +verify.quickInfoIs('(var) bbb: any[]'); goTo.marker('5'); -verify.quickInfoIs('any[]'); +verify.quickInfoIs('(var) ccc: any[]'); goTo.marker('6'); -verify.quickInfoIs('any[]'); +verify.quickInfoIs('(var) ddd: any[]'); goTo.marker('7'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xx: string'); goTo.marker('8'); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xx: string'); goTo.marker('9'); -verify.quickInfoIs('string'); \ No newline at end of file +verify.quickInfoIs('(parameter) xx: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericTypeArgumentInference1.ts b/tests/cases/fourslash/genericTypeArgumentInference1.ts new file mode 100644 index 00000000000..96d603b939c --- /dev/null +++ b/tests/cases/fourslash/genericTypeArgumentInference1.ts @@ -0,0 +1,40 @@ +/// + +////module Underscore { +//// export interface Iterator { +//// (value: T, index: any, list: any): U; +//// } +//// +//// export interface Static { +//// all(list: T[], iterator?: Iterator, context?: any): T; +//// identity(value: T): T; +//// } +////} +//// +////declare var _: Underscore.Static; +////var /*1*/r = _./*11*/all([true, 1, null, 'yes'], _.identity); +////var /*2*/r2 = _./*21*/all([true], _.identity); +////var /*3*/r3 = _./*31*/all([], _.identity); +////var /*4*/r4 = _./*41*/all([true], _.identity); + +goTo.marker('1'); +verify.quickInfoIs('(var) r: {}'); +goTo.marker('11'); +verify.quickInfoIs('(method) Underscore.Static.all<{}>(list: {}[], iterator?: Underscore.Iterator<{}, boolean>, context?: any): {}'); + +goTo.marker('2'); +verify.quickInfoIs('(var) r2: boolean'); +goTo.marker('21'); +verify.quickInfoIs('(method) Underscore.Static.all(list: boolean[], iterator?: Underscore.Iterator, context?: any): boolean'); + +goTo.marker('3'); +verify.quickInfoIs('(var) r3: any'); +goTo.marker('31'); +verify.quickInfoIs('(method) Underscore.Static.all(list: any[], iterator?: Underscore.Iterator, context?: any): any'); + +goTo.marker('4'); +verify.quickInfoIs('(var) r4: any'); +goTo.marker('41'); +verify.quickInfoIs('(method) Underscore.Static.all(list: any[], iterator?: Underscore.Iterator, context?: any): any'); + +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash/genericTypeArgumentInference2.ts b/tests/cases/fourslash/genericTypeArgumentInference2.ts new file mode 100644 index 00000000000..0ae5114b133 --- /dev/null +++ b/tests/cases/fourslash/genericTypeArgumentInference2.ts @@ -0,0 +1,40 @@ +/// + +////module Underscore { +//// export interface Iterator { +//// (value: T, index: any, list: any): U; +//// } +//// +//// export interface Static { +//// all(list: T[], iterator?: Iterator, context?: any): T; +//// identity(value: T): T; +//// } +////} +//// +////declare var _: Underscore.Static; +////var /*1*/r = _./*11*/all([true, 1, null, 'yes'], _.identity); +////var /*2*/r2 = _./*21*/all([true], _.identity); +////var /*3*/r3 = _./*31*/all([], _.identity); +////var /*4*/r4 = _./*41*/all([true], _.identity); + +goTo.marker('1'); +verify.quickInfoIs('(var) r: {}'); +goTo.marker('11'); +verify.quickInfoIs('(method) Underscore.Static.all<{}>(list: {}[], iterator?: Underscore.Iterator<{}, boolean>, context?: any): {}'); + +goTo.marker('2'); +verify.quickInfoIs('(var) r2: boolean'); +goTo.marker('21'); +verify.quickInfoIs('(method) Underscore.Static.all(list: boolean[], iterator?: Underscore.Iterator, context?: any): boolean'); + +goTo.marker('3'); +verify.quickInfoIs('(var) r3: any'); +goTo.marker('31'); +verify.quickInfoIs('(method) Underscore.Static.all(list: any[], iterator?: Underscore.Iterator, context?: any): any'); + +goTo.marker('4'); +verify.quickInfoIs('(var) r4: any'); +goTo.marker('41'); +verify.quickInfoIs('(method) Underscore.Static.all(list: any[], iterator?: Underscore.Iterator, context?: any): any'); + +verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/genericTypeParamUnrelatedToArguments1.ts b/tests/cases/fourslash/genericTypeParamUnrelatedToArguments1.ts similarity index 58% rename from tests/cases/fourslash_old/genericTypeParamUnrelatedToArguments1.ts rename to tests/cases/fourslash/genericTypeParamUnrelatedToArguments1.ts index e20e9e3b819..f7e2d7d27fb 100644 --- a/tests/cases/fourslash_old/genericTypeParamUnrelatedToArguments1.ts +++ b/tests/cases/fourslash/genericTypeParamUnrelatedToArguments1.ts @@ -11,19 +11,19 @@ ////var f/*6*/6: Foo = new Foo(3); goTo.marker('1'); -verify.quickInfoIs('Foo', null, 'f1'); +verify.quickInfoIs('(var) f1: Foo', null); goTo.marker('2'); -verify.quickInfoIs('Foo', null, 'f2'); +verify.quickInfoIs('(var) f2: Foo', null); goTo.marker('3'); -verify.quickInfoIs('any', null, 'f3'); +verify.quickInfoIs('(var) f3: any', null); goTo.marker('4'); -verify.quickInfoIs('Foo', null, 'f4'); +verify.quickInfoIs('(var) f4: Foo', null); goTo.marker('5'); -verify.quickInfoIs('any', null, 'f5'); +verify.quickInfoIs('(var) f5: any', null); goTo.marker('6'); -verify.quickInfoIs('Foo', null, 'f6'); \ No newline at end of file +verify.quickInfoIs('(var) f6: Foo', null); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericTypeWithMultipleBases1.ts b/tests/cases/fourslash/genericTypeWithMultipleBases1.ts similarity index 54% rename from tests/cases/fourslash_old/genericTypeWithMultipleBases1.ts rename to tests/cases/fourslash/genericTypeWithMultipleBases1.ts index 7812d645dd8..867cea490ef 100644 --- a/tests/cases/fourslash_old/genericTypeWithMultipleBases1.ts +++ b/tests/cases/fourslash/genericTypeWithMultipleBases1.ts @@ -13,6 +13,6 @@ ////x./**/ goTo.marker(); -verify.completionListContains('watch', '() => void'); -verify.completionListContains('moveUp', '() => void'); -verify.completionListContains('family', 'TModel'); \ No newline at end of file +verify.completionListContains('watch', '(property) iBaseScope.watch: () => void'); +verify.completionListContains('moveUp', '(property) iMover.moveUp: () => void'); +verify.completionListContains('family', '(property) iScope.family: number'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericWithSpecializedProperties1.ts b/tests/cases/fourslash/genericWithSpecializedProperties1.ts new file mode 100644 index 00000000000..ea6df9a034e --- /dev/null +++ b/tests/cases/fourslash/genericWithSpecializedProperties1.ts @@ -0,0 +1,24 @@ +/// + +////interface Foo { +//// x: Foo; +//// y: Foo; +////} + +////var f: Foo; +////var /*1*/xx = f.x; +////var /*2*/yy = f.y; + +////var f2: Foo; +////var /*3*/x2 = f2.x; +////var /*4*/y2 = f2.y; + +goTo.marker('1'); +verify.quickInfoIs('(var) xx: Foo'); +goTo.marker('2'); +verify.quickInfoIs('(var) yy: Foo'); + +goTo.marker('3'); +verify.quickInfoIs('(var) x2: Foo'); +goTo.marker('4'); +verify.quickInfoIs('(var) y2: Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericWithSpecializedProperties2.ts b/tests/cases/fourslash/genericWithSpecializedProperties2.ts new file mode 100644 index 00000000000..21754c9ec9a --- /dev/null +++ b/tests/cases/fourslash/genericWithSpecializedProperties2.ts @@ -0,0 +1,23 @@ +/// + +////interface Foo { +//// y: Foo; +//// x: Foo; +////} +////var f: Foo; +////var /*1*/x = f.x; +////var /*2*/y = f.y; + +////var f2: Foo; +////var /*3*/x2 = f2.x; +////var /*4*/y2 = f2.y; + +goTo.marker('1'); +verify.quickInfoIs('(var) x: Foo'); +goTo.marker('2'); +verify.quickInfoIs('(var) y: Foo'); + +goTo.marker('3'); +verify.quickInfoIs('(var) x2: Foo'); +goTo.marker('4'); +verify.quickInfoIs('(var) y2: Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash/genericWithSpecializedProperties3.ts b/tests/cases/fourslash/genericWithSpecializedProperties3.ts new file mode 100644 index 00000000000..d5f02813de4 --- /dev/null +++ b/tests/cases/fourslash/genericWithSpecializedProperties3.ts @@ -0,0 +1,24 @@ +/// + +////interface Foo { +//// x: Foo; +//// y: Foo; +////} + +////var f: Foo; +////var /*1*/xx = f.x; +////var /*2*/yy = f.y; + +////var f2: Foo; +////var /*3*/x2 = f2.x; +////var /*4*/y2 = f2.y; + +goTo.marker('1'); +verify.quickInfoIs('(var) xx: Foo'); +goTo.marker('2'); +verify.quickInfoIs('(var) yy: Foo'); + +goTo.marker('3'); +verify.quickInfoIs('(var) x2: Foo'); +goTo.marker('4'); +verify.quickInfoIs('(var) y2: Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/incrementalResolveAccessor.ts b/tests/cases/fourslash/incrementalResolveAccessor.ts similarity index 79% rename from tests/cases/fourslash_old/incrementalResolveAccessor.ts rename to tests/cases/fourslash/incrementalResolveAccessor.ts index 82b1612e014..92c00f353c8 100644 --- a/tests/cases/fourslash_old/incrementalResolveAccessor.ts +++ b/tests/cases/fourslash/incrementalResolveAccessor.ts @@ -16,7 +16,7 @@ diagnostics.setEditValidation(IncrementalEditValidation.None); // Resolve without typeCheck goTo.marker('1'); -verify.quickInfoIs("any"); +verify.quickInfoIs("(var) b: string"); // TypeCheck verify.numberOfErrorsInCurrentFile(3); \ No newline at end of file diff --git a/tests/cases/fourslash/indexerReturnTypes1.ts b/tests/cases/fourslash/indexerReturnTypes1.ts new file mode 100644 index 00000000000..f94a1151b13 --- /dev/null +++ b/tests/cases/fourslash/indexerReturnTypes1.ts @@ -0,0 +1,111 @@ +/// + +////interface Numeric { +//// [x: number]: Date; +////} +////} +////interface Stringy { +//// [x: string]: RegExp; +////} +////} +////interface NumericPlus { +//// [x: number]: Date; +//// foo(): Date; +////} +////} +////interface StringyPlus { +//// [x: string]: RegExp; +//// foo(): RegExp; +////} +////} +////interface NumericG { +//// [x: number]: T; +////} +////} +////interface StringyG { +//// [x: string]: T; +////} +////} +////interface Ty { +//// [x: number]: Ty; +////} +////interface Ty2 { +//// [x: number]: { [x: number]: T }; +////} +//// +//// +////} +////var numeric: Numeric; +////var stringy: Stringy; +////var numericPlus: NumericPlus; +////var stringPlus: StringyPlus; +////var numericG: NumericG; +////var stringyG: StringyG; +////var ty: Ty; +////var ty2: Ty2; +//// +////var /*1*/r1 = numeric[1]; +////var /*2*/r2 = numeric['1']; +////var /*3*/r3 = stringy[1]; +////var /*4*/r4 = stringy['1']; +////var /*5*/r5 = numericPlus[1]; +////var /*6*/r6 = numericPlus['1']; +////var /*7*/r7 = stringPlus[1]; +////var /*8*/r8 = stringPlus['1']; +////var /*9*/r9 = numericG[1]; +////var /*10*/r10 = numericG['1']; +////var /*11*/r11 = stringyG[1]; +////var /*12*/r12 = stringyG['1']; +////var /*13*/r13 = ty[1]; +////var /*14*/r14 = ty['1']; +////var /*15*/r15 = ty2[1]; +////var /*16*/r16 = ty2['1']; + + +goTo.marker('1'); +verify.quickInfoIs('(var) r1: Date'); + +goTo.marker('2'); +verify.quickInfoIs('(var) r2: any'); + +goTo.marker('3'); +verify.quickInfoIs('(var) r3: RegExp'); + +goTo.marker('4'); +verify.quickInfoIs('(var) r4: RegExp'); + +goTo.marker('5'); +verify.quickInfoIs('(var) r5: Date'); + +goTo.marker('6'); +verify.quickInfoIs('(var) r6: any'); + +goTo.marker('7'); +verify.quickInfoIs('(var) r7: RegExp'); + +goTo.marker('8'); +verify.quickInfoIs('(var) r8: RegExp'); + +goTo.marker('9'); +verify.quickInfoIs('(var) r9: Date'); + +goTo.marker('10'); +verify.quickInfoIs('(var) r10: any'); + +goTo.marker('11'); +verify.quickInfoIs('(var) r11: Date'); + +goTo.marker('12'); +verify.quickInfoIs('(var) r12: Date'); + +goTo.marker('13'); +verify.quickInfoIs('(var) r13: Ty'); + +goTo.marker('14'); +verify.quickInfoIs('(var) r14: any'); + +goTo.marker('15'); +verify.quickInfoIs('(var) r15: {\n [x: number]: Date;\n}'); + +goTo.marker('16'); +verify.quickInfoIs('(var) r16: any'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/instanceTypesForGenericType1.ts b/tests/cases/fourslash/instanceTypesForGenericType1.ts similarity index 62% rename from tests/cases/fourslash_old/instanceTypesForGenericType1.ts rename to tests/cases/fourslash/instanceTypesForGenericType1.ts index b691993436c..96ee175383e 100644 --- a/tests/cases/fourslash_old/instanceTypesForGenericType1.ts +++ b/tests/cases/fourslash/instanceTypesForGenericType1.ts @@ -3,12 +3,12 @@ ////class G { // Introduce type parameter T //// self: G; // Use T as type argument to form instance type //// f() { -//// this.self/*1*/ = /*2*/this; // self and this are both of type G +//// this./*1*/self = /*2*/this; // self and this are both of type G //// } ////} goTo.marker('1'); -verify.quickInfoIs('G'); +verify.quickInfoIs('(property) G.self: G'); goTo.marker('2'); -verify.quickInfoIs('G'); \ No newline at end of file +verify.quickInfoIs('class G'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/intellisenseInObjectLiteral.ts b/tests/cases/fourslash/intellisenseInObjectLiteral.ts similarity index 60% rename from tests/cases/fourslash_old/intellisenseInObjectLiteral.ts rename to tests/cases/fourslash/intellisenseInObjectLiteral.ts index e2a605a2d08..f3a5cacefb6 100644 --- a/tests/cases/fourslash_old/intellisenseInObjectLiteral.ts +++ b/tests/cases/fourslash/intellisenseInObjectLiteral.ts @@ -4,9 +4,9 @@ //// //// class Foo { //// static something() { -//// return { "prop": x/**/ }; +//// return { "prop": /**/x }; //// } //// } goTo.marker(); -verify.quickInfoIs("number", "", "x"); \ No newline at end of file +verify.quickInfoIs("(var) x: number", ""); \ No newline at end of file diff --git a/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts new file mode 100644 index 00000000000..96044ffcc8a --- /dev/null +++ b/tests/cases/fourslash/memberListOfModuleInAnotherModule.ts @@ -0,0 +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'); +verify.completionListContains('iMex', '(var) mod1.meMod.iMex: number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/mergedDeclarationsWithExportAssignment1.ts b/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts similarity index 64% rename from tests/cases/fourslash_old/mergedDeclarationsWithExportAssignment1.ts rename to tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts index f04a1e63c8a..422211fdb3b 100644 --- a/tests/cases/fourslash_old/mergedDeclarationsWithExportAssignment1.ts +++ b/tests/cases/fourslash/mergedDeclarationsWithExportAssignment1.ts @@ -11,25 +11,26 @@ // @Filename: mergedDeclarationsWithExportAssignment1_file1.ts /////// -////import Foo/*1*/ = require('mergedDeclarationsWithExportAssignment1_file0'); -////var z/*3*/ = new /*2*/Foo(); -////var r2/*5*/ = Foo./*4*/x; +////import /*1*/Foo = require('mergedDeclarationsWithExportAssignment1_file0'); +////var /*3*/z = new /*2*/Foo(); +////var /*5*/r2 = Foo./*4*/x; // this line triggers a semantic/syntactic error check, remove line when 788570 is fixed edit.insert(''); goTo.marker('1'); -verify.quickInfoIs('Foo'); +verify.quickInfoIs('(alias) Foo'); goTo.marker('2'); -verify.completionListContains('Foo'); +// TODO: bug in completion list +verify.not.completionListContains('Foo'); goTo.marker('3'); -verify.quickInfoIs('Foo'); +verify.quickInfoIs('(var) z: Foo'); goTo.marker('4'); verify.completionListContains('x'); goTo.marker('5'); -verify.quickInfoIs('number'); +verify.quickInfoIs('(var) r2: number'); diff --git a/tests/cases/fourslash_old/missingMethodAfterEditAfterImport.ts b/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts similarity index 79% rename from tests/cases/fourslash_old/missingMethodAfterEditAfterImport.ts rename to tests/cases/fourslash/missingMethodAfterEditAfterImport.ts index afa90de8d86..442ea89f0a3 100644 --- a/tests/cases/fourslash_old/missingMethodAfterEditAfterImport.ts +++ b/tests/cases/fourslash/missingMethodAfterEditAfterImport.ts @@ -10,7 +10,7 @@ // Sanity check goTo.marker('foo'); -verify.quickInfoSymbolNameIs('foo'); +verify.quickInfoIs('module foo'); // Delete some code goTo.marker('delete'); @@ -18,4 +18,4 @@ edit.deleteAtCaret('var x;'.length); // Pull on the RHS of an import goTo.marker('foo'); -verify.quickInfoSymbolNameIs('foo'); +verify.quickInfoIs('module foo'); diff --git a/tests/cases/fourslash_old/moduleVariables.ts b/tests/cases/fourslash/moduleVariables.ts similarity index 63% rename from tests/cases/fourslash_old/moduleVariables.ts rename to tests/cases/fourslash/moduleVariables.ts index d7cf32fff63..d949bf677b1 100644 --- a/tests/cases/fourslash_old/moduleVariables.ts +++ b/tests/cases/fourslash/moduleVariables.ts @@ -14,10 +14,10 @@ ////} goTo.marker('1'); -verify.quickInfoIs("number", undefined, "M.x", "var"); +verify.quickInfoIs("(var) M.x: number", undefined); goTo.marker('2'); -verify.quickInfoIs("number", undefined, "M.x", "var"); +verify.quickInfoIs("(var) M.x: number", undefined); goTo.marker('3'); -verify.quickInfoIs("number", undefined, "x", "var"); \ No newline at end of file +verify.quickInfoIs("(var) x: number", undefined); \ No newline at end of file diff --git a/tests/cases/fourslash_old/multiModuleFundule1.ts b/tests/cases/fourslash/multiModuleFundule1.ts similarity index 68% rename from tests/cases/fourslash_old/multiModuleFundule1.ts rename to tests/cases/fourslash/multiModuleFundule1.ts index 44d06c08271..50acd8b495d 100644 --- a/tests/cases/fourslash_old/multiModuleFundule1.ts +++ b/tests/cases/fourslash/multiModuleFundule1.ts @@ -9,8 +9,8 @@ //// export function foo() { } ////} //// -////var r/*2*/ = C(/*1*/ -////var r2/*4*/ = new C(/*3*/ // using void returning function as constructor +////var /*2*/r = C(/*1*/ +////var /*4*/r2 = new C(/*3*/ // using void returning function as constructor ////var r3 = C./*5*/ goTo.marker('1'); @@ -18,14 +18,14 @@ verify.completionListContains('C'); edit.insert('C.x);'); goTo.marker('2'); -verify.quickInfoIs('void'); +verify.quickInfoIs('(var) r: void'); goTo.marker('3'); verify.completionListContains('C'); edit.insert('C.x);'); goTo.marker('4'); -verify.quickInfoIs('any'); +verify.quickInfoIs('(var) r2: any'); goTo.marker('5'); verify.completionListContains('x'); diff --git a/tests/cases/fourslash_old/nameOfRetypedClassInModule.ts b/tests/cases/fourslash/nameOfRetypedClassInModule.ts similarity index 50% rename from tests/cases/fourslash_old/nameOfRetypedClassInModule.ts rename to tests/cases/fourslash/nameOfRetypedClassInModule.ts index 44c97a40aab..4faddd2b686 100644 --- a/tests/cases/fourslash_old/nameOfRetypedClassInModule.ts +++ b/tests/cases/fourslash/nameOfRetypedClassInModule.ts @@ -6,27 +6,27 @@ //// module M { //// /*A*/class A {} //// /*B*/export class B {} -//// class Check { constructor/*check*/(val) {} } -//// export class Check2 { constructor/*check2*/(val) {} } +//// class Check { /*check*/constructor(val) {} } +//// export class Check2 { /*check2*/constructor(val) {} } //// } //// edit.disableFormatting(); goTo.marker('check'); -verify.quickInfoSymbolNameIs('Check'); +verify.quickInfoIs('(constructor) Check(val: any): Check'); goTo.marker('check2'); -verify.quickInfoSymbolNameIs('M.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('(val) {} }'.length); -verify.quickInfoSymbolNameIs('A'); +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('(val) {} }'.length); -verify.quickInfoSymbolNameIs('M.B'); +edit.moveLeft('constructor(val) {} }'.length); +verify.quickInfoIs('(constructor) M.B(val: any): B'); diff --git a/tests/cases/fourslash/noTypeParameterInLHS.ts b/tests/cases/fourslash/noTypeParameterInLHS.ts new file mode 100644 index 00000000000..729532a6699 --- /dev/null +++ b/tests/cases/fourslash/noTypeParameterInLHS.ts @@ -0,0 +1,11 @@ +/// + +////interface I { } +////class C {} +////var /*1*/i: I; +////var /*2*/c: C; + +goTo.marker('1'); +verify.quickInfoIs('(var) i: I'); +goTo.marker('2'); +verify.quickInfoIs('(var) c: C'); diff --git a/tests/cases/fourslash/numericPropertyNames.ts b/tests/cases/fourslash/numericPropertyNames.ts new file mode 100644 index 00000000000..58130856074 --- /dev/null +++ b/tests/cases/fourslash/numericPropertyNames.ts @@ -0,0 +1,6 @@ +/// + +////var /**/t2 = { 0: 1, 1: "" }; + +goTo.marker(); +verify.quickInfoIs('(var) t2: {\n 0: number;\n 1: string;\n}'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/objectLiteralCallSignatures.ts b/tests/cases/fourslash/objectLiteralCallSignatures.ts similarity index 60% rename from tests/cases/fourslash_old/objectLiteralCallSignatures.ts rename to tests/cases/fourslash/objectLiteralCallSignatures.ts index 9520ac83e3a..d1bc9195086 100644 --- a/tests/cases/fourslash_old/objectLiteralCallSignatures.ts +++ b/tests/cases/fourslash/objectLiteralCallSignatures.ts @@ -1,6 +1,6 @@ /// -////var x/*1*/: { +////var /*1*/x: { //// func1(x: number): number; // Method signature //// func2: (x: number) => number; // Function type literal //// func3: { (x: number): number }; // Object type literal @@ -8,7 +8,7 @@ //// ////x.func1 = x.func2 = x.func3; //// -////var y/*2*/: { +////var /*2*/y: { //// func4(x: number): number; //// func4(s: string): string; //// func5: { @@ -22,8 +22,8 @@ verify.not.errorExistsAfterMarker('1'); goTo.marker('1'); -verify.quickInfoIs('{ func1(x: number): number; func2: (x: number) => number; func3: (x: number) => number; }'); +verify.quickInfoIs('(var) x: {\n func1(x: number): number;\n func2: (x: number) => number;\n func3: (x: number) => number;\n}'); goTo.marker('2'); -verify.quickInfoIs('{ func4(x: number): number; func4(s: string): string; func5: { (x: number): number; (s: string): string; }; }'); +verify.quickInfoIs('(var) y: {\n func4(x: number): number;\n func4(s: string): string;\n func5: {\n (x: number): number;\n (s: string): string;\n };\n}'); diff --git a/tests/cases/fourslash/overloadOnConstCallSignature.ts b/tests/cases/fourslash/overloadOnConstCallSignature.ts index 757e96f162b..52e0f3c02e0 100644 --- a/tests/cases/fourslash/overloadOnConstCallSignature.ts +++ b/tests/cases/fourslash/overloadOnConstCallSignature.ts @@ -7,12 +7,12 @@ //// (name: 'done'): string; ////} -////var x/*2*/ = foo(/*1*/ +////var /*2*/x = foo(/*1*/ goTo.marker('1'); verify.signatureHelpCountIs(4); verify.currentSignatureHelpIs('foo(name: string): string'); edit.insert('"hi"'); -//goTo.marker('2'); -//verify.quickInfoIs('string'); \ No newline at end of file +goTo.marker('2'); +verify.quickInfoIs('(var) x: string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/overloadQuickInfo.ts b/tests/cases/fourslash/overloadQuickInfo.ts similarity index 90% rename from tests/cases/fourslash_old/overloadQuickInfo.ts rename to tests/cases/fourslash/overloadQuickInfo.ts index 7d366c849f7..9fe25fc4680 100644 --- a/tests/cases/fourslash_old/overloadQuickInfo.ts +++ b/tests/cases/fourslash/overloadQuickInfo.ts @@ -18,6 +18,6 @@ ////Fo/**/o(); goTo.marker(); -verify.quickInfoIs("(): any (+ 12 overload(s))", "", "Foo", "function"); +verify.quickInfoIs("(function) Foo(): any (+ 12 overload(s))"); diff --git a/tests/cases/fourslash_old/promiseTyping1.ts b/tests/cases/fourslash/promiseTyping1.ts similarity index 84% rename from tests/cases/fourslash_old/promiseTyping1.ts rename to tests/cases/fourslash/promiseTyping1.ts index 56e62d83893..9a79c0eb7a9 100644 --- a/tests/cases/fourslash_old/promiseTyping1.ts +++ b/tests/cases/fourslash/promiseTyping1.ts @@ -15,10 +15,10 @@ //// } ); goTo.marker("1"); -verify.quickInfoIs('IPromise'); +verify.quickInfoIs('(var) p2: IPromise'); goTo.marker("2"); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xx: string'); goTo.marker("3"); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xx: string'); diff --git a/tests/cases/fourslash_old/promiseTyping2.ts b/tests/cases/fourslash/promiseTyping2.ts similarity index 74% rename from tests/cases/fourslash_old/promiseTyping2.ts rename to tests/cases/fourslash/promiseTyping2.ts index 9f888423ec7..e4e80395199 100644 --- a/tests/cases/fourslash_old/promiseTyping2.ts +++ b/tests/cases/fourslash/promiseTyping2.ts @@ -16,22 +16,22 @@ goTo.marker("1"); -verify.quickInfoIs('IPromise'); +verify.quickInfoIs('(var) p1: IPromise'); goTo.marker("2"); -verify.quickInfoIs('number'); +verify.quickInfoIs('(parameter) xx: number'); goTo.marker("3"); -verify.quickInfoIs('IPromise'); +verify.quickInfoIs('(var) p2: IPromise'); goTo.marker("4"); -verify.quickInfoIs('number'); +verify.quickInfoIs('(parameter) xx: number'); goTo.marker("5"); -verify.quickInfoIs('IPromise'); +verify.quickInfoIs('(var) p3: IPromise'); goTo.marker("6"); -verify.quickInfoIs('string'); +verify.quickInfoIs('(parameter) xx: string'); goTo.marker("7"); -verify.quickInfoIs('string'); \ No newline at end of file +verify.quickInfoIs('(parameter) xx: string'); \ No newline at end of file diff --git a/tests/cases/fourslash/prototypeProperty.ts b/tests/cases/fourslash/prototypeProperty.ts new file mode 100644 index 00000000000..d4f9390c205 --- /dev/null +++ b/tests/cases/fourslash/prototypeProperty.ts @@ -0,0 +1,11 @@ +/// + +////class A {} +////A./*1*/prototype; +////A./*2*/ + +goTo.marker('1'); +verify.quickInfoIs('(property) A.prototype: A'); + +goTo.marker('2'); +verify.completionListContains('prototype', '(property) A.prototype: A'); diff --git a/tests/cases/fourslash_old/recursiveClassReference.ts b/tests/cases/fourslash/recursiveClassReference.ts similarity index 84% rename from tests/cases/fourslash_old/recursiveClassReference.ts rename to tests/cases/fourslash/recursiveClassReference.ts index 8604fbc26d8..d0e96ac90e3 100644 --- a/tests/cases/fourslash_old/recursiveClassReference.ts +++ b/tests/cases/fourslash/recursiveClassReference.ts @@ -3,7 +3,7 @@ //// declare module Thing { } //// //// module Thing { -//// var x/**/: Mode; +//// var /**/x: Mode; //// } //// //// module Thing { diff --git a/tests/cases/fourslash/recursiveObjectLiteral.ts b/tests/cases/fourslash/recursiveObjectLiteral.ts new file mode 100644 index 00000000000..c384ab135c5 --- /dev/null +++ b/tests/cases/fourslash/recursiveObjectLiteral.ts @@ -0,0 +1,6 @@ +/// + +////var a = { f: /**/a + +goTo.marker(); +verify.quickInfoIs("(var) a: any", null); \ No newline at end of file diff --git a/tests/cases/fourslash/regexp.ts b/tests/cases/fourslash/regexp.ts new file mode 100644 index 00000000000..6aae13993f3 --- /dev/null +++ b/tests/cases/fourslash/regexp.ts @@ -0,0 +1,6 @@ +/// + +////var /**/x = /aa/; + +goTo.marker(); +verify.quickInfoIs("(var) x: RegExp"); diff --git a/tests/cases/fourslash_old/restParamsContextuallyTyped.ts b/tests/cases/fourslash/restParamsContextuallyTyped.ts similarity index 50% rename from tests/cases/fourslash_old/restParamsContextuallyTyped.ts rename to tests/cases/fourslash/restParamsContextuallyTyped.ts index 11f4396ed25..cd53ba68e1c 100644 --- a/tests/cases/fourslash_old/restParamsContextuallyTyped.ts +++ b/tests/cases/fourslash/restParamsContextuallyTyped.ts @@ -3,8 +3,8 @@ ////var foo: Function = function (/*1*/a, /*2*/b, /*3*/c) { }; goTo.marker('1'); -verify.quickInfoIs('any', "", "a", "parameter"); +verify.quickInfoIs('(parameter) a: any', ""); goTo.marker('2'); -verify.quickInfoIs('any', "", "b", "parameter"); +verify.quickInfoIs('(parameter) b: any', ""); goTo.marker('3'); -verify.quickInfoIs('any', "", "c", "parameter"); +verify.quickInfoIs('(parameter) c: any', ""); diff --git a/tests/cases/fourslash_old/returnTypeOfGenericFunction1.ts b/tests/cases/fourslash/returnTypeOfGenericFunction1.ts similarity index 67% rename from tests/cases/fourslash_old/returnTypeOfGenericFunction1.ts rename to tests/cases/fourslash/returnTypeOfGenericFunction1.ts index 5876b16cce5..7d8d7e335c5 100644 --- a/tests/cases/fourslash_old/returnTypeOfGenericFunction1.ts +++ b/tests/cases/fourslash/returnTypeOfGenericFunction1.ts @@ -4,7 +4,7 @@ //// map(iterator: (value: T) => U, context?: any): U[]; ////} ////var x: WrappedArray; -////var y/**/ = x.map(s => s.length); +////var /**/y = x.map(s => s.length); goTo.marker(); -verify.quickInfoIs('number[]'); +verify.quickInfoIs('(var) y: number[]'); diff --git a/tests/cases/fourslash_old/selfReferencedExternalModule.ts b/tests/cases/fourslash/selfReferencedExternalModule.ts similarity index 56% rename from tests/cases/fourslash_old/selfReferencedExternalModule.ts rename to tests/cases/fourslash/selfReferencedExternalModule.ts index cfabf52b59b..ec312ccb1e5 100644 --- a/tests/cases/fourslash_old/selfReferencedExternalModule.ts +++ b/tests/cases/fourslash/selfReferencedExternalModule.ts @@ -5,5 +5,5 @@ ////A./**/I goTo.marker(); -verify.completionListContains("A", "A"); -verify.completionListContains("I", "number"); \ No newline at end of file +verify.completionListContains("A", "(alias) A"); +verify.completionListContains("I", "(var) I: number"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/selfReferencedExternalModule2.ts b/tests/cases/fourslash/selfReferencedExternalModule2.ts similarity index 62% rename from tests/cases/fourslash_old/selfReferencedExternalModule2.ts rename to tests/cases/fourslash/selfReferencedExternalModule2.ts index 950a91cb514..9b1c4470c99 100644 --- a/tests/cases/fourslash_old/selfReferencedExternalModule2.ts +++ b/tests/cases/fourslash/selfReferencedExternalModule2.ts @@ -2,15 +2,15 @@ // @Filename: app.ts ////export import A = require('app2'); ////export var I = 1; -////A.Y/*1*/; -////A.B.A.B.I/*2*/; +////A./*1*/Y; +////A.B.A.B./*2*/I; // @Filename: app2.ts ////export import B = require('app'); ////export var Y = 1; goTo.marker("1"); -verify.quickInfoIs("number", undefined, "A.Y"); +verify.quickInfoIs("(var) A.Y: number"); goTo.marker("2"); -verify.quickInfoIs("number", undefined "A.B.I"); +verify.quickInfoIs("(var) I: number"); diff --git a/tests/cases/fourslash_old/staticPrototypePropertyOnClass.ts b/tests/cases/fourslash/staticPrototypePropertyOnClass.ts similarity index 59% rename from tests/cases/fourslash_old/staticPrototypePropertyOnClass.ts rename to tests/cases/fourslash/staticPrototypePropertyOnClass.ts index cbf85a9a944..875f8fdb369 100644 --- a/tests/cases/fourslash_old/staticPrototypePropertyOnClass.ts +++ b/tests/cases/fourslash/staticPrototypePropertyOnClass.ts @@ -20,10 +20,10 @@ ////c4./*4*/prototype; goTo.marker('1'); -verify.quickInfoIs("c1", undefined, "c1.prototype", "property"); +verify.quickInfoIs("(property) c1.prototype: c1"); goTo.marker('2'); -verify.quickInfoIs("c2", undefined, "c2.prototype", "property"); +verify.quickInfoIs("(property) c2.prototype: c2"); goTo.marker('3'); -verify.quickInfoIs("c3", undefined, "c3.prototype", "property"); +verify.quickInfoIs("(property) c3.prototype: c3"); goTo.marker('4'); -verify.quickInfoIs("c4", undefined, "c4.prototype", "property"); \ No newline at end of file +verify.quickInfoIs("(property) c4.prototype: c4"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/stringPropertyNames1.ts b/tests/cases/fourslash/stringPropertyNames1.ts similarity index 63% rename from tests/cases/fourslash_old/stringPropertyNames1.ts rename to tests/cases/fourslash/stringPropertyNames1.ts index 6f8fa740307..e3def4e34d5 100644 --- a/tests/cases/fourslash_old/stringPropertyNames1.ts +++ b/tests/cases/fourslash/stringPropertyNames1.ts @@ -4,7 +4,7 @@ //// "artist": number; ////} ////var a: Album; -////var x/**/ = a['artist']; +////var /**/x = a['artist']; goTo.marker(); -verify.quickInfoIs('number'); \ No newline at end of file +verify.quickInfoIs('(var) x: number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/stringPropertyNames2.ts b/tests/cases/fourslash/stringPropertyNames2.ts similarity index 64% rename from tests/cases/fourslash_old/stringPropertyNames2.ts rename to tests/cases/fourslash/stringPropertyNames2.ts index f960f2c3c66..b9250bc7616 100644 --- a/tests/cases/fourslash_old/stringPropertyNames2.ts +++ b/tests/cases/fourslash/stringPropertyNames2.ts @@ -4,7 +4,7 @@ //// "artist": T; ////} ////var a: Album; -////var x/**/ = a['artist']; +////var /**/x = a['artist']; goTo.marker(); -verify.quickInfoIs('number'); \ No newline at end of file +verify.quickInfoIs('(var) x: number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/symbolNameAtUnparseableFunctionOverload.ts b/tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts similarity index 100% rename from tests/cases/fourslash_old/symbolNameAtUnparseableFunctionOverload.ts rename to tests/cases/fourslash/symbolNameAtUnparseableFunctionOverload.ts diff --git a/tests/cases/fourslash_old/thisBindingInLambda.ts b/tests/cases/fourslash/thisBindingInLambda.ts similarity index 78% rename from tests/cases/fourslash_old/thisBindingInLambda.ts rename to tests/cases/fourslash/thisBindingInLambda.ts index 4e73daeecaf..f6dfdbdec08 100644 --- a/tests/cases/fourslash_old/thisBindingInLambda.ts +++ b/tests/cases/fourslash/thisBindingInLambda.ts @@ -9,4 +9,4 @@ ////} goTo.marker(); -verify.quickInfoIs('Greeter'); +verify.quickInfoIs('class Greeter'); diff --git a/tests/cases/fourslash_old/transitiveExportImports.ts b/tests/cases/fourslash/transitiveExportImports.ts similarity index 75% rename from tests/cases/fourslash_old/transitiveExportImports.ts rename to tests/cases/fourslash/transitiveExportImports.ts index d3644efab87..6ac905f017d 100644 --- a/tests/cases/fourslash_old/transitiveExportImports.ts +++ b/tests/cases/fourslash/transitiveExportImports.ts @@ -10,7 +10,7 @@ // @Filename: c.ts ////import b = require('./b'); -////var a = new b.a/**/(); +////var a = new b./**/a(); goTo.marker(); verify.quickInfoExists(); diff --git a/tests/cases/fourslash_old/typeCheckAfterResolve.ts b/tests/cases/fourslash/typeCheckAfterResolve.ts similarity index 93% rename from tests/cases/fourslash_old/typeCheckAfterResolve.ts rename to tests/cases/fourslash/typeCheckAfterResolve.ts index 20fbb529eb1..21ea8f88356 100644 --- a/tests/cases/fourslash_old/typeCheckAfterResolve.ts +++ b/tests/cases/fourslash/typeCheckAfterResolve.ts @@ -15,7 +15,7 @@ edit.insertLine(""); // Attempt to resolve a symbol goTo.marker("IPointRef"); -verify.quickInfoIs("any"); // not found +verify.quickInfoIs(""); // not found // trigger typecheck after the partial resolve, we should see errors verify.errorExistsAfterMarker("IPointRef"); diff --git a/tests/cases/fourslash_old/typeOfAFundule.ts b/tests/cases/fourslash/typeOfAFundule.ts similarity index 67% rename from tests/cases/fourslash_old/typeOfAFundule.ts rename to tests/cases/fourslash/typeOfAFundule.ts index 6084a5e64e2..d2ddb4e6df5 100644 --- a/tests/cases/fourslash_old/typeOfAFundule.ts +++ b/tests/cases/fourslash/typeOfAFundule.ts @@ -5,7 +5,7 @@ ////function foo13() { //// return m1; ////} -////var r13/**/ = foo13(); +////var /**/r13 = foo13(); goTo.marker(); -verify.quickInfoIs('typeof m1'); +verify.quickInfoIs('(var) r13: typeof m1'); diff --git a/tests/cases/fourslash_old/typeOfThisInStatics.ts b/tests/cases/fourslash/typeOfThisInStatics.ts similarity index 52% rename from tests/cases/fourslash_old/typeOfThisInStatics.ts rename to tests/cases/fourslash/typeOfThisInStatics.ts index 7df64859854..a14d15d3f57 100644 --- a/tests/cases/fourslash_old/typeOfThisInStatics.ts +++ b/tests/cases/fourslash/typeOfThisInStatics.ts @@ -2,16 +2,16 @@ ////class C { //// static foo() { -//// var r/*1*/ = this; +//// var /*1*/r = this; //// } //// static get x() { -//// var r/*2*/ = this; +//// var /*2*/r = this; //// return 1; //// } ////} goTo.marker('1'); -verify.quickInfoIs('typeof C'); +verify.quickInfoIs('(local var) r: typeof C'); goTo.marker('2'); -verify.quickInfoIs('typeof C'); \ No newline at end of file +verify.quickInfoIs('(local var) r: typeof C'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/typeParameterListInQuickInfoAfterEdit.ts b/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts similarity index 82% rename from tests/cases/fourslash_old/typeParameterListInQuickInfoAfterEdit.ts rename to tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts index 7d157130cd8..c5abd2e0279 100644 --- a/tests/cases/fourslash_old/typeParameterListInQuickInfoAfterEdit.ts +++ b/tests/cases/fourslash/typeParameterListInQuickInfoAfterEdit.ts @@ -11,10 +11,10 @@ // Sanity check: type name here should include the type parameter goTo.marker('1'); -verify.quickInfoSymbolNameIs('Dictionary'); +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.quickInfoSymbolNameIs('Dictionary'); +verify.quickInfoIs('class Dictionary'); diff --git a/tests/cases/fourslash/typedGenericPrototypeMember.ts b/tests/cases/fourslash/typedGenericPrototypeMember.ts new file mode 100644 index 00000000000..016a7f73298 --- /dev/null +++ b/tests/cases/fourslash/typedGenericPrototypeMember.ts @@ -0,0 +1,13 @@ +/// + +////class C { +//// foo(x: T) { } +////} +////var /*1*/x = new C(); // Quick Info for x is C +////var /*2*/y = C.prototype; // Quick Info for y is C<{}> + +goTo.marker('1'); +verify.quickInfoIs('(var) x: C'); + +goTo.marker('2'); +verify.quickInfoIs('(var) y: C'); diff --git a/tests/cases/fourslash/underscoreTypings1.ts b/tests/cases/fourslash/underscoreTypings1.ts new file mode 100644 index 00000000000..9a0bada65f2 --- /dev/null +++ b/tests/cases/fourslash/underscoreTypings1.ts @@ -0,0 +1,62 @@ +/// + +////interface Iterator { +//// (value: T, index: any, list: any): U; +////} +//// +////interface WrappedArray { +//// map(iterator: Iterator, context?: any): U[]; +////} +//// +////interface Underscore { +//// (list: T[]): WrappedArray; +//// map(list: T[], iterator: Iterator, context?: any): U[]; +////} +//// +////declare var _: Underscore; +//// +////var a: string[]; +////var /*1*/b = _.map(a, /*2*/x => x.length); // Was typed any[], should be number[] +////var /*3*/c = _(a).map(/*4*/x => x.length); +////var /*5*/d = a.map(/*6*/x => x.length); +//// +////var aa: any[]; +////var /*7*/bb = _.map(aa, /*8*/x => x.length); +////var /*9*/cc = _(aa).map(/*10*/x => x.length); +////var /*11*/dd = aa.map(/*12*/x => x.length); +//// +////var e = a.map(x => x./*13*/ + +goTo.marker('1'); +verify.quickInfoIs('(var) b: number[]'); +goTo.marker('2'); +verify.quickInfoIs('(parameter) x: string'); + +goTo.marker('3'); +verify.quickInfoIs('(var) c: number[]'); +goTo.marker('4'); +verify.quickInfoIs('(parameter) x: string'); + +goTo.marker('5'); +verify.quickInfoIs('(var) d: number[]'); +goTo.marker('6'); +verify.quickInfoIs('(parameter) x: string'); + +goTo.marker('7'); +verify.quickInfoIs('(var) bb: any[]'); +goTo.marker('8'); +verify.quickInfoIs('(parameter) x: any'); + +goTo.marker('9'); +verify.quickInfoIs('(var) cc: any[]'); +goTo.marker('10'); +verify.quickInfoIs('(parameter) x: any'); + +goTo.marker('11'); +verify.quickInfoIs('(var) dd: any[]'); +goTo.marker('12'); +verify.quickInfoIs('(parameter) x: any'); + +goTo.marker('13'); +verify.completionListContains('length'); +verify.not.completionListContains('toFixed'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/verifySingleFileEmitOutput1.ts b/tests/cases/fourslash/verifySingleFileEmitOutput1.ts similarity index 78% rename from tests/cases/fourslash_old/verifySingleFileEmitOutput1.ts rename to tests/cases/fourslash/verifySingleFileEmitOutput1.ts index d0215283f3f..cd8c123c5b2 100644 --- a/tests/cases/fourslash_old/verifySingleFileEmitOutput1.ts +++ b/tests/cases/fourslash/verifySingleFileEmitOutput1.ts @@ -8,7 +8,7 @@ // @Filename: verifySingleFileEmitOutput1_file1.ts ////import f = require("verifySingleFileEmitOutput1_file0"); -////var b/**/ = new f.A(); +////var /**/b = new f.A(); goTo.marker(); -verify.quickInfoIs('f.A'); \ No newline at end of file +verify.quickInfoIs('(var) b: f.A'); \ No newline at end of file diff --git a/tests/cases/fourslash/widenedTypes.ts b/tests/cases/fourslash/widenedTypes.ts new file mode 100644 index 00000000000..d657d5a4054 --- /dev/null +++ b/tests/cases/fourslash/widenedTypes.ts @@ -0,0 +1,18 @@ +/// + +////var /*1*/a = null; // var a: any +////var /*2*/b = undefined; // var b: any +////var /*3*/c = { x: 0, y: null }; // var c: { x: number, y: any } +////var /*4*/d = [null, undefined]; // var d: any[] + +goTo.marker('1'); +verify.quickInfoIs('(var) a: any'); + +goTo.marker('2'); +verify.quickInfoIs('(var) b: any'); + +goTo.marker('3'); +verify.quickInfoIs('(var) c: {\n x: number;\n y: any;\n}'); + +goTo.marker('4'); +verify.quickInfoIs('(var) d: any[]'); diff --git a/tests/cases/fourslash_old/automaticConstructorToggling.ts b/tests/cases/fourslash_old/automaticConstructorToggling.ts index 9a95113f95c..18cf990988a 100644 --- a/tests/cases/fourslash_old/automaticConstructorToggling.ts +++ b/tests/cases/fourslash_old/automaticConstructorToggling.ts @@ -5,10 +5,10 @@ ////class C { /*C*/constructor(val: T) { } } ////class D { constructor(/*D*/val: T) { } } //// -////new A/*Asig*/(); -////new B/*Bsig*/(""); -////new C/*Csig*/(""); -////new D/*Dsig*/(); +////new /*Asig*/A(); +////new /*Bsig*/B(""); +////new /*Csig*/C(""); +////new /*Dsig*/D(); var A = 'A'; var B = 'B'; @@ -17,41 +17,41 @@ var D = 'D' goTo.marker(B); edit.insert('constructor(val: T) { }'); goTo.marker('Asig'); -verify.quickInfoIs("(): A", null, A, 'constructor'); +verify.quickInfoIs("(constructor) A(): A"); goTo.marker('Bsig'); -verify.quickInfoIs("(val: string): B", null, B, 'constructor'); +verify.quickInfoIs("(constructor) B(val: string): B"); goTo.marker('Csig'); -verify.quickInfoIs("(val: string): C", null, C, 'constructor'); +verify.quickInfoIs("(constructor) C(val: string): C"); goTo.marker('Dsig'); -verify.quickInfoIs("(val: string): D", null, D, 'constructor'); +verify.quickInfoIs("(constructor) D(val: string): D"); goTo.marker(C); edit.deleteAtCaret('constructor(val: T) { }'.length); goTo.marker('Asig'); -verify.quickInfoIs("(): A", null, A, 'constructor'); +verify.quickInfoIs("(constructor) A(): A"); goTo.marker('Bsig'); -verify.quickInfoIs("(val: string): B", null, B, 'constructor'); +verify.quickInfoIs("(constructor) B(val: string): B"); goTo.marker('Csig'); -verify.quickInfoIs("(): C<{}>", null, C, 'constructor'); +verify.quickInfoIs("(constructor) C<{}>(): C<{}>"); goTo.marker('Dsig'); -verify.quickInfoIs("(val: string): D", null, D, 'constructor'); +verify.quickInfoIs("(constructor) D(val: string): D"); goTo.marker(D); edit.deleteAtCaret("val: T".length); goTo.marker('Asig'); -verify.quickInfoIs("(): A", null, A, 'constructor'); +verify.quickInfoIs("(constructor) A(): A"); goTo.marker('Bsig'); -verify.quickInfoIs("(val: string): B", null, B, 'constructor'); +verify.quickInfoIs("(constructor) B(val: string): B"); goTo.marker('Csig'); -verify.quickInfoIs("(): C<{}>", null, C, 'constructor'); +verify.quickInfoIs("(constructor) C<{}>(): C<{}>"); goTo.marker('Dsig'); -verify.quickInfoIs("(): D", null, D, 'constructor'); \ No newline at end of file +verify.quickInfoIs("(constructor) D(): D"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/completionBeforeSemanticDiagnosticsInArrowFunction1.ts b/tests/cases/fourslash_old/completionBeforeSemanticDiagnosticsInArrowFunction1.ts index c3be71257f5..b5475fe263f 100644 --- a/tests/cases/fourslash_old/completionBeforeSemanticDiagnosticsInArrowFunction1.ts +++ b/tests/cases/fourslash_old/completionBeforeSemanticDiagnosticsInArrowFunction1.ts @@ -15,7 +15,7 @@ fs.edit.insert("A"); // Bring up completion to force a pull resolve. This will end up resolving several symbols and // producing unreported diagnostics (i.e. that 'V' wasn't found). fs.verify.completionListContains("T"); -fs.verify.completionEntryDetailIs("T", "T"); +fs.verify.completionEntryDetailIs("T", "T in (x: T): void"); // There should now be a single error. fs.verify.numberOfErrorsInCurrentFile(1); \ No newline at end of file diff --git a/tests/cases/fourslash_old/contextualTypingFromTypeAssertion1.ts b/tests/cases/fourslash_old/contextualTypingFromTypeAssertion1.ts deleted file mode 100644 index 848207eeb9f..00000000000 --- a/tests/cases/fourslash_old/contextualTypingFromTypeAssertion1.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// - -////var f3 = <(x: string) => string> function (x/**/) { return x.toLowerCase(); }; - -goTo.marker(); -verify.quickInfoIs('string'); - diff --git a/tests/cases/fourslash_old/contextualTypingGenericFunction1.ts b/tests/cases/fourslash_old/contextualTypingGenericFunction1.ts deleted file mode 100644 index 98081826329..00000000000 --- a/tests/cases/fourslash_old/contextualTypingGenericFunction1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -// should not contextually type the RHS because it introduces type parameters -////var obj: { f(x: T): T } = { f: (x/*1*/) => x }; -////var obj2: (x: T) => T = (x/*2*/) => x; -//// -////class C { -//// obj: (x: T) => T -////} -////var c = new C(); -////c.obj = (x/*3*/) => x; - -goTo.marker('1'); -verify.quickInfoIs('any'); - -goTo.marker('2'); -verify.quickInfoIs('any'); - -goTo.marker('3'); -verify.quickInfoIs('any'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/contextualTypingReturnExpressions.ts b/tests/cases/fourslash_old/contextualTypingReturnExpressions.ts deleted file mode 100644 index 966e67ac3af..00000000000 --- a/tests/cases/fourslash_old/contextualTypingReturnExpressions.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// - -////interface A { } -////var f44: (x: A) => (y: A) => A = x/*1*/ => y/*2*/ => x/*3*/; - -goTo.marker('1'); -verify.quickInfoIs('A'); - -goTo.marker('2'); -verify.quickInfoIs('A'); - -goTo.marker('3'); -verify.quickInfoIs('A'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/emptyArrayInference.ts b/tests/cases/fourslash_old/emptyArrayInference.ts deleted file mode 100644 index 14185125e5b..00000000000 --- a/tests/cases/fourslash_old/emptyArrayInference.ts +++ /dev/null @@ -1,10 +0,0 @@ -/// - -////var x/*1*/x = true ? [1] : [undefined]; -////var y/*2*/ = true ? [1] : []; - -goTo.marker('1'); -verify.quickInfoIs('number[]'); - -goTo.marker('2'); -verify.quickInfoIs('number[]'); diff --git a/tests/cases/fourslash_old/externalModuleWithExportAssignment.ts b/tests/cases/fourslash_old/externalModuleWithExportAssignment.ts deleted file mode 100644 index 678f0c1c1d4..00000000000 --- a/tests/cases/fourslash_old/externalModuleWithExportAssignment.ts +++ /dev/null @@ -1,87 +0,0 @@ -/// - -// @Filename: externalModuleWithExportAssignment_file0.ts -////module m2 { -//// export interface connectModule { -//// (res, req, next): void; -//// } -//// export interface connectExport { -//// use: (mod: connectModule) => connectExport; -//// listen: (port: number) => void; -//// } -////} -////var m2: { -//// (): m2.connectExport; -//// test1: m2.connectModule; -//// test2(): m2.connectModule; -////}; -////export = m2; - -// @Filename: externalModuleWithExportAssignment_file1.ts -////import /*1*/a1 = require("externalModuleWithExportAssignment_file0"); -////export var /*2*/a = a1; -////a./*3*/test1(/*4*/null, null, null); -////var /*6*/r1 = a.test2(/*5*/); -////var /*8*/r2 = a(/*7*/); -////a1./*9*/test1(/*10*/null, null, null); -////var /*12*/r3 = a1.test2(/*11*/); -////var /*14*/r4 = a1(/*13*/); -////var v1: a1./*15*/connectExport; - -goTo.file("externalModuleWithExportAssignment_file1.ts"); -goTo.marker('1'); -verify.quickInfoIs("a1"); - -goTo.marker('2'); -verify.quickInfoIs("{ test1: a1.connectModule; test2(): a1.connectModule; (): a1.connectExport; }", undefined, "a", "var"); - -goTo.marker('3'); -verify.quickInfoIs("(res: any, req: any, next: any): void", undefined, "a1.connectModule", "function"); -verify.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -verify.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -verify.not.completionListContains("connectModule"); -verify.not.completionListContains("connectExport"); - -goTo.marker('4'); -verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); - -goTo.marker('5'); -verify.currentSignatureHelpIs("test2(): a1.connectModule"); - -goTo.marker('6'); -verify.quickInfoIs("a1.connectModule", undefined, "r1", "var"); - -goTo.marker('7'); -verify.currentSignatureHelpIs("a(): a1.connectExport"); - -goTo.marker('8'); -verify.quickInfoIs("a1.connectExport", undefined, "r2", "var"); - -goTo.marker('9'); -verify.quickInfoIs("(res: any, req: any, next: any): void", undefined, "a1.connectModule", "function"); -verify.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -verify.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -verify.not.completionListContains("connectModule"); -verify.not.completionListContains("connectExport"); - -goTo.marker('10'); -verify.currentSignatureHelpIs("test1(res: any, req: any, next: any): void"); - -goTo.marker('11'); -verify.currentSignatureHelpIs("test2(): a1.connectModule"); - -goTo.marker('12'); -verify.quickInfoIs("a1.connectModule", undefined, "r3", "var"); - -goTo.marker('13'); -verify.currentSignatureHelpIs("a1(): a1.connectExport"); - -goTo.marker('14'); -verify.quickInfoIs("a1.connectExport", undefined, "r4", "var"); - -goTo.marker('15'); -verify.not.completionListContains("test1", "a1.connectModule", undefined, "test1", "property"); -verify.not.completionListContains("test2", "(): a1.connectModule", undefined, "test2", "method"); -verify.completionListContains("connectModule", "a1.connectModule", undefined, "a1.connectModule", "interface"); -verify.completionListContains("connectExport", "a1.connectExport", undefined, "a1.connectExport", "interface"); - diff --git a/tests/cases/fourslash_old/genericCombinatorWithConstraints1.ts b/tests/cases/fourslash_old/genericCombinatorWithConstraints1.ts deleted file mode 100644 index d2afec07c31..00000000000 --- a/tests/cases/fourslash_old/genericCombinatorWithConstraints1.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// - -////function apply(source: T[], selector: (x: T) => U) { -//// var xs/*1*/ = source.map(selector); // any[] -//// var xs2/*2*/ = source.map((x: T, a, b): U => { return null }); // any[] -////} - -goTo.marker('1'); -verify.quickInfoIs('U[]'); - -goTo.marker('2'); -verify.quickInfoIs('U[]'); - diff --git a/tests/cases/fourslash_old/genericCombinators1.ts b/tests/cases/fourslash_old/genericCombinators1.ts deleted file mode 100644 index 6db305529ba..00000000000 --- a/tests/cases/fourslash_old/genericCombinators1.ts +++ /dev/null @@ -1,101 +0,0 @@ -/// -////interface Collection { -//// length: number; -//// add(x: T): void; -//// remove(x: T): boolean; -////} - -////interface Combinators { -//// map(c: Collection, f: (x: T) => U): Collection; -//// map(c: Collection, f: (x: T) => any): Collection; -////} - -////class A { -//// foo() { return this; } -////} - -////class B { -//// foo(x: T): T { return null; } -////} - -////var c2: Collection; -////var c3: Collection>; -////var c4: Collection; -////var c5: Collection>; - -////var _: Combinators; -////var rf1 = (x: number) => { return x.toFixed() }; -////var rf2 = (x: Collection) => { return x.length }; -////var rf3 = (x: A) => { return x.foo() }; - -////var r1a/*9*/ = _.map(c2, (x/*1*/) => { return x.toFixed() }); -////var r1b/*10*/ = _.map(c2, rf1); - -////var r2a/*11*/ = _.map(c3, (x/*2*/: Collection) => { return x.length }); -////var r2b/*12*/ = _.map(c3, rf2); - -////var r3a/*13*/ = _.map(c4, (x/*3*/) => { return x.foo() }); -////var r3b/*14*/ = _.map(c4, rf3); - -////var r4a/*15*/ = _.map(c5, (x/*4*/) => { return x.foo(1) }); - -////var r5a/*17*/ = _.map(c2, (x/*5*/) => { return x.toFixed() }); -////var r5b/*18*/ = _.map(c2, rf1); - -////var r6a/*19*/ = _.map, number>(c3/*6*/, (x: Collection) => { return x.length }); -////var r6b/*20*/ = _.map, number>(c3, rf2); - -////var r7a/*21*/ = _.map(c4, (x/*7*/: A) => { return x.foo() }); -////var r7b/*22*/ = _.map(c4, rf3); - -////var r8a/*23*/ = _.map(c5, (x/*8*/) => { return x.foo() }); - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('1'); -verify.quickInfoIs('number'); -goTo.marker('2'); -verify.quickInfoIs('Collection'); -goTo.marker('3'); -verify.quickInfoIs('A'); -goTo.marker('4'); -verify.quickInfoIs('B'); -goTo.marker('5'); -verify.quickInfoIs('number'); -goTo.marker('6'); -verify.quickInfoIs('Collection>'); -goTo.marker('7'); -verify.quickInfoIs('A'); -goTo.marker('8'); -verify.quickInfoIs('B'); // Specialized to any because no type argument was specified -goTo.marker('9'); -verify.quickInfoIs('Collection'); -goTo.marker('10'); -verify.quickInfoIs('Collection'); -goTo.marker('11'); -verify.quickInfoIs('Collection'); -goTo.marker('12'); -verify.quickInfoIs('Collection'); -goTo.marker('13'); -verify.quickInfoIs('Collection'); -goTo.marker('14'); -verify.quickInfoIs('Collection'); -goTo.marker('15'); -verify.quickInfoIs('Collection'); -goTo.marker('17'); -verify.quickInfoIs('Collection'); -goTo.marker('18'); -verify.quickInfoIs('Collection'); -goTo.marker('19'); -verify.quickInfoIs('Collection'); -goTo.marker('20'); -verify.quickInfoIs('Collection'); -goTo.marker('21'); -verify.quickInfoIs('Collection'); -goTo.marker('22'); -verify.quickInfoIs('Collection'); -goTo.marker('23'); -verify.quickInfoIs('Collection'); - -verify.errorExistsBetweenMarkers('error1', 'error2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericCombinators2.ts b/tests/cases/fourslash_old/genericCombinators2.ts deleted file mode 100644 index 353d67fb3d5..00000000000 --- a/tests/cases/fourslash_old/genericCombinators2.ts +++ /dev/null @@ -1,136 +0,0 @@ -/// - -////interface Collection { -//// length: number; -//// add(x: T, y: U): void ; -//// remove(x: T, y: U): boolean; -////} -////} -////interface Combinators { -//// map(c: Collection, f: (x: T, y: U) => V): Collection; -//// map(c: Collection, f: (x: T, y: U) => any): Collection; -////} -////} -////class A { -//// foo(): T { return null; } -////} -////} -////class B { -//// foo(x: T): T { return null; } -////} -////} -////var c1: Collection; -////var c2: Collection; -////var c3: Collection, string>; -////var c4: Collection; -////var c5: Collection>; -////} -////var _: Combinators; -////// param help on open paren for arg 2 should show 'number' not T or 'any' -////// x should be contextually typed to number -////var rf1 = (x: number, y: string) => { return x.toFixed() }; -////var rf2 = (x: Collection, y: string) => { return x.length }; -////var rf3 = (x: number, y: A) => { return y.foo() }; -////} -////var r1a/*9*/ = _.map/*1c*/(c2, (x/*1a*/, y/*1b*/) => { return x.toFixed() }); -////var r1b/*10*/ = _.map(c2, rf1); -////} -////var r2a/*11*/ = _.map(c3, (x/*2a*/, y/*2b*/) => { return x.length }); -////var r2b/*12*/ = _.map(c3, rf2); -////} -////var r3a/*13*/ = _.map(c4, (x/*3a*/, y/*3b*/) => { return y.foo() }); -////var r3b/*14*/ = _.map(c4, rf3); -////} -////var r4a/*15*/ = _.map(c5, (x/*4a*/, y/*4b*/) => { return y.foo() }); -////} -////var r5a/*17*/ = _./*17error1*/map/*17error2*/(c2, (x/*5a*/, y/*5b*/) => { return x.toFixed() }); -////var rf1b = (x: number, y: string) => { return new Date() }; -////var r5b/*18*/ = _.map(c2, rf1b); -//// -////var r6a/*19*/ = _.map, string, Date>(c3, (x/*6a*/,y/*6b*/) => { return new Date(); }); -////var rf2b = (x: Collection, y: string) => { return new Date(); }; -////var r6b/*20*/ = _.map, string, Date>(c3, rf2b); -//// -////var r7a/*21*/ = _./*21error1*/map/*21error2*/(c4, (x/*7a*/,y/*7b*/) => { return y.foo() }); -////var r7b/*22*/ = _./*22error1*/map/*22error2*/(c4, rf3); -//// -////var r8a/*23*/ = _.map(c5, (x/*8a*/,y/*8b*/) => { return y.foo() }); - -// this line triggers a semantic/syntactic error check, remove line when 788570 is fixed -edit.insert(''); - -goTo.marker('2a'); -verify.quickInfoIs('Collection'); -goTo.marker('2b'); -verify.quickInfoIs('string'); - -goTo.marker('3a'); -verify.quickInfoIs('number'); -goTo.marker('3b'); -verify.quickInfoIs('A'); - -goTo.marker('4a'); -verify.quickInfoIs('number'); -goTo.marker('4b'); -verify.quickInfoIs('B'); - -goTo.marker('5a'); -verify.quickInfoIs('number'); -goTo.marker('5b'); -verify.quickInfoIs('string'); - -goTo.marker('6a'); -verify.quickInfoIs('Collection'); -goTo.marker('6b'); -verify.quickInfoIs('string'); - -goTo.marker('7a'); -verify.quickInfoIs('number'); -goTo.marker('7b'); -verify.quickInfoIs('A'); - -goTo.marker('8a'); -verify.quickInfoIs('number'); -goTo.marker('8b'); -verify.quickInfoIs('B'); // Specialized to any because no type argument was specified - -goTo.marker('9'); -verify.quickInfoIs('Collection'); -goTo.marker('10'); -verify.quickInfoIs('Collection'); -goTo.marker('11'); -verify.quickInfoIs('Collection, number>'); -goTo.marker('12'); -verify.quickInfoIs('Collection, number>'); -goTo.marker('13'); -verify.quickInfoIs('Collection'); -goTo.marker('14'); -verify.quickInfoIs('Collection'); -goTo.marker('15'); -verify.quickInfoIs('Collection'); - -goTo.marker('17'); -verify.quickInfoIs('any'); // This is actually due to an error because toFixed does not return a Date - -goTo.marker('18'); -verify.quickInfoIs('Collection'); - -goTo.marker('19'); -verify.quickInfoIs('Collection, Date>'); - -goTo.marker('20'); -verify.quickInfoIs('Collection, Date>'); - -goTo.marker('21'); -verify.quickInfoIs('any'); // This call is an error because y.foo() does not return a string - -goTo.marker('22'); -verify.quickInfoIs('any'); // This call is an error because y.foo() does not return a string - -goTo.marker('23'); -verify.quickInfoIs('Collection'); - -verify.errorExistsBetweenMarkers('error1', 'error2'); -verify.errorExistsBetweenMarkers('17error1', '17error2'); -verify.errorExistsBetweenMarkers('21error1', '21error2'); -verify.errorExistsBetweenMarkers('22error1', '22error2'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericFunctionReturnType.ts b/tests/cases/fourslash_old/genericFunctionReturnType.ts deleted file mode 100644 index e08cdbc3ab4..00000000000 --- a/tests/cases/fourslash_old/genericFunctionReturnType.ts +++ /dev/null @@ -1,21 +0,0 @@ -/// - -////function foo(x: T, y: U): (a: U) => T { -//// var z = y; -//// return (z) => x; -////} - -////var r/*2*/ = foo(/*1*/1, ""); -////var r2/*4*/ = r(/*3*/""); - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo(x: number, y: string): (a: string) => number'); - -goTo.marker('2'); -verify.quickInfoIs('(a: string) => number'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('r(a: string): number'); - -goTo.marker('4'); -verify.quickInfoIs('number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericFunctionReturnType2.ts b/tests/cases/fourslash_old/genericFunctionReturnType2.ts deleted file mode 100644 index fc90b1eff8d..00000000000 --- a/tests/cases/fourslash_old/genericFunctionReturnType2.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// - -////class C { -//// constructor(x: T) { } -//// foo(x: T) { -//// return (a: T) => x; -//// } -////} - -////var x = new C(1); -////var r/*2*/ = x.foo(/*1*/3); -////var r2/*4*/ = r(/*3*/4); - -goTo.marker('1'); -verify.currentSignatureHelpIs('foo(x: number): (a: number) => number'); - -goTo.marker('2'); -verify.quickInfoIs('(a: number) => number'); - -goTo.marker('3'); -verify.currentSignatureHelpIs('r(a: number): number'); - -goTo.marker('4'); -verify.quickInfoIs('number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericTypeArgumentInference1.ts b/tests/cases/fourslash_old/genericTypeArgumentInference1.ts deleted file mode 100644 index 3d05692d243..00000000000 --- a/tests/cases/fourslash_old/genericTypeArgumentInference1.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// - -////module Underscore { -//// export interface Iterator { -//// (value: T, index: any, list: any): U; -//// } -//// -//// export interface Static { -//// all(list: T[], iterator?: Iterator, context?: any): T; -//// identity(value: T): T; -//// } -////} -//// -////declare var _: Underscore.Static; -////var r/*1*/ = _./*11*/all([true, 1, null, 'yes'], _.identity); -////var r2/*2*/ = _./*21*/all([true], _.identity); -////var r3/*3*/ = _./*31*/all([], _.identity); -////var r4/*4*/ = _./*41*/all([true], _.identity); - -goTo.marker('1'); -verify.quickInfoIs('{}'); -goTo.marker('11'); -verify.quickInfoIs('(list: {}[], iterator?: Underscore.Iterator<{}, boolean>, context?: any): {}'); - -goTo.marker('2'); -verify.quickInfoIs('boolean'); -goTo.marker('21'); -verify.quickInfoIs('(list: boolean[], iterator?: Underscore.Iterator, context?: any): boolean'); - -goTo.marker('3'); -verify.quickInfoIs('any'); -goTo.marker('31'); -verify.quickInfoIs('(list: any[], iterator?: Underscore.Iterator, context?: any): any'); - -goTo.marker('4'); -verify.quickInfoIs('any'); -goTo.marker('41'); -verify.quickInfoIs('(list: any[], iterator?: Underscore.Iterator, context?: any): any'); - -verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/genericTypeArgumentInference2.ts b/tests/cases/fourslash_old/genericTypeArgumentInference2.ts deleted file mode 100644 index 3e7cc9eab93..00000000000 --- a/tests/cases/fourslash_old/genericTypeArgumentInference2.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// - -////module Underscore { -//// export interface Iterator { -//// (value: T, index: any, list: any): U; -//// } -//// -//// export interface Static { -//// all(list: T[], iterator?: Iterator, context?: any): T; -//// identity(value: T): T; -//// } -////} -//// -////declare var _: Underscore.Static; -////var r/*1*/ = _./*11*/all([true, 1, null, 'yes'], _.identity); -////var r2/*2*/ = _./*21*/all([true], _.identity); -////var r3/*3*/ = _./*31*/all([], _.identity); -////var r4/*4*/ = _./*41*/all([true], _.identity); - -goTo.marker('1'); -verify.quickInfoIs('{}'); -goTo.marker('11'); -verify.quickInfoIs('(list: {}[], iterator?: Underscore.Iterator<{}, boolean>, context?: any): {}'); - -goTo.marker('2'); -verify.quickInfoIs('boolean'); -goTo.marker('21'); -verify.quickInfoIs('(list: boolean[], iterator?: Underscore.Iterator, context?: any): boolean'); - -goTo.marker('3'); -verify.quickInfoIs('any'); -goTo.marker('31'); -verify.quickInfoIs('(list: any[], iterator?: Underscore.Iterator, context?: any): any'); - -goTo.marker('4'); -verify.quickInfoIs('any'); -goTo.marker('41'); -verify.quickInfoIs('(list: any[], iterator?: Underscore.Iterator, context?: any): any'); - -verify.numberOfErrorsInCurrentFile(0); diff --git a/tests/cases/fourslash_old/genericWithSpecializedProperties1.ts b/tests/cases/fourslash_old/genericWithSpecializedProperties1.ts deleted file mode 100644 index 6d22db12e96..00000000000 --- a/tests/cases/fourslash_old/genericWithSpecializedProperties1.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// - -////interface Foo { -//// x: Foo; -//// y: Foo; -////} - -////var f: Foo; -////var xx/*1*/ = f.x; -////var yy/*2*/ = f.y; - -////var f2: Foo; -////var x2/*3*/ = f2.x; -////var y2/*4*/ = f2.y; - -goTo.marker('1'); -verify.quickInfoIs('Foo'); -goTo.marker('2'); -verify.quickInfoIs('Foo'); - -goTo.marker('3'); -verify.quickInfoIs('Foo'); -goTo.marker('4'); -verify.quickInfoIs('Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericWithSpecializedProperties2.ts b/tests/cases/fourslash_old/genericWithSpecializedProperties2.ts deleted file mode 100644 index 14107df04a6..00000000000 --- a/tests/cases/fourslash_old/genericWithSpecializedProperties2.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// - -////interface Foo { -//// y: Foo; -//// x: Foo; -////} -////var f: Foo; -////var x/*1*/ = f.x; -////var y/*2*/ = f.y; - -////var f2: Foo; -////var x2/*3*/ = f2.x; -////var y2/*4*/ = f2.y; - -goTo.marker('1'); -verify.quickInfoIs('Foo'); -goTo.marker('2'); -verify.quickInfoIs('Foo'); - -goTo.marker('3'); -verify.quickInfoIs('Foo'); -goTo.marker('4'); -verify.quickInfoIs('Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/genericWithSpecializedProperties3.ts b/tests/cases/fourslash_old/genericWithSpecializedProperties3.ts deleted file mode 100644 index dc7a83879c4..00000000000 --- a/tests/cases/fourslash_old/genericWithSpecializedProperties3.ts +++ /dev/null @@ -1,24 +0,0 @@ -/// - -////interface Foo { -//// x: Foo; -//// y: Foo; -////} - -////var f: Foo; -////var xx/*1*/ = f.x; -////var yy/*2*/ = f.y; - -////var f2: Foo; -////var x2/*3*/ = f2.x; -////var y2/*4*/ = f2.y; - -goTo.marker('1'); -verify.quickInfoIs('Foo'); -goTo.marker('2'); -verify.quickInfoIs('Foo'); - -goTo.marker('3'); -verify.quickInfoIs('Foo'); -goTo.marker('4'); -verify.quickInfoIs('Foo'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/indexerReturnTypes1.ts b/tests/cases/fourslash_old/indexerReturnTypes1.ts deleted file mode 100644 index 5443001432d..00000000000 --- a/tests/cases/fourslash_old/indexerReturnTypes1.ts +++ /dev/null @@ -1,111 +0,0 @@ -/// - -////interface Numeric { -//// [x: number]: Date; -////} -////} -////interface Stringy { -//// [x: string]: RegExp; -////} -////} -////interface NumericPlus { -//// [x: number]: Date; -//// foo(): Date; -////} -////} -////interface StringyPlus { -//// [x: string]: RegExp; -//// foo(): RegExp; -////} -////} -////interface NumericG { -//// [x: number]: T; -////} -////} -////interface StringyG { -//// [x: string]: T; -////} -////} -////interface Ty { -//// [x: number]: Ty; -////} -////interface Ty2 { -//// [x: number]: { [x: number]: T }; -////} -//// -//// -////} -////var numeric: Numeric; -////var stringy: Stringy; -////var numericPlus: NumericPlus; -////var stringPlus: StringyPlus; -////var numericG: NumericG; -////var stringyG: StringyG; -////var ty: Ty; -////var ty2: Ty2; -//// -////var r1/*1*/ = numeric[1]; -////var r2/*2*/ = numeric['1']; -////var r3/*3*/ = stringy[1]; -////var r4/*4*/ = stringy['1']; -////var r5/*5*/ = numericPlus[1]; -////var r6/*6*/ = numericPlus['1']; -////var r7/*7*/ = stringPlus[1]; -////var r8/*8*/ = stringPlus['1']; -////var r9/*9*/ = numericG[1]; -////var r10/*10*/ = numericG['1']; -////var r11/*11*/ = stringyG[1]; -////var r12/*12*/ = stringyG['1']; -////var r13/*13*/ = ty[1]; -////var r14/*14*/ = ty['1']; -////var r15/*15*/ = ty2[1]; -////var r16/*16*/ = ty2['1']; - - -goTo.marker('1'); -verify.quickInfoIs('Date'); - -goTo.marker('2'); -verify.quickInfoIs('any'); - -goTo.marker('3'); -verify.quickInfoIs('RegExp'); - -goTo.marker('4'); -verify.quickInfoIs('RegExp'); - -goTo.marker('5'); -verify.quickInfoIs('Date'); - -goTo.marker('6'); -verify.quickInfoIs('any'); - -goTo.marker('7'); -verify.quickInfoIs('RegExp'); - -goTo.marker('8'); -verify.quickInfoIs('RegExp'); - -goTo.marker('9'); -verify.quickInfoIs('Date'); - -goTo.marker('10'); -verify.quickInfoIs('any'); - -goTo.marker('11'); -verify.quickInfoIs('Date'); - -goTo.marker('12'); -verify.quickInfoIs('Date'); - -goTo.marker('13'); -verify.quickInfoIs('Ty'); - -goTo.marker('14'); -verify.quickInfoIs('any'); - -goTo.marker('15'); -verify.quickInfoIs('{ [x: number]: Date; }'); - -goTo.marker('16'); -verify.quickInfoIs('any'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/memberListOfModuleInAnotherModule.ts b/tests/cases/fourslash_old/memberListOfModuleInAnotherModule.ts deleted file mode 100644 index fcbfc607453..00000000000 --- a/tests/cases/fourslash_old/memberListOfModuleInAnotherModule.ts +++ /dev/null @@ -1,38 +0,0 @@ -/// - -////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', 'number'); -verify.completionListContains('meFunc', '(): void'); -verify.completionListContains('meClass', 'mod1.meClass'); -verify.completionListContains('meMod', 'mod1.meMod'); -verify.completionListContains('meInt', 'mod1.meInt'); - -goTo.marker('2'); -verify.completionListContains('meX', 'number'); -verify.completionListContains('meFunc', '(): void'); -verify.completionListContains('meClass', 'mod1.meClass'); -verify.completionListContains('meMod', 'mod1.meMod'); -verify.completionListContains('meInt', 'mod1.meInt'); - -goTo.marker('3'); -verify.completionListContains('iMex', 'number'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/noTypeParameterInLHS.ts b/tests/cases/fourslash_old/noTypeParameterInLHS.ts deleted file mode 100644 index c99b518e5d6..00000000000 --- a/tests/cases/fourslash_old/noTypeParameterInLHS.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////interface I { } -////class C {} -////var i/*1*/: I; -////var c/*2*/: C; - -goTo.marker('1'); -verify.quickInfoIs('I'); -goTo.marker('2'); -verify.quickInfoIs('C>'); diff --git a/tests/cases/fourslash_old/numericPropertyNames.ts b/tests/cases/fourslash_old/numericPropertyNames.ts deleted file mode 100644 index 5d15882ed1b..00000000000 --- a/tests/cases/fourslash_old/numericPropertyNames.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// - -////var t2/**/ = { 0: 1, 1: "" }; - -goTo.marker(); -verify.quickInfoIs('{ 0: number; 1: string; }'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/overloadOnConstCallSignature.ts b/tests/cases/fourslash_old/overloadOnConstCallSignature.ts deleted file mode 100644 index d206b139072..00000000000 --- a/tests/cases/fourslash_old/overloadOnConstCallSignature.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////var foo: { -//// (name: string): string; -//// (name: 'order'): string; -//// (name: 'content'): string; -//// (name: 'done'): string; -////} - -////var x/*2*/ = foo(/*1*/ - -goTo.marker('1'); -verify.signatureHelpCountIs(4); -verify.currentSignatureHelpIs('foo(name: string): string'); -edit.insert('"hi"'); - -goTo.marker('2'); -verify.quickInfoIs('string'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/proto.ts b/tests/cases/fourslash_old/proto.ts index ae98e6f167b..cdb279b5009 100644 --- a/tests/cases/fourslash_old/proto.ts +++ b/tests/cases/fourslash_old/proto.ts @@ -8,13 +8,13 @@ ////var /*4*/fun: (__proto__: any) => boolean; goTo.marker('1'); -verify.quickInfoIs("__proto__", "", "M.__proto__", "interface"); +verify.quickInfoIs("interface M.__proto__", ""); goTo.marker('2'); -verify.quickInfoIs("M.__proto__", "", "__proto__", "var"); +verify.quickInfoIs("(var) __proto__: M.__proto__", ""); goTo.marker('3'); -verify.completionListContains("__proto__", "M.__proto__", "", "__proto__", "var"); +verify.completionListContains("__proto__", "(var) __proto__: M.__proto__", ""); edit.insert("__proto__"); goTo.definition(); verify.caretAtMarker('2'); goTo.marker('4'); -verify.quickInfoIs("(__proto__: any) => boolean", "", "fun", "var"); \ No newline at end of file +verify.quickInfoIs("(var) fun: (__proto__: any) => boolean", ""); \ No newline at end of file diff --git a/tests/cases/fourslash_old/prototypeProperty.ts b/tests/cases/fourslash_old/prototypeProperty.ts deleted file mode 100644 index d31bf01e34e..00000000000 --- a/tests/cases/fourslash_old/prototypeProperty.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// - -////class A {} -////A.prototype/*1*/; -////A./*2*/ - -goTo.marker('1'); -verify.quickInfoIs('A'); - -goTo.marker('2'); -verify.completionListContains('prototype', 'A'); diff --git a/tests/cases/fourslash_old/recursiveObjectLiteral.ts b/tests/cases/fourslash_old/recursiveObjectLiteral.ts deleted file mode 100644 index 482d7394155..00000000000 --- a/tests/cases/fourslash_old/recursiveObjectLiteral.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// - -////var a = { f: a/**/ - -goTo.marker(); -verify.quickInfoIs("{ f: any; }", null, "a", "var"); \ No newline at end of file diff --git a/tests/cases/fourslash_old/regexp.ts b/tests/cases/fourslash_old/regexp.ts deleted file mode 100644 index 2b1d96c604e..00000000000 --- a/tests/cases/fourslash_old/regexp.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// - -////var x/**/ = /aa/; - -goTo.marker(); -verify.quickInfoIs("RegExp"); diff --git a/tests/cases/fourslash_old/restArgType.ts b/tests/cases/fourslash_old/restArgType.ts index eda49715e43..4676c3dc3e3 100644 --- a/tests/cases/fourslash_old/restArgType.ts +++ b/tests/cases/fourslash_old/restArgType.ts @@ -1,80 +1,80 @@ /// ////class Test { -//// private _priv(...restArgs/*1*/) { +//// private _priv(.../*1*/restArgs) { //// } -//// public pub(...restArgs/*2*/) { +//// public pub(.../*2*/restArgs) { //// var x = restArgs[2]; //// } ////} -////var x: (...y: string[]) => void = function (...y/*3*/) { +////var x: (...y: string[]) => void = function (.../*3*/y) { //// var t = y; ////}; ////function foo(x: (...y: string[]) => void ) { } -////foo((...y1/*4*/) => { +////foo((.../*4*/y1) => { //// var t = y; ////}); -////foo((y2/*5*/) => { +////foo((/*5*/y2) => { //// var t = y; ////}); -////var t1 :(a1: string, a2: string) => void = (...f1/*t1*/) => { } // f1 => any[]; -////var t2: (a1: string, ...a2: string[]) => void = (...f1/*t2*/) => { } // f1 => any[]; -////var t3: (a1: number, a2: boolean, ...c: string[]) => void = (f1/*t31*/, ...f2/*t32*/) => { }; // f1 => number, f2 => any[] -////var t4: (...a1: string[]) => void = (...f1/*t4*/) => { }; // f1 => string[] -////var t5: (...a1: string[]) => void = (f1/*t5*/) => { }; // f1 => string -////var t6: (...a1: string[]) => void = (f1/*t61*/, ...f2/*t62*/) => { }; // f1 => string, f2 => string[] -////var t7: (...a1: string[]) => void = (f1/*t71*/, f2/*t72*/, f3/*t73*/) => { }; // fa => string, f2 => string, f3 => string +////var t1 :(a1: string, a2: string) => void = (.../*t1*/f1) => { } // f1 => any[]; +////var t2: (a1: string, ...a2: string[]) => void = (.../*t2*/f1) => { } // f1 => any[]; +////var t3: (a1: number, a2: boolean, ...c: string[]) => void = (f1/*t31*/, .../*t32*/f2) => { }; // f1 => number, f2 => any[] +////var t4: (...a1: string[]) => void = (.../*t4*/f1) => { }; // f1 => string[] +////var t5: (...a1: string[]) => void = (/*t5*/f1) => { }; // f1 => string +////var t6: (...a1: string[]) => void = (/*t61*/f1, .../*t62*/f2) => { }; // f1 => string, f2 => string[] +////var t7: (...a1: string[]) => void = (/*t71*/f1, /*t72*/f2, /*t73*/f3) => { }; // fa => string, f2 => string, f3 => string ////// Explicit type annotation -////var t8: (...a1: string[]) => void = (f1/*t8*/: number[]) => { }; +////var t8: (...a1: string[]) => void = (/*t8*/f1: number[]) => { }; ////// Explicit initialization value -////var t9: (a1: string[], a2: string[]) => void = (f1/*t91*/ = 4, f2/*t92*/ = [false, true]) => { }; +////var t9: (a1: string[], a2: string[]) => void = (/*t91*/f1 = 4, /*t92*/f2 = [false, true]) => { }; goTo.marker("1"); -verify.quickInfoIs("any[]", "", "restArgs", "parameter"); +verify.quickInfoIs("(parameter) restArgs: any[]", ""); goTo.marker("2"); -verify.quickInfoIs("any[]", "", "restArgs", "parameter"); +verify.quickInfoIs("(parameter) restArgs: any[]", ""); goTo.marker("3"); -verify.quickInfoIs("string[]", "", "y", "parameter"); +verify.quickInfoIs("(parameter) y: string[]", ""); goTo.marker("4"); -verify.quickInfoIs("string[]", "", "y1", "parameter"); +verify.quickInfoIs("(parameter) y1: string[]", ""); goTo.marker("5"); -verify.quickInfoIs("string", "", "y2", "parameter"); +verify.quickInfoIs("(parameter) y2: string", ""); goTo.marker("t1"); -verify.quickInfoIs("any[]", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: any[]", ""); goTo.marker("t2"); -verify.quickInfoIs("any[]", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: any[]", ""); goTo.marker("t31"); -verify.quickInfoIs("number", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: number", ""); goTo.marker("t32"); -verify.quickInfoIs("any[]", "", "f2", "parameter"); +verify.quickInfoIs("(parameter) f2: any[]", ""); goTo.marker("t4"); -verify.quickInfoIs("string[]", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: string[]", ""); goTo.marker("t5"); -verify.quickInfoIs("string", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: string", ""); goTo.marker("t61"); -verify.quickInfoIs("string", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: string", ""); goTo.marker("t62"); -verify.quickInfoIs("string[]", "", "f2", "parameter"); +verify.quickInfoIs("(parameter) f2: string[]", ""); goTo.marker("t71"); -verify.quickInfoIs("string", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: string", ""); goTo.marker("t72"); -verify.quickInfoIs("string", "", "f2", "parameter"); +verify.quickInfoIs("(parameter) f2: string", ""); goTo.marker("t73"); -verify.quickInfoIs("string", "", "f3", "parameter"); +verify.quickInfoIs("(parameter) f3: string", ""); goTo.marker("t8"); -verify.quickInfoIs("number[]", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: number[]", ""); goTo.marker("t91"); -verify.quickInfoIs("string[]", "", "f1", "parameter"); +verify.quickInfoIs("(parameter) f1: string[]", ""); goTo.marker("t92"); -verify.quickInfoIs("string[]", "", "f2", "parameter"); \ No newline at end of file +verify.quickInfoIs("(parameter) f2: string[]", ""); \ No newline at end of file diff --git a/tests/cases/fourslash_old/typedGenericPrototypeMember.ts b/tests/cases/fourslash_old/typedGenericPrototypeMember.ts deleted file mode 100644 index a5a12c27745..00000000000 --- a/tests/cases/fourslash_old/typedGenericPrototypeMember.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// - -////class C { -//// foo(x: T) { } -////} -////var x/*1*/ = new C(); // Quick Info for x is C -////var y/*2*/ = C.prototype; // Quick Info for y is C<{}> - -goTo.marker('1'); -verify.quickInfoIs('C'); - -goTo.marker('2'); -verify.quickInfoIs('C'); diff --git a/tests/cases/fourslash_old/underscoreTypings1.ts b/tests/cases/fourslash_old/underscoreTypings1.ts deleted file mode 100644 index b9d6c2c2f4b..00000000000 --- a/tests/cases/fourslash_old/underscoreTypings1.ts +++ /dev/null @@ -1,62 +0,0 @@ -/// - -////interface Iterator { -//// (value: T, index: any, list: any): U; -////} -//// -////interface WrappedArray { -//// map(iterator: Iterator, context?: any): U[]; -////} -//// -////interface Underscore { -//// (list: T[]): WrappedArray; -//// map(list: T[], iterator: Iterator, context?: any): U[]; -////} -//// -////declare var _: Underscore; -//// -////var a: string[]; -////var b/*1*/ = _.map(a, x/*2*/ => x.length); // Was typed any[], should be number[] -////var c/*3*/ = _(a).map(x/*4*/ => x.length); -////var d/*5*/ = a.map(x/*6*/ => x.length); -//// -////var aa: any[]; -////var bb/*7*/ = _.map(aa, x/*8*/ => x.length); -////var cc/*9*/ = _(aa).map(x/*10*/ => x.length); -////var dd/*11*/ = aa.map(x/*12*/ => x.length); -//// -////var e = a.map(x => x./*13*/ - -goTo.marker('1'); -verify.quickInfoIs('number[]'); -goTo.marker('2'); -verify.quickInfoIs('string'); - -goTo.marker('3'); -verify.quickInfoIs('number[]'); -goTo.marker('4'); -verify.quickInfoIs('string'); - -goTo.marker('5'); -verify.quickInfoIs('number[]'); -goTo.marker('6'); -verify.quickInfoIs('string'); - -goTo.marker('7'); -verify.quickInfoIs('any[]'); -goTo.marker('8'); -verify.quickInfoIs('any'); - -goTo.marker('9'); -verify.quickInfoIs('any[]'); -goTo.marker('10'); -verify.quickInfoIs('any'); - -goTo.marker('11'); -verify.quickInfoIs('any[]'); -goTo.marker('12'); -verify.quickInfoIs('any'); - -goTo.marker('13'); -verify.completionListContains('length'); -verify.not.completionListContains('toFixed'); \ No newline at end of file diff --git a/tests/cases/fourslash_old/widenedTypes.ts b/tests/cases/fourslash_old/widenedTypes.ts deleted file mode 100644 index 88f5d637ed2..00000000000 --- a/tests/cases/fourslash_old/widenedTypes.ts +++ /dev/null @@ -1,18 +0,0 @@ -/// - -////var a/*1*/ = null; // var a: any -////var b/*2*/ = undefined; // var b: any -////var c/*3*/ = { x: 0, y: null }; // var c: { x: number, y: any } -////var d/*4*/ = [null, undefined]; // var d: any[] - -goTo.marker('1'); -verify.quickInfoIs('any'); - -goTo.marker('2'); -verify.quickInfoIs('any'); - -goTo.marker('3'); -verify.quickInfoIs('{ x: number; y: any; }'); - -goTo.marker('4'); -verify.quickInfoIs('any[]');