Skip to content

Combine signatureHelp testing methods #24132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
259 changes: 120 additions & 139 deletions src/harness/fourslash.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/cases/fourslash/augmentedTypesModule2.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path='fourslash.ts'/>

////function /*11*/m2f(x: number) { };
////namespace m2f { export interface I { foo(): void } }
////namespace m2f { export interface I { foo(): void } }
////var x: m2f./*1*/
////var /*2*/r = m2f/*3*/;

Expand All @@ -18,4 +18,4 @@ verify.quickInfoAt("2", "var r: (x: number) => void");

goTo.marker('3');
edit.insert('(');
verify.currentSignatureHelpIs('m2f(x: number): void');
verify.signatureHelp({ text: "m2f(x: number): void" });
4 changes: 2 additions & 2 deletions tests/cases/fourslash/augmentedTypesModule3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path='fourslash.ts'/>

////function m2g() { };
////module m2g { export class C { foo(x: number) { } } }
////module m2g { export class C { foo(x: number) { } } }
////var x: m2g./*1*/;
////var /*2*/r = m2g/*3*/;

Expand All @@ -16,4 +16,4 @@ verify.quickInfoAt("2", "var r: typeof m2g");

goTo.marker('3');
edit.insert('(');
verify.currentSignatureHelpIs('m2g(): void');
verify.signatureHelp({ text: "m2g(): void" });
5 changes: 2 additions & 3 deletions tests/cases/fourslash/augmentedTypesModule6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ edit.insert('I;');

verify.completions({ marker: "2", includes: "m3f" });

goTo.marker('3');
verify.currentSignatureHelpIs('m3f(): m3f');
verify.signatureHelp({ marker: "3", text: "m3f(): m3f" });

verify.quickInfoAt("4", "var r: m3f");

Expand All @@ -23,4 +22,4 @@ edit.insert('foo(1)');

verify.completions({ marker: "6", includes: "foo" });
edit.insert('foo(');
verify.currentSignatureHelpIs('foo(): void');
verify.signatureHelp({ text: "foo(): void" });
3 changes: 1 addition & 2 deletions tests/cases/fourslash/callSignatureHelp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
////var c: C;
////c(/**/

goTo.marker();
verify.currentSignatureHelpIs('c(): number');
verify.signatureHelp({ marker: "", text: "c(): number" });
8 changes: 5 additions & 3 deletions tests/cases/fourslash/classExtendsInterfaceSigHelp1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
////var i: I;
////i.foo(/**/

goTo.marker();
verify.signatureHelpCountIs(2);
verify.currentParameterSpanIs('x: string');
verify.signatureHelp({
marker: "",
overloadsCount: 2,
parameterSpan: "x: string",
});
26 changes: 12 additions & 14 deletions tests/cases/fourslash/commentsClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
////var i6/*24*/_c = c/*25*/6;
/////*26*/
////class a {
//// /**
//// /**
//// constructor for a
//// @param a this is my a
//// */
Expand All @@ -63,8 +63,7 @@ verify.quickInfos({
2: "var i2: c2"
});

goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "3", docComment: "" });

