From ace383d342e76866b653c5169d0ace81b3069dff Mon Sep 17 00:00:00 2001 From: Yui T Date: Tue, 1 Dec 2015 18:39:02 -0800 Subject: [PATCH 1/3] add tests --- .../quickInfoForTypeParameterInTypeAlias.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts diff --git a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts new file mode 100644 index 00000000000..7259a299a7b --- /dev/null +++ b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts @@ -0,0 +1,29 @@ +/// + +//// type Ctor = new () => A/*1*/A; +//// type MixinCtor = new () => AA & { constructor: MixinCtor }; +//// type NestedCtor = new() => AA & (new () => AA & { constructor: NestedCtor }); +//// type Method = { method(): A/*4*/A }; +//// type Construct = { new(): A/*5*/A }; +//// type Call = { (): A/*6*/A }; +//// type Index = {[foo: string]: A/*7*/A}; +//// type GenericMethod = { method(): A/*8*/A & B/*9*/B } + +goTo.marker('1'); +verify.quickInfoIs('(type parameter) AA in type Ctor'); +goTo.marker('2'); +verify.quickInfoIs('(type parameter) AA in type MixinCtor'); +goTo.marker('3'); +verify.quickInfoIs('(type parameter) AA in type NestedCtor'); +goTo.marker('4'); +verify.quickInfoIs('(type parameter) AA in type Method'); +goTo.marker('5'); +verify.quickInfoIs('(type parameter) AA in type Construct'); +goTo.marker('6'); +verify.quickInfoIs('(type parameter) AA in type Call'); +goTo.marker('7'); +verify.quickInfoIs('(type parameter) AA in type Index'); +goTo.marker('8'); +verify.quickInfoIs('(type parameter) AA in type GenericMethod'); +goTo.marker('9'); +verify.quickInfoIs('(type parameter) BB in method(): AA & BB'); \ No newline at end of file From 135e091c2acc81325f0d205db253e45b75d0c18c Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 2 Dec 2015 13:45:52 -0800 Subject: [PATCH 2/3] Add more tests --- ... quickInfoForTypeParameterInTypeAlias1.ts} | 14 ++--------- .../quickInfoForTypeParameterInTypeAlias2.ts | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) rename tests/cases/fourslash/{quickInfoForTypeParameterInTypeAlias.ts => quickInfoForTypeParameterInTypeAlias1.ts} (59%) create mode 100644 tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts diff --git a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias1.ts similarity index 59% rename from tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts rename to tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias1.ts index 7259a299a7b..7f5f6df4d5b 100644 --- a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias.ts +++ b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias1.ts @@ -5,9 +5,7 @@ //// type NestedCtor = new() => AA & (new () => AA & { constructor: NestedCtor }); //// type Method = { method(): A/*4*/A }; //// type Construct = { new(): A/*5*/A }; -//// type Call = { (): A/*6*/A }; -//// type Index = {[foo: string]: A/*7*/A}; -//// type GenericMethod = { method(): A/*8*/A & B/*9*/B } + goTo.marker('1'); verify.quickInfoIs('(type parameter) AA in type Ctor'); @@ -18,12 +16,4 @@ verify.quickInfoIs('(type parameter) AA in type NestedCtor'); goTo.marker('4'); verify.quickInfoIs('(type parameter) AA in type Method'); goTo.marker('5'); -verify.quickInfoIs('(type parameter) AA in type Construct'); -goTo.marker('6'); -verify.quickInfoIs('(type parameter) AA in type Call'); -goTo.marker('7'); -verify.quickInfoIs('(type parameter) AA in type Index'); -goTo.marker('8'); -verify.quickInfoIs('(type parameter) AA in type GenericMethod'); -goTo.marker('9'); -verify.quickInfoIs('(type parameter) BB in method(): AA & BB'); \ No newline at end of file +verify.quickInfoIs('(type parameter) AA in type Construct'); \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts new file mode 100644 index 00000000000..9a3682bf3bc --- /dev/null +++ b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts @@ -0,0 +1,24 @@ +/// + +//// type Call = { (): A/*1*/A }; +//// type Index = {[foo: string]: A/*2*/A}; +//// type GenericMethod = { method(): A/*3*/A & B/*4*/B } +//// type Nesting = { method(): new () => T/*5*/T & U/*6*/U & W/*7*/W }; + +type Nesting = { method(): new () => TT & UU & WW } + +goTo.marker('1'); +verify.quickInfoIs('(type parameter) AA in type Call'); +goTo.marker('2'); +verify.quickInfoIs('(type parameter) AA in type Index'); +goTo.marker('3'); +verify.quickInfoIs('(type parameter) AA in type GenericMethod'); +goTo.marker('4'); +verify.quickInfoIs('(type parameter) BB in method(): AA & BB'); +goTo.marker('5'); +verify.quickInfoIs('(type parameter) TT in type Nesting'); +goTo.marker('6'); +verify.quickInfoIs('(type parameter) UU in method(): new () => TT & UU & WW'); +goTo.marker('7'); +verify.quickInfoIs('(type parameter) WW in (): TT & UU & WW'); + From f83817a4884940ddc6e3144965ac91e3652df0ba Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 2 Dec 2015 13:47:19 -0800 Subject: [PATCH 3/3] remove line and unused code --- tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts index 9a3682bf3bc..89a648470d6 100644 --- a/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts +++ b/tests/cases/fourslash/quickInfoForTypeParameterInTypeAlias2.ts @@ -5,8 +5,6 @@ //// type GenericMethod = { method(): A/*3*/A & B/*4*/B } //// type Nesting = { method(): new () => T/*5*/T & U/*6*/U & W/*7*/W }; -type Nesting = { method(): new () => TT & UU & WW } - goTo.marker('1'); verify.quickInfoIs('(type parameter) AA in type Call'); goTo.marker('2');