mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:21:18 -05:00
Tests for signature help on tagged templates with no overloads.
This commit is contained in:
15
tests/cases/fourslash/signatureHelpTaggedTemplates1.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates1.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `/*1*/ qwe/*2*/rty /*3*/$/*4*/{ 123 }/*5*/ as/*6*/df /*7*/$/*8*/{ 41234 }/*9*/ zxc/*10*/vb /*11*/$/*12*/{ g ` ` }/*13*/ /*14*/ /*15*/`
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates2.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates2.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `/*1*/ qwe/*2*/rty /*3*/$/*4*/{ 123 }/*5*/ as/*6*/df /*7*/$/*8*/{ 41234 }/*9*/ zxc/*10*/vb /*11*/$/*12*/{ g ` ` }/*13*/ /*14*/ /*15*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates3.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates3.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` qwerty ${/*1*/ /*2*/123/*3*/ /*4*/} asdf ${ 41234 } zxcvb ${ g ` ` } `
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("x");
|
||||
verify.currentParameterSpanIs("x: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates4.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates4.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` qwerty ${ 123 } asdf ${/*1*/ /*2*/ /*3*/41/*4*/234/*5*/ /*6*/} zxcvb ${ g ` ` } `
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("y");
|
||||
verify.currentParameterSpanIs("y: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates5.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates5.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${/*1*/ /*2*/g/*3*/ /*4*/` `/*5*/ /*6*/} `
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("z");
|
||||
verify.currentParameterSpanIs("z: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates6.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates6.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${ g `/*1*/ /*2*/ /*3*/` } `
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('g(templateStrings: any, x: any, y: any, z: any): string');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
15
tests/cases/fourslash/signatureHelpTaggedTemplates7.ts
Normal file
15
tests/cases/fourslash/signatureHelpTaggedTemplates7.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `/*1*/ /*2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `/*1*/ /*2*/${
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` ${/*1*/ /*2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("x");
|
||||
verify.currentParameterSpanIs("x: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` ${ }/*1*/ /*2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` ${ } ${/*1*/ /*2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("y");
|
||||
verify.currentParameterSpanIs("y: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` ${ } ${ }/*1*/ /*2*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("templateStrings");
|
||||
verify.currentParameterSpanIs("templateStrings: any");
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f ` ${ 123 } ${/*1*/ } `
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
verify.currentParameterHelpArgumentNameIs("y");
|
||||
verify.currentParameterSpanIs("y: any");
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// /*1*/f/*2*/ /*3*/` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${ g ` ` } `/*4*/
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.not.signatureHelpPresent();
|
||||
});
|
||||
13
tests/cases/fourslash/signatureHelpTaggedTemplatesNested1.ts
Normal file
13
tests/cases/fourslash/signatureHelpTaggedTemplatesNested1.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `a ${ g `/*1*/alpha/*2*/ ${/*3*/ 12/*4*/3 /*5*/} beta /*6*/${ /*7*/456 /*8*/} gamma/*9*/` } b ${ g `/*10*/txt/*11*/` } c ${ g `/*12*/aleph /*13*/$/*14*/{ 12/*15*/3 } beit/*16*/` } d`;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('g(templateStrings: any, x: any, y: any, z: any): string');
|
||||
});
|
||||
14
tests/cases/fourslash/signatureHelpTaggedTemplatesNested2.ts
Normal file
14
tests/cases/fourslash/signatureHelpTaggedTemplatesNested2.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path="./fourslash.ts"/>
|
||||
|
||||
//// function f(templateStrings, x, y, z) { return 10; }
|
||||
//// function g(templateStrings, x, y, z) { return ""; }
|
||||
////
|
||||
//// f `/*1*/a $/*2*/{ /*3*/g /*4*/`alpha ${ 123 } beta ${ 456 } gamma`/*5*/ }/*6*/ b $/*7*/{ /*8*/g /*9*/`txt`/*10*/ } /*11*/c ${ /*12*/g /*13*/`aleph ${ 123 } beit`/*14*/ } d/*15*/`;
|
||||
debugger;
|
||||
|
||||
test.markers().forEach(m => {
|
||||
goTo.position(m.position);
|
||||
verify.signatureHelpCountIs(1);
|
||||
verify.currentSignatureParamterCountIs(4);
|
||||
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
|
||||
});
|
||||
Reference in New Issue
Block a user