verify.quickInfos({
4: "var i2_c: typeof c2",
Expand All @@ -73,8 +72,7 @@ verify.quickInfos({
7: "var i3: c3"
});

goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("Constructor comment");
verify.signatureHelp({ marker: "8", docComment: "Constructor comment" });

verify.quickInfos({
9: "var i3_c: typeof c3",
Expand All @@ -83,8 +81,7 @@ verify.quickInfos({
12: "var i4: c4"
});

goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("Constructor comment");
verify.signatureHelp({ marker: "13", docComment: "Constructor comment" });

verify.quickInfos({
14: "var i4_c: typeof c4",
Expand All @@ -93,8 +90,7 @@ verify.quickInfos({
17: "var i5: c5"
});

goTo.marker('18');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "18", docComment: "" });

verify.quickInfos({
19: "var i5_c: typeof c5",
Expand All @@ -103,8 +99,7 @@ verify.quickInfos({
22: "var i6: c6"
});

goTo.marker('23');
verify.currentSignatureHelpDocCommentIs("constructor comment");
verify.signatureHelp({ marker: "23", docComment: "constructor comment" });

verify.quickInfos({
24: "var i6_c: typeof c6",
Expand All @@ -128,9 +123,12 @@ verify.completionListContains("c6", "class c6", "class with statics and construc
verify.completionListContains("i6", "var i6: c6", "");
verify.completionListContains("i6_c", "var i6_c: typeof c6", "");

goTo.marker('27');
verify.currentSignatureHelpDocCommentIs("constructor for a");
verify.currentParameterHelpArgumentDocCommentIs("this is my a");
verify.signatureHelp({
marker: "27",
docComment: "constructor for a",
parameterDocComment: "this is my a",
tags: [{ name: "param", text: "a this is my a" }],
});

verify.quickInfos({
28: "constructor c2(): c2",
Expand Down
67 changes: 17 additions & 50 deletions tests/cases/fourslash/commentsClassMembers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");

goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "8", docComment: "sum with property", parameterDocComment: "number to add" });
verify.quickInfoAt("8q", "(method) c1.p2(b: number): number", "sum with property");

goTo.marker('9');
Expand Down Expand Up @@ -220,9 +218,7 @@ verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");

goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "13", docComment: "sum with property", parameterDocComment: "number to add" });
verify.completionListContains("value", "(parameter) value: number", "this is value");

verify.quickInfos({
Expand Down Expand Up @@ -264,9 +260,7 @@ verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");

goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "20", docComment: "sum with property", parameterDocComment: "number to add" });
verify.quickInfoAt("20q", "(method) c1.pp2(b: number): number", "sum with property");

goTo.marker('21');
Expand Down Expand Up @@ -313,9 +307,7 @@ verify.completionListContains("nc_pp1", "(property) c1.nc_pp1: number", "");
verify.completionListContains("nc_pp2", "(method) c1.nc_pp2(b: number): number", "");
verify.completionListContains("nc_pp3", "(property) c1.nc_pp3: number", "");

goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "25", docComment: "sum with property", parameterDocComment: "number to add" });
verify.completionListContains("value", "(parameter) value: number", "this is value");

verify.quickInfos({
Expand Down Expand Up @@ -352,9 +344,7 @@ verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");

goTo.marker('35');
verify.currentSignatureHelpDocCommentIs("static sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "35", docComment: "static sum with property", parameterDocComment: "number to add" });
verify.completionListContains("c1", "class c1", "This is comment for c1");
verify.quickInfoAt("35q", "(method) c1.s2(b: number): number", "static sum with property");

Expand Down Expand Up @@ -390,9 +380,7 @@ verify.completionListContains("nc_s1", "(property) c1.nc_s1: number", "");
verify.completionListContains("nc_s2", "(method) c1.nc_s2(b: number): number", "");
verify.completionListContains("nc_s3", "(property) c1.nc_s3: number", "");

goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("static sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "42", docComment: "static sum with property", parameterDocComment: "number to add" });
verify.completionListContains("value", "(parameter) value: number", "this is value");
verify.quickInfos({
"42q": ["(method) c1.s2(b: number): number", "static sum with property"],
Expand All @@ -405,17 +393,13 @@ verify.completionListContains("b", "(parameter) b: number", "");

verify.quickInfoAt("46", "(property) c1.nc_p3: number");

goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "47", docComment: "" });
verify.quickInfos({
"47q": "(method) c1.nc_p2(b: number): number",
48: "(property) c1.nc_p3: number"
});

goTo.marker('49');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "49", docComment: "" });
verify.completionListContains("value", "(parameter) value: number", "");
verify.quickInfos({
"49q": "(method) c1.nc_p2(b: number): number",
Expand All @@ -428,17 +412,13 @@ verify.completionListContains("b", "(parameter) b: number", "");

verify.quickInfoAt("53", "(property) c1.nc_pp3: number");

goTo.marker('54');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "54", docComment: "" });
verify.quickInfos({
"54q": "(method) c1.nc_pp2(b: number): number",
55: "(property) c1.nc_pp3: number"
});

goTo.marker('56');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "56", docComment: "" });
verify.completionListContains("value", "(parameter) value: number", "");
verify.quickInfos({
"56q": "(method) c1.nc_pp2(b: number): number",
Expand All @@ -451,25 +431,20 @@ verify.completionListContains("b", "(parameter) b: number", "");

verify.quickInfoAt("60", "(property) c1.nc_s3: number");

goTo.marker('61');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "61", docComment: "" });
verify.quickInfos({
"61q": "(method) c1.nc_s2(b: number): number",
62: "(property) c1.nc_s3: number"
});

goTo.marker('63');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "63", docComment: "" });
verify.completionListContains("value", "(parameter) value: number", "");
verify.quickInfos({
"63q": "(method) c1.nc_s2(b: number): number",
64: "var i1: c1"
});

goTo.marker('65');
verify.currentSignatureHelpDocCommentIs("Constructor method");
verify.signatureHelp({ marker: "65", docComment: "Constructor method" });
verify.quickInfos({
"65q": ["constructor c1(): c1", "Constructor method"],
66: "var i1_p: number"
Expand All @@ -490,9 +465,7 @@ verify.quickInfos({
70: "var i1_r: number"
});

goTo.marker('71');
verify.currentSignatureHelpDocCommentIs("sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "71", docComment: "sum with property", parameterDocComment: "number to add" });

verify.quickInfos({
"71q": ["(method) c1.p2(b: number): number", "sum with property"],
Expand All @@ -507,9 +480,7 @@ verify.quickInfos({
80: "var i1_ncr: number"
});

goTo.marker('81');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "81", docComment: "" });

verify.quickInfos({
"81q": "(method) c1.nc_p2(b: number): number",
Expand Down Expand Up @@ -539,9 +510,7 @@ verify.quickInfos({
91: "var i1_s_r: number"
});

goTo.marker('92');
verify.currentSignatureHelpDocCommentIs("static sum with property");
verify.currentParameterHelpArgumentDocCommentIs("number to add");
verify.signatureHelp({ marker: "92", docComment: "static sum with property", parameterDocComment: "number to add" });

verify.quickInfos({
"92q": ["(method) c1.s2(b: number): number", "static sum with property"],
Expand All @@ -556,9 +525,7 @@ verify.quickInfos({
101: "var i1_s_ncr: number"
});

goTo.marker('102');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "102", docComment: "" });
verify.quickInfos({
"102q": "(method) c1.nc_s2(b: number): number",
103: "var i1_s_ncprop: number",
Expand Down
Loading