Combine signatureHelp testing methods (#24132)

This commit is contained in:
Andy
2018-05-15 12:34:53 -07:00
committed by GitHub
parent 5756ae1fd8
commit e1f22ac568
136 changed files with 1306 additions and 1583 deletions

View File

@@ -23,7 +23,7 @@
namespace FourSlash {
ts.disableIncrementalParsing = false;
import ArrayOrSingle = FourSlashInterface.Many;
import ArrayOrSingle = FourSlashInterface.ArrayOrSingle;
// Represents a parsed source file with metadata
interface FourSlashFile {
@@ -378,7 +378,6 @@ namespace FourSlash {
"getCompletionEntryDetails",
"getCompletionEntrySymbol",
"getQuickInfoAtPosition",
"getSignatureHelpItems",
"getReferencesAtPosition",
"getDocumentHighlights",
];
@@ -1062,8 +1061,8 @@ namespace FourSlash {
if (tags !== undefined) {
assert.equal(details.tags.length, tags.length, this.messageAtLastKnownMarker("QuickInfo tags"));
ts.zipWith(tags, details.tags, (expectedTag, actualTag) => {
assert.equal(expectedTag.name, actualTag.name);
assert.equal(expectedTag.text, actualTag.text, this.messageAtLastKnownMarker("QuickInfo tag " + actualTag.name));
assert.equal(actualTag.name, expectedTag.name);
assert.equal(actualTag.text, expectedTag.text, this.messageAtLastKnownMarker("QuickInfo tag " + actualTag.name));
});
}
}
@@ -1446,83 +1445,91 @@ Actual: ${stringify(fullActual)}`);
}
}
public verifyCurrentSignatureHelpIs(expected: string) {
const help = this.getActiveSignatureHelpItem();
assert.equal(
ts.displayPartsToString(help.prefixDisplayParts) +
help.parameters.map(p => ts.displayPartsToString(p.displayParts)).join(ts.displayPartsToString(help.separatorDisplayParts)) +
ts.displayPartsToString(help.suffixDisplayParts), expected);
public verifyNoSignatureHelp(markers: ReadonlyArray<string>) {
if (markers.length) {
for (const marker of markers) {
this.goToMarker(marker);
this.verifyNoSignatureHelp(ts.emptyArray);
}
return;
}
const actual = this.getSignatureHelp();
if (actual) {
this.raiseError(`Expected no signature help, but got "${stringify(actual)}"`);
}
}
public verifyCurrentParameterIsVariable(isVariable: boolean) {
const signature = this.getActiveSignatureHelpItem();
assert.isOk(signature);
assert.equal(isVariable, signature.isVariadic);
public verifySignatureHelp(optionses: ReadonlyArray<FourSlashInterface.VerifySignatureHelpOptions>) {
for (const options of optionses) {
if (options.marker === undefined) {
this.verifySignatureHelpWorker(options);
}
else {
for (const marker of toArray(options.marker)) {
this.goToMarker(marker);
this.verifySignatureHelpWorker(options);
}
}
}
}
public verifyCurrentParameterHelpName(name: string) {
const activeParameter = this.getActiveParameter();
const activeParameterName = activeParameter.name;
assert.equal(activeParameterName, name);
}
private verifySignatureHelpWorker(options: FourSlashInterface.VerifySignatureHelpOptions) {
const help = this.getSignatureHelp();
const selectedItem = help.items[help.selectedItemIndex];
// Argument index may exceed number of parameters
const currentParameter: ts.SignatureHelpParameter | undefined = selectedItem.parameters[help.argumentIndex];
public verifyCurrentParameterSpanIs(parameter: string) {
const activeParameter = this.getActiveParameter();
assert.equal(ts.displayPartsToString(activeParameter.displayParts), parameter);
}
assert.equal(help.items.length, options.overloadsCount || 1, this.assertionMessageAtLastKnownMarker("signature help overloads count"));
public verifyCurrentParameterHelpDocComment(docComment: string) {
const activeParameter = this.getActiveParameter();
const activeParameterDocComment = activeParameter.documentation;
assert.equal(ts.displayPartsToString(activeParameterDocComment), docComment, this.assertionMessageAtLastKnownMarker("current parameter Help DocComment"));
}
assert.equal(ts.displayPartsToString(selectedItem.documentation), options.docComment || "", this.assertionMessageAtLastKnownMarker("current signature help doc comment"));
public verifyCurrentSignatureHelpParameterCount(expectedCount: number) {
assert.equal(this.getActiveSignatureHelpItem().parameters.length, expectedCount);
}
if (options.text !== undefined) {
assert.equal(
ts.displayPartsToString(selectedItem.prefixDisplayParts) +
selectedItem.parameters.map(p => ts.displayPartsToString(p.displayParts)).join(ts.displayPartsToString(selectedItem.separatorDisplayParts)) +
ts.displayPartsToString(selectedItem.suffixDisplayParts), options.text);
}
if (options.parameterName !== undefined) {
assert.equal(currentParameter!.name, options.parameterName);
}
if (options.parameterSpan !== undefined) {
assert.equal(ts.displayPartsToString(currentParameter!.displayParts), options.parameterSpan);
}
if (currentParameter) {
assert.equal(ts.displayPartsToString(currentParameter.documentation), options.parameterDocComment || "", this.assertionMessageAtLastKnownMarker("current parameter Help DocComment"));
}
if (options.parameterCount !== undefined) {
assert.equal(selectedItem.parameters.length, options.parameterCount);
}
if (options.argumentCount !== undefined) {
assert.equal(help.argumentCount, options.argumentCount);
}
public verifyCurrentSignatureHelpIsVariadic(expected: boolean) {
assert.equal(this.getActiveSignatureHelpItem().isVariadic, expected);
}
assert.equal(selectedItem.isVariadic, !!options.isVariadic);
public verifyCurrentSignatureHelpDocComment(docComment: string) {
const actualDocComment = this.getActiveSignatureHelpItem().documentation;
assert.equal(ts.displayPartsToString(actualDocComment), docComment, this.assertionMessageAtLastKnownMarker("current signature help doc comment"));
}
public verifyCurrentSignatureHelpTags(tags: ts.JSDocTagInfo[]) {
const actualTags = this.getActiveSignatureHelpItem().tags;
assert.equal(actualTags.length, tags.length, this.assertionMessageAtLastKnownMarker("signature help tags"));
ts.zipWith(tags, actualTags, (expectedTag, actualTag) => {
const actualTags = selectedItem.tags;
assert.equal(actualTags.length, (options.tags || ts.emptyArray).length, this.assertionMessageAtLastKnownMarker("signature help tags"));
ts.zipWith((options.tags || ts.emptyArray), actualTags, (expectedTag, actualTag) => {
assert.equal(expectedTag.name, actualTag.name);
assert.equal(expectedTag.text, actualTag.text, this.assertionMessageAtLastKnownMarker("signature help tag " + actualTag.name));
});
}
public verifySignatureHelpCount(expected: number) {
const help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
const actual = help && help.items ? help.items.length : 0;
assert.equal(actual, expected);
}
public verifySignatureHelpArgumentCount(expected: number) {
const signatureHelpItems = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
const actual = signatureHelpItems.argumentCount;
assert.equal(actual, expected);
}
public verifySignatureHelpPresent(shouldBePresent = true) {
const actual = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
if (shouldBePresent) {
if (!actual) {
this.raiseError("Expected signature help to be present, but it wasn't");
}
}
else {
if (actual) {
this.raiseError(`Expected no signature help, but got "${stringify(actual)}"`);
}
const allKeys: ReadonlyArray<keyof FourSlashInterface.VerifySignatureHelpOptions> = [
"marker",
"overloadsCount",
"docComment",
"text",
"parameterName",
"parameterSpan",
"parameterDocComment",
"parameterCount",
"isVariadic",
"tags",
"argumentCount",
];
for (const key in options) {
ts.Debug.assert(ts.contains(allKeys, key));
}
}
@@ -1564,19 +1571,6 @@ Actual: ${stringify(fullActual)}`);
this.validate("error", message, renameInfo.localizedErrorMessage);
}
private getActiveSignatureHelpItem() {
const help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
const index = help.selectedItemIndex;
return help.items[index];
}
private getActiveParameter(): ts.SignatureHelpParameter {
const help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
const item = help.items[help.selectedItemIndex];
const currentParam = help.argumentIndex;
return item.parameters[currentParam];
}
private alignmentForExtraInfo = 50;
private spanInfoToString(spanInfo: ts.TextSpan, prefixString: string) {
@@ -1790,8 +1784,12 @@ Actual: ${stringify(fullActual)}`);
}
public printCurrentSignatureHelp() {
const sigHelp = this.getActiveSignatureHelpItem();
Harness.IO.log(stringify(sigHelp));
const help = this.getSignatureHelp();
Harness.IO.log(stringify(help.items[help.selectedItemIndex]));
}
private getSignatureHelp(): ts.SignatureHelpItems | undefined {
return this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
}
public printCompletionListMembers(preferences: ts.UserPreferences | undefined) {
@@ -4042,8 +4040,12 @@ namespace FourSlashInterface {
this.state.verifyCompletionListAllowsNewIdentifier(this.negative);
}
public signatureHelpPresent() {
this.state.verifySignatureHelpPresent(!this.negative);
public noSignatureHelp(...markers: string[]): void {
this.state.verifyNoSignatureHelp(markers);
}
public signatureHelp(...options: VerifySignatureHelpOptions[]): void {
this.state.verifySignatureHelp(options);
}
public errorExistsBetweenMarkers(startMarker: string, endMarker: string) {
@@ -4108,7 +4110,7 @@ namespace FourSlashInterface {
super(state);
}
public completionsAt(markerName: Many<string>, completions: ReadonlyArray<ExpectedCompletionEntry>, options?: CompletionsAtOptions) {
public completionsAt(markerName: ArrayOrSingle<string>, completions: ReadonlyArray<ExpectedCompletionEntry>, options?: CompletionsAtOptions) {
this.state.verifyCompletionsAt(markerName, completions, options);
}
@@ -4163,19 +4165,19 @@ namespace FourSlashInterface {
this.state.verifyCurrentFileContent(text);
}
public goToDefinitionIs(endMarkers: Many<string>) {
public goToDefinitionIs(endMarkers: ArrayOrSingle<string>) {
this.state.verifyGoToDefinitionIs(endMarkers);
}
public goToDefinition(startMarkerName: Many<string>, endMarkerName: Many<string>, range?: FourSlash.Range): void;
public goToDefinition(startsAndEnds: [Many<string>, Many<string>][] | { [startMarkerName: string]: Many<string> }): void;
public goToDefinition(arg0: any, endMarkerName?: Many<string>) {
public goToDefinition(startMarkerName: ArrayOrSingle<string>, endMarkerName: ArrayOrSingle<string>, range?: FourSlash.Range): void;
public goToDefinition(startsAndEnds: [ArrayOrSingle<string>, ArrayOrSingle<string>][] | { [startMarkerName: string]: ArrayOrSingle<string> }): void;
public goToDefinition(arg0: any, endMarkerName?: ArrayOrSingle<string>) {
this.state.verifyGoToDefinition(arg0, endMarkerName);
}
public goToType(startMarkerName: Many<string>, endMarkerName: Many<string>): void;
public goToType(startsAndEnds: [Many<string>, Many<string>][] | { [startMarkerName: string]: Many<string> }): void;
public goToType(arg0: any, endMarkerName?: Many<string>) {
public goToType(startMarkerName: ArrayOrSingle<string>, endMarkerName: ArrayOrSingle<string>): void;
public goToType(startsAndEnds: [ArrayOrSingle<string>, ArrayOrSingle<string>][] | { [startMarkerName: string]: ArrayOrSingle<string> }): void;
public goToType(arg0: any, endMarkerName?: ArrayOrSingle<string>) {
this.state.verifyGoToType(arg0, endMarkerName);
}
@@ -4203,7 +4205,7 @@ namespace FourSlashInterface {
this.state.verifyTypeOfSymbolAtLocation(range, symbol, expected);
}
public referenceGroups(starts: Many<string> | Many<FourSlash.Range>, parts: ReferenceGroup[]) {
public referenceGroups(starts: ArrayOrSingle<string> | ArrayOrSingle<FourSlash.Range>, parts: ReferenceGroup[]) {
this.state.verifyReferenceGroups(starts, parts);
}
@@ -4223,46 +4225,6 @@ namespace FourSlashInterface {
this.state.verifyDisplayPartsOfReferencedSymbol(expected);
}
public currentParameterHelpArgumentNameIs(name: string) {
this.state.verifyCurrentParameterHelpName(name);
}
public currentParameterSpanIs(parameter: string) {
this.state.verifyCurrentParameterSpanIs(parameter);
}
public currentParameterHelpArgumentDocCommentIs(docComment: string) {
this.state.verifyCurrentParameterHelpDocComment(docComment);
}
public currentSignatureHelpDocCommentIs(docComment: string) {
this.state.verifyCurrentSignatureHelpDocComment(docComment);
}
public currentSignatureHelpTagsAre(tags: ts.JSDocTagInfo[]) {
this.state.verifyCurrentSignatureHelpTags(tags);
}
public signatureHelpCountIs(expected: number) {
this.state.verifySignatureHelpCount(expected);
}
public signatureHelpCurrentArgumentListIsVariadic(expected: boolean) {
this.state.verifyCurrentSignatureHelpIsVariadic(expected);
}
public signatureHelpArgumentCountIs(expected: number) {
this.state.verifySignatureHelpArgumentCount(expected);
}
public currentSignatureParameterCountIs(expected: number) {
this.state.verifyCurrentSignatureHelpParameterCount(expected);
}
public currentSignatureHelpIs(expected: string) {
this.state.verifyCurrentSignatureHelpIs(expected);
}
public noErrors() {
this.state.verifyNoErrors();
}
@@ -4435,7 +4397,7 @@ namespace FourSlashInterface {
this.state.verifyRenameInfoFailed(message);
}
public renameLocations(startRanges: Many<FourSlash.Range>, options: FourSlash.Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: FourSlash.Range[] }) {
public renameLocations(startRanges: ArrayOrSingle<FourSlash.Range>, options: FourSlash.Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: FourSlash.Range[] }) {
this.state.verifyRenameLocations(startRanges, options);
}
@@ -4775,16 +4737,35 @@ namespace FourSlashInterface {
}
export interface VerifyCompletionsOptions {
readonly marker?: Many<string>;
readonly marker?: ArrayOrSingle<string>;
readonly isNewIdentifierLocation?: boolean;
readonly exact?: Many<ExpectedCompletionEntry>;
readonly includes?: Many<ExpectedCompletionEntry>;
readonly excludes?: Many<string | { readonly name: string, readonly source: string }>;
readonly exact?: ArrayOrSingle<ExpectedCompletionEntry>;
readonly includes?: ArrayOrSingle<ExpectedCompletionEntry>;
readonly excludes?: ArrayOrSingle<string | { readonly name: string, readonly source: string }>;
readonly preferences: ts.UserPreferences;
readonly triggerCharacter?: ts.CompletionsTriggerCharacter;
}
export type Many<T> = T | ReadonlyArray<T>;
export interface VerifySignatureHelpOptions {
readonly marker?: ArrayOrSingle<string>;
/** @default 1 */
readonly overloadsCount?: number;
/** @default undefined */
readonly docComment?: string;
readonly text?: string;
readonly parameterName?: string;
readonly parameterSpan?: string;
/** @default undefined */
readonly parameterDocComment?: string;
readonly parameterCount?: number;
readonly argumentCount?: number;
/** @default false */
readonly isVariadic?: boolean;
/** @default ts.emptyArray */
readonly tags?: ReadonlyArray<ts.JSDocTagInfo>;
}
export type ArrayOrSingle<T> = T | ReadonlyArray<T>;
export interface VerifyCompletionListContainsOptions extends ts.UserPreferences {
triggerCharacter?: ts.CompletionsTriggerCharacter;

View File

@@ -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*/;
@@ -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" });

View File

@@ -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*/;
@@ -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" });

View File

@@ -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");
@@ -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" });

View File

@@ -6,5 +6,4 @@
////var c: C;
////c(/**/
goTo.marker();
verify.currentSignatureHelpIs('c(): number');
verify.signatureHelp({ marker: "", text: "c(): number" });

View File

@@ -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",
});

View File

@@ -38,7 +38,7 @@
////var i6/*24*/_c = c/*25*/6;
/////*26*/
////class a {
//// /**
//// /**
//// constructor for a
//// @param a this is my a
//// */
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",

View File

@@ -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');
@@ -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({
@@ -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');
@@ -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({
@@ -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");
@@ -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"],
@@ -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",
@@ -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",
@@ -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"
@@ -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"],
@@ -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",
@@ -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"],
@@ -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",

View File

@@ -202,76 +202,72 @@
////class NoQuic/*50*/kInfoClass {
////}
goTo.marker('1');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "1", docComment: "" });
verify.quickInfoAt("1q", "function simple(): void");
goTo.marker('2');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "2", docComment: "" });
verify.quickInfoAt("2q", "function multiLine(): void");
goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("this is eg of single line jsdoc style comment ");
verify.signatureHelp({ marker: "3", docComment: "this is eg of single line jsdoc style comment " });
verify.quickInfoAt("3q", "function jsDocSingleLine(): void", "this is eg of single line jsdoc style comment ");
goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("this is multiple line jsdoc stule comment\nNew line1\nNew Line2");
verify.signatureHelp({ marker: "4", docComment: "this is multiple line jsdoc stule comment\nNew line1\nNew Line2" });
verify.quickInfoAt("4q", "function jsDocMultiLine(): void", "this is multiple line jsdoc stule comment\nNew line1\nNew Line2");
goTo.marker('5');
verify.currentSignatureHelpDocCommentIs("this is multiple line jsdoc stule comment\nNew line1\nNew Line2\nShoul mege this line as well\nand this too\nAnother this one too");
verify.signatureHelp({ marker: "5", docComment: "this is multiple line jsdoc stule comment\nNew line1\nNew Line2\nShoul mege this line as well\nand this too\nAnother this one too" });
verify.quickInfoAt("5q", "function jsDocMultiLineMerge(): void", "this is multiple line jsdoc stule comment\nNew line1\nNew Line2\nShoul mege this line as well\nand this too\nAnother this one too");
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("jsdoc comment ");
verify.signatureHelp({ marker: "6", docComment: "jsdoc comment " });
verify.quickInfoAt("6q", "function jsDocMixedComments1(): void", "jsdoc comment ");
goTo.marker('7');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.signatureHelp({ marker: "7", docComment: "jsdoc comment \nanother jsDocComment" });
verify.quickInfoAt("7q", "function jsDocMixedComments2(): void", "jsdoc comment \nanother jsDocComment");
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \n* triplestar jsDocComment");
verify.signatureHelp({ marker: "8", docComment: "jsdoc comment \n* triplestar jsDocComment" });
verify.quickInfoAt("8q", "function jsDocMixedComments3(): void", "jsdoc comment \n* triplestar jsDocComment");
goTo.marker('9');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.signatureHelp({ marker: "9", docComment: "jsdoc comment \nanother jsDocComment" });
verify.quickInfoAt("9q", "function jsDocMixedComments4(): void", "jsdoc comment \nanother jsDocComment");
goTo.marker('10');
verify.currentSignatureHelpDocCommentIs("jsdoc comment \nanother jsDocComment");
verify.signatureHelp({ marker: "10", docComment: "jsdoc comment \nanother jsDocComment" });
verify.quickInfoAt("10q", "function jsDocMixedComments5(): void", "jsdoc comment \nanother jsDocComment");
goTo.marker('11');
verify.currentSignatureHelpDocCommentIs("another jsDocComment\njsdoc comment ");
verify.signatureHelp({ marker: "11", docComment: "another jsDocComment\njsdoc comment " });
verify.quickInfoAt("11q", "function jsDocMixedComments6(): void", "another jsDocComment\njsdoc comment ");
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "12", docComment: "" });
verify.quickInfoAt("12q", "function noHelpComment1(): void");
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "13", docComment: "" });
verify.quickInfoAt("13q", "function noHelpComment2(): void");
goTo.marker('14');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp({ marker: "14", docComment: "" });
verify.quickInfoAt("14q", "function noHelpComment3(): void");
goTo.marker('15');
verify.completionListContains("sum", "function sum(a: number, b: number): number", "Adds two integers and returns the result");
goTo.marker('16');
verify.currentSignatureHelpDocCommentIs("Adds two integers and returns the result");
verify.currentParameterHelpArgumentDocCommentIs("first number");
const addTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "a first number" },
{ name: "param", text: "b second number" },
];
verify.signatureHelp({
marker: "16",
docComment: "Adds two integers and returns the result",
parameterDocComment: "first number",
tags: addTags,
});
verify.quickInfos({
"16q": ["function sum(a: number, b: number): number", "Adds two integers and returns the result"],
"16aq": ["(parameter) a: number", "first number"]
});
goTo.marker('17');
verify.currentSignatureHelpDocCommentIs("Adds two integers and returns the result");
verify.currentParameterHelpArgumentDocCommentIs("second number");
verify.signatureHelp({
marker: "17",
docComment: "Adds two integers and returns the result",
parameterDocComment: "second number",
tags: addTags,
});
verify.quickInfoAt("17aq", "(parameter) b: number", "second number");
goTo.marker('18');
@@ -279,9 +275,17 @@ verify.quickInfoIs("(parameter) a: number", "first number");
verify.completionListContains("a", "(parameter) a: number", "first number");
verify.completionListContains("b", "(parameter) b: number", "second number");
goTo.marker('19');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("first number");
const multiplyTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "" },
{ name: "param", text: "a first number" },
{ name: "param", text: "b" },
{ name: "param", text: "c" },
{ name: "param", text: "d" },
{ name: "anotherTag", text: undefined },
{ name: "param", text: "e LastParam " },
{ name: "anotherTag", text: undefined },
];
verify.signatureHelp({ marker: "19", docComment: "This is multiplication function", parameterDocComment: "first number", tags: multiplyTags });
verify.quickInfos({
"19q": [
"function multiply(a: number, b: number, c?: number, d?: any, e?: any): void",
@@ -290,41 +294,34 @@ verify.quickInfos({
"19aq": ["(parameter) a: number", "first number"]
});
goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "20", docComment: "This is multiplication function", tags: multiplyTags });
verify.quickInfoAt("20aq", "(parameter) b: number");
goTo.marker('21');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "21", docComment: "This is multiplication function", tags: multiplyTags });
verify.quickInfoAt("21aq", "(parameter) c: number");
goTo.marker('22');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "22", docComment: "This is multiplication function", tags: multiplyTags });
verify.quickInfoAt("22aq", "(parameter) d: any");
goTo.marker('23');
verify.currentSignatureHelpDocCommentIs("This is multiplication function");
verify.currentParameterHelpArgumentDocCommentIs("LastParam ");
verify.signatureHelp({ marker: "23", docComment: "This is multiplication function", parameterDocComment: "LastParam ", tags: multiplyTags });
verify.quickInfoAt("23aq", "(parameter) e: any", "LastParam ");
goTo.marker('24');
verify.completionListContains("aOrb", "(parameter) aOrb: any", "");
verify.completionListContains("opt", "(parameter) opt: any", "optional parameter");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("fn f1 with number");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({
marker: "25",
overloadsCount: 2,
docComment: "fn f1 with number",
tags: [{ name: "param", text: "b about b" }],
});
verify.quickInfos({
"25q": ["function f1(a: number): any (+1 overload)", "fn f1 with number"],
"25aq": "(parameter) a: number"
});
goTo.marker('26');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "26", overloadsCount: 2, docComment: "" });
verify.quickInfos({
"26q": "function f1(b: string): any (+1 overload)",
"26aq": "(parameter) b: string"
@@ -335,9 +332,15 @@ verify.completionListContains("multiply", "function multiply(a: number, b: numbe
verify.completionListContains("f1", "function f1(a: number): any (+1 overload)", "fn f1 with number");
const subtractDoc = "This is subtract function";
goTo.marker('28');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("");
const subtractTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "" },
{ name: "param", text: "b this is about b" },
{ name: "param", text: "c this is optional param c" },
{ name: "param", text: "d this is optional param d" },
{ name: "param", text: "e this is optional param e" },
{ name: "param", text: " { () => string; } } f this is optional param f" },
];
verify.signatureHelp({ marker: "28", docComment: subtractDoc, tags: subtractTags });
verify.quickInfos({
"28q": [
"function subtract(a: number, b: number, c?: () => string, d?: () => string, e?: () => string, f?: () => string): void",
@@ -346,34 +349,31 @@ verify.quickInfos({
"28aq": "(parameter) a: number"
});
goTo.marker('29');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is about b");
verify.signatureHelp({ marker: "29", docComment: subtractDoc, tags: subtractTags, parameterDocComment: "this is about b" });
verify.quickInfoAt("29aq", "(parameter) b: number", "this is about b");
goTo.marker('30');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param c");
verify.signatureHelp({ marker: "30", docComment: subtractDoc, tags: subtractTags, parameterDocComment: "this is optional param c" });
verify.quickInfoAt("30aq", "(parameter) c: () => string", "this is optional param c");
goTo.marker('31');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param d");
verify.signatureHelp({ marker: "31", docComment: subtractDoc, tags: subtractTags, parameterDocComment: "this is optional param d" });
verify.quickInfoAt("31aq", "(parameter) d: () => string", "this is optional param d");
goTo.marker('32');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("this is optional param e");
verify.signatureHelp({ marker: "32", docComment: subtractDoc, tags: subtractTags, parameterDocComment: "this is optional param e" });
verify.quickInfoAt("32aq", "(parameter) e: () => string", "this is optional param e");
goTo.marker('33');
verify.currentSignatureHelpDocCommentIs(subtractDoc);
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "33", docComment: subtractDoc, tags: subtractTags });
verify.quickInfoAt("33aq", "(parameter) f: () => string");
goTo.marker('34');
verify.currentSignatureHelpDocCommentIs("this is square function");
verify.currentParameterHelpArgumentDocCommentIs("this is input number");
verify.signatureHelp({
marker: "34",
docComment: "this is square function",
parameterDocComment: "this is input number",
tags: [
{ name: "paramTag", text: "{ number } a this is input number of paramTag" },
{ name: "param", text: "a this is input number" },
{ name: "returnType", text: "{ number } it is return type" },
],
});
verify.quickInfos({
"34q": [
"function square(a: number): number",
@@ -385,9 +385,12 @@ verify.quickInfos({
]
});
goTo.marker('35');
verify.currentSignatureHelpDocCommentIs("this is divide function");
verify.currentParameterHelpArgumentDocCommentIs("this is a");
const divideTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "a this is a" },
{ name: "paramTag", text: "{ number } g this is optional param g" },
{ name: "param", text: "b this is b" },
];
verify.signatureHelp({ marker: "35", docComment: "this is divide function", parameterDocComment: "this is a", tags: divideTags });
verify.quickInfos({
"35q": [
"function divide(a: number, b: number): void",
@@ -399,22 +402,21 @@ verify.quickInfos({
]
});
goTo.marker('36');
verify.currentSignatureHelpDocCommentIs("this is divide function");
verify.currentParameterHelpArgumentDocCommentIs("this is b");
verify.signatureHelp({ marker: "36", docComment: "this is divide function", parameterDocComment: "this is b", tags: divideTags });
verify.quickInfoAt("36aq", "(parameter) b: number", "this is b");
goTo.marker('37');
verify.currentSignatureHelpDocCommentIs("Function returns string concat of foo and bar");
verify.currentParameterHelpArgumentDocCommentIs("is string");
const concatDoc = "Function returns string concat of foo and bar";
const concatTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "foo is string" },
{ name: "param", text: "bar is second string" },
];
verify.signatureHelp({ marker: "37", docComment: concatDoc, parameterDocComment: "is string", tags: concatTags });
verify.quickInfos({
"37q": ["function fooBar(foo: string, bar: string): string", "Function returns string concat of foo and bar"],
"37q": ["function fooBar(foo: string, bar: string): string", concatDoc],
"37aq": ["(parameter) foo: string", "is string"]
});
goTo.marker('38');
verify.currentSignatureHelpDocCommentIs("Function returns string concat of foo and bar");
verify.currentParameterHelpArgumentDocCommentIs("is second string");
verify.signatureHelp({ marker: "38", docComment: concatDoc, parameterDocComment: "is second string", tags: concatTags });
verify.quickInfoAt("38aq", "(parameter) bar: string", "is second string");
goTo.marker('39');
@@ -423,13 +425,16 @@ verify.completionListContains("b", "(parameter) b: number", "this is inline comm
verify.completionListContains("c", "(parameter) c: number", "it is third parameter");
verify.completionListContains("d", "(parameter) d: number", "");
goTo.marker('40');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("it is first parameter\nthis is inline comment for a ");
const jsdocTestDocComment = "this is jsdoc style function with param tag as well as inline parameter help";
const jsdocTestTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "a it is first parameter" },
{ name: "param", text: "c it is third parameter" },
];
verify.signatureHelp({ marker: "40", docComment: jsdocTestDocComment, parameterDocComment: "it is first parameter\nthis is inline comment for a ", tags: jsdocTestTags });
verify.quickInfos({
"40q": [
"function jsDocParamTest(a: number, b: number, c: number, d: number): number",
"this is jsdoc style function with param tag as well as inline parameter help"
jsdocTestDocComment
],
"40aq": [
"(parameter) a: number",
@@ -437,41 +442,42 @@ verify.quickInfos({
]
});
goTo.marker('41');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("this is inline comment for b");
verify.signatureHelp({ marker: "41", docComment: jsdocTestDocComment, parameterDocComment: "this is inline comment for b", tags: jsdocTestTags });
verify.quickInfoAt("41aq", "(parameter) b: number", "this is inline comment for b");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("it is third parameter");
verify.signatureHelp({ marker: "42", docComment: jsdocTestDocComment, parameterDocComment: "it is third parameter", tags: jsdocTestTags });
verify.quickInfoAt("42aq", "(parameter) c: number", "it is third parameter");
goTo.marker('43');
verify.currentSignatureHelpDocCommentIs("this is jsdoc style function with param tag as well as inline parameter help");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "43", docComment: jsdocTestDocComment, tags: jsdocTestTags });
verify.quickInfoAt("43aq", "(parameter) d: number");
goTo.marker('44');
verify.completionListContains("jsDocParamTest", "function jsDocParamTest(a: number, b: number, c: number, d: number): number", "this is jsdoc style function with param tag as well as inline parameter help");
verify.completionListContains("jsDocParamTest", "function jsDocParamTest(a: number, b: number, c: number, d: number): number", jsdocTestDocComment);
verify.completionListContains("x", "var x: any", "This is a comment ");
verify.completionListContains("y", "var y: any", "This is a comment");
goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("This is function comment\nAnd properly aligned comment");
verify.signatureHelp({ marker: "45", docComment: "This is function comment\nAnd properly aligned comment" });
verify.quickInfoAt("45q", "function jsDocCommentAlignmentTest1(): void", "This is function comment\nAnd properly aligned comment");
goTo.marker('46');
verify.currentSignatureHelpDocCommentIs("This is function comment\n And aligned with 4 space char margin");
verify.quickInfoAt("46q", "function jsDocCommentAlignmentTest2(): void", "This is function comment\n And aligned with 4 space char margin");
const alignmentDocComment = "This is function comment\n And aligned with 4 space char margin";
verify.signatureHelp({ marker: "46", docComment: alignmentDocComment });
verify.quickInfoAt("46q", "function jsDocCommentAlignmentTest2(): void", alignmentDocComment);
goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("This is function comment\n And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about a\nspanning on two lines and aligned perfectly");
const alignmentTags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "a this is info about a\nspanning on two lines and aligned perfectly" },
{ name: "param", text: "b this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin" },
{ name: "param", text: "c this is info about b\nnot aligned text about parameter will eat only one space" },
];
verify.signatureHelp({
marker: "47",
docComment: alignmentDocComment,
parameterDocComment: "this is info about a\nspanning on two lines and aligned perfectly",
tags: alignmentTags,
});
verify.quickInfos({
"47q": [
"function jsDocCommentAlignmentTest3(a: string, b: any, c: any): void",
"This is function comment\n And aligned with 4 space char margin"
alignmentDocComment
],
"47aq": [
"(parameter) a: string",
@@ -479,14 +485,20 @@ verify.quickInfos({
]
});
goTo.marker('48');
verify.currentSignatureHelpDocCommentIs("This is function comment\n And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin");
verify.signatureHelp({
marker: "48",
docComment: alignmentDocComment,
parameterDocComment: "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin",
tags: alignmentTags,
});
verify.quickInfoAt("48aq", "(parameter) b: any", "this is info about b\nspanning on two lines and aligned perfectly\nspanning one more line alined perfectly\n spanning another line with more margin");
goTo.marker('49');
verify.currentSignatureHelpDocCommentIs("This is function comment\n And aligned with 4 space char margin");
verify.currentParameterHelpArgumentDocCommentIs("this is info about b\nnot aligned text about parameter will eat only one space");
verify.signatureHelp({
marker: "49",
docComment: alignmentDocComment,
parameterDocComment: "this is info about b\nnot aligned text about parameter will eat only one space",
tags: alignmentTags,
});
verify.quickInfos({
"49aq": [
"(parameter) c: any",

View File

@@ -38,8 +38,7 @@ goTo.marker('2');
verify.completionListContains("b", "var b: number", "b's comment");
verify.completionListContains("foo", "function foo(): number", "foo's comment");
goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("foo's comment");
verify.signatureHelp({ marker: "3", docComment: "foo's comment" });
verify.quickInfoAt("3q", "function foo(): number", "foo's comment");
goTo.marker('4');
@@ -50,8 +49,7 @@ verify.completionListContains("b", "var m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace m1.m2");
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("exported function");
verify.signatureHelp({ marker: "6", docComment: "exported function" });
verify.quickInfoAt("6q", "function m1.fooExport(): number", "exported function");
verify.quickInfoAt("7", "var myvar: m1.m2.c");
@@ -74,8 +72,7 @@ verify.completionListContains("b", "var extMod.m1.b: number", "b's comment");
verify.completionListContains("fooExport", "function extMod.m1.fooExport(): number", "exported function");
verify.completionListContains("m2", "namespace extMod.m1.m2");
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("exported function");
verify.signatureHelp({ marker: "13", docComment: "exported function" });
verify.quickInfoAt("13q", "function extMod.m1.fooExport(): number", "exported function");
verify.quickInfoAt("14", "var newVar: extMod.m1.m2.c");

View File

@@ -27,8 +27,7 @@ verify.quickInfoAt("2", "function foo(): void", "This comment should appear for
goTo.marker('3');
verify.completionListContains('foo', 'function foo(): void', 'This comment should appear for foo');
goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("This comment should appear for foo");
verify.signatureHelp({ marker: "4", docComment: "This comment should appear for foo" });
verify.quickInfoAt("5", "function fooWithParameters(a: string, b: number): void", "This is comment for function signature");
@@ -43,14 +42,13 @@ verify.quickInfoAt("8", "function fooWithParameters(a: string, b: number): void"
goTo.marker('9');
verify.completionListContains('fooWithParameters', 'function fooWithParameters(a: string, b: number): void', 'This is comment for function signature');
goTo.marker('10');
verify.currentSignatureHelpDocCommentIs("This is comment for function signature");
verify.currentParameterHelpArgumentDocCommentIs("this is comment about a");
goTo.marker('11');
verify.currentSignatureHelpDocCommentIs("This is comment for function signature");
verify.currentParameterHelpArgumentDocCommentIs("this is comment for b");
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("Does something");
verify.currentParameterHelpArgumentDocCommentIs("a string");
verify.signatureHelp(
{ marker: "10", docComment: "This is comment for function signature", parameterDocComment: "this is comment about a" },
{ marker: "11", docComment: "This is comment for function signature", parameterDocComment: "this is comment for b" },
{
marker: "12",
docComment: "Does something",
parameterDocComment: "a string",
tags: [{ name: "param", text: "a a string" }],
},
);

View File

@@ -1,7 +1,7 @@
/// <reference path='fourslash.ts' />
// test arrow doc comments
/////** lamdaFoo var comment*/
/////** lambdaFoo var comment*/
////var lamb/*1*/daFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => /*2*/a + b;
////var lambddaN/*3*/oVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b;
/////*4*/lambdaFoo(/*5*/10, /*6*/20);
@@ -32,9 +32,7 @@
////}
////assig/*16*/ned/*17*/(/*18*/"hey");
verify.quickInfoAt("1", "var lambdaFoo: (a: number, b: number) => number", "lamdaFoo var comment\nthis is lambda comment");
verify.quickInfoAt("1", "var lambdaFoo: (a: number, b: number) => number", "lambdaFoo var comment\nthis is lambda comment");
goTo.marker('2');
verify.completionListContains('a', '(parameter) a: number', 'param a');
@@ -44,17 +42,21 @@ verify.completionListContains('b', '(parameter) b: number', 'param b');
verify.quickInfoAt("3", "var lambddaNoVarComment: (a: number, b: number) => number", "this is lambda multiplication");
goTo.marker('4');
verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', 'lamdaFoo var comment\nthis is lambda comment');
verify.completionListContains('lambdaFoo', 'var lambdaFoo: (a: number, b: number) => number', 'lambdaFoo var comment\nthis is lambda comment');
verify.completionListContains('lambddaNoVarComment', 'var lambddaNoVarComment: (a: number, b: number) => number', 'this is lambda multiplication');
goTo.marker('5');
verify.currentParameterHelpArgumentDocCommentIs("param a");
goTo.marker('6');
verify.currentParameterHelpArgumentDocCommentIs("param b");
verify.signatureHelp(
{
marker: "5",
docComment: "lambdaFoo var comment\nthis is lambda comment",
parameterDocComment: "param a",
},
{
marker: "6",
docComment: "lambdaFoo var comment\nthis is lambda comment",
parameterDocComment: "param b",
},
);
// no documentation from nested lambda
verify.quickInfos({
@@ -76,7 +78,14 @@ verify.completionListContains('s', '(parameter) s: string', "the first parameter
verify.quickInfoAt("16", "var assigned: (s: string) => number", "On variable\nSummary on expression");
goTo.marker('17');
verify.completionListContains("assigned", "var assigned: (s: string) => number", "On variable\nSummary on expression");
goTo.marker('18');
verify.currentSignatureHelpDocCommentIs("On variable\nSummary on expression");
verify.currentParameterHelpArgumentDocCommentIs("the first parameter!\nparam on expression\nOn parameter ");
verify.signatureHelp({
marker: "18",
docComment: "On variable\nSummary on expression",
parameterDocComment: "the first parameter!\nparam on expression\nOn parameter ",
tags: [
{ name: "param", text: "s the first parameter!" },
{ name: "returns", text: "the parameter's length" },
{ name: "param", text: "s param on expression" },
{ name: "returns", text: "return on expression" },
],
});

View File

@@ -40,8 +40,7 @@ verify.completions({
]
})
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("exported function");
verify.signatureHelp({ marker: "8", docComment: "exported function" });
verify.quickInfos({
"8q": ["function extMod.m1.fooExport(): number", "exported function"],
9: "var newVar: extMod.m1.m2.c"

View File

@@ -233,22 +233,10 @@ verify.completionListContains("l1", "(property) i1.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
goTo.marker('2');
verify.currentSignatureHelpDocCommentIs("i1_f1");
goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('5');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l2');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l3');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l4');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l5');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "2", docComment: "i1_f1" },
{ marker: ["3", "4", "5", "l2", "l3", "l4", "l5"], docComment: "" },
);
verify.quickInfos({
"1iq": "var i1_i: i1",
@@ -275,22 +263,14 @@ verify.completionListContains("l1", "(property) c1.l1: () => void", "c1_l1");
verify.completionListContains("nc_p1", "(property) c1.nc_p1: number", "c1_nc_p1");
verify.completionListContains("nc_f1", "(method) c1.nc_f1(): void", "c1_nc_f1");
verify.completionListContains("nc_l1", "(property) c1.nc_l1: () => void", "c1_nc_l1");
goTo.marker('7');
verify.currentSignatureHelpDocCommentIs("i1_f1");
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('9');
verify.currentSignatureHelpDocCommentIs("c1_f1");
goTo.marker('10');
verify.currentSignatureHelpDocCommentIs("c1_nc_f1");
goTo.marker('l7');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l8');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l9');
verify.currentSignatureHelpDocCommentIs("c1_l1");
goTo.marker('l10');
verify.currentSignatureHelpDocCommentIs("c1_nc_l1");
verify.signatureHelp(
{ marker: "7", docComment: "i1_f1" },
{ marker: "9", docComment: "c1_f1" },
{ marker: "10", docComment: "c1_nc_f1" },
{ marker: "l9", docComment: "c1_l1" },
{ marker: "l10", docComment: "c1_nc_l1" },
{ marker: ["8", "l7", "l8"], docComment: "" },
);
verify.quickInfos({
"6iq": "var c1_i: c1",
@@ -317,22 +297,10 @@ verify.completionListContains("l1", "(property) i1.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i1.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i1.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i1.nc_l1: () => void", "");
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("i1_f1");
goTo.marker('13');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('14');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('15');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l12');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l13');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l14');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l15');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "12", docComment: "i1_f1" },
{ marker: ["13", "14", "15", "l12", "l13", "l14", "l15"], docComment: "" },
);
verify.quickInfos({
"12q": ["(method) i1.i1_f1(): void", "i1_f1"],
@@ -359,11 +327,10 @@ verify.quickInfos({
"18iq": "var c3_i: c3"
});
goTo.marker('17');
verify.currentSignatureHelpDocCommentIs("c2 constructor");
goTo.marker('18');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "17", docComment: "c2 constructor" },
{ marker: "18", docComment: "" },
);
verify.quickInfos({
"18sq": ["constructor c2(a: number): c2", "c2 constructor"],
@@ -388,14 +355,11 @@ verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", "");
goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('21');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('22');
verify.currentSignatureHelpDocCommentIs("c2 f1");
goTo.marker('23');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "20", docComment: "c2 c2_f1" },
{ marker: "22", docComment: "c2 f1" },
{ marker: ["21", "23"], docComment: "" },
);
verify.quickInfos({
"20q": ["(method) c2.c2_f1(): void", "c2 c2_f1"],
@@ -417,14 +381,11 @@ verify.completionListContains("prop", "(property) c3.prop: number", "c3 prop");
verify.completionListContains("nc_p1", "(property) c3.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c3.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c3.nc_prop: number", "");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('26');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('27');
verify.currentSignatureHelpDocCommentIs("c3 f1");
goTo.marker('28');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "25", docComment: "c2 c2_f1" },
{ marker: "27", docComment: "c3 f1" },
{ marker: ["26", "28"], docComment: "" },
);
verify.quickInfos({
"25q": ["(method) c2.c2_f1(): void", "c2 c2_f1"],
@@ -446,14 +407,11 @@ verify.completionListContains("prop", "(property) c2.prop: number", "c2 prop");
verify.completionListContains("nc_p1", "(property) c2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) c2.nc_f1(): void", "");
verify.completionListContains("nc_prop", "(property) c2.nc_prop: number", "");
goTo.marker('30');
verify.currentSignatureHelpDocCommentIs("c2 c2_f1");
goTo.marker('31');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('32');
verify.currentSignatureHelpDocCommentIs("c2 f1");
goTo.marker('33');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "30", docComment: "c2 c2_f1" },
{ marker: "32", docComment: "c2 f1" },
{ marker: ["31", "33"], docComment: "" },
);
verify.quickInfos({
"30q": ["(method) c2.c2_f1(): void", "c2 c2_f1"],
@@ -462,8 +420,7 @@ verify.quickInfos({
"33q": "(method) c2.nc_f1(): void"
});
goTo.marker('34');
verify.currentSignatureHelpDocCommentIs("c2 constructor");
verify.signatureHelp({ marker: "34", docComment: "c2 constructor" });
verify.quickInfos({
"34iq": "var c4_i: c4",
"34q": ["constructor c4(a: number): c4", "c2 constructor"]
@@ -490,22 +447,11 @@ verify.completionListContains("l1", "(property) i2.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
goTo.marker('37');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('38');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('39');
verify.currentSignatureHelpDocCommentIs("i2 f1");
goTo.marker('40');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l37');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l38');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l39');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l40');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "37", docComment: "i2_f1" },
{ marker: "39", docComment: "i2 f1" },
{ marker: ["38", "40", "l37", "l37", "l39", "l40"], docComment: "" },
);
verify.quickInfos({
"36iq": "var i2_i: i2",
@@ -533,22 +479,11 @@ verify.completionListContains("l1", "(property) i3.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i3.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i3.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i3.nc_l1: () => void", "");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('43');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('44');
verify.currentSignatureHelpDocCommentIs("i3 f1");
goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l42');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l43');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l44');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l45');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "42", docComment: "i2_f1" },
{ marker: "44", docComment: "i3 f1" },
{ marker: ["43", "45", "l42", "l43", "l44", "l45"], docComment: "" },
);
verify.quickInfos({
"42q": ["(method) i2.i2_f1(): void", "i2_f1"],
@@ -574,22 +509,11 @@ verify.completionListContains("l1", "(property) i2.l1: () => void", "");
verify.completionListContains("nc_p1", "(property) i2.nc_p1: number", "");
verify.completionListContains("nc_f1", "(method) i2.nc_f1(): void", "");
verify.completionListContains("nc_l1", "(property) i2.nc_l1: () => void", "");
goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("i2_f1");
goTo.marker('48');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('49');
verify.currentSignatureHelpDocCommentIs("i2 f1");
goTo.marker('50');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l47');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l48');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l49');
verify.currentSignatureHelpDocCommentIs("");
goTo.marker('l50');
verify.currentSignatureHelpDocCommentIs("");
verify.signatureHelp(
{ marker: "47", docComment: "i2_f1" },
{ marker: "49", docComment: "i2 f1" },
{ marker: ["48", "l47", "l48", "l49", "l50"], docComment: "" },
);
verify.quickInfos({
"47q": ["(method) i2.i2_f1(): void", "i2_f1"],

View File

@@ -93,9 +93,7 @@ verify.quickInfos({
11: "var i2_i_foo_r: string"
});
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("param help");
verify.signatureHelp({ marker: "12", docComment: "", parameterDocComment: "param help" });
verify.quickInfos({
"12q": "(property) i2.foo: (b: number) => string",
@@ -109,9 +107,7 @@ verify.quickInfos({
15: "var i2_i_n: any"
});
goTo.marker('16');
verify.currentSignatureHelpDocCommentIs("new method");
verify.currentParameterHelpArgumentDocCommentIs("param");
verify.signatureHelp({ marker: "16", docComment: "new method", parameterDocComment: "param" });
verify.quickInfos({
"16q": ["var i2_i: i2\nnew (i: i1) => any", "new method"],
@@ -122,22 +118,16 @@ verify.quickInfos({
21: "var i2_i_nc_foo_r: string"
});
goTo.marker('22');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "22", docComment: "" });
verify.quickInfos({
"22q": "(property) i2.nc_foo: (b: number) => string",
23: "var i2_i_r: number"
});
goTo.marker('24');
verify.currentSignatureHelpDocCommentIs("this is call signature");
verify.currentParameterHelpArgumentDocCommentIs("paramhelp a");
verify.signatureHelp({ marker: "24", docComment: "this is call signature", parameterDocComment: "paramhelp a" });
verify.quickInfoAt("24q", "var i2_i: i2\n(a: number, b: number) => number", "this is call signature");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("this is call signature");
verify.currentParameterHelpArgumentDocCommentIs("paramhelp b");
verify.signatureHelp({ marker: "25", docComment: "this is call signature", parameterDocComment: "paramhelp b" });
verify.quickInfos({
26: "var i2_i_fnfoo: (b: number) => string",
@@ -145,9 +135,7 @@ verify.quickInfos({
28: "var i2_i_fnfoo_r: string"
});
goTo.marker('29');
verify.currentSignatureHelpDocCommentIs("this is fnfoo");
verify.currentParameterHelpArgumentDocCommentIs("param help");
verify.signatureHelp({ marker: "29", docComment: "this is fnfoo", parameterDocComment: "param help" });
verify.quickInfos({
"29q": ["(method) i2.fnfoo(b: number): string", "this is fnfoo"],
@@ -157,9 +145,7 @@ verify.quickInfos({
32: "var i2_i_nc_fnfoo_r: string"
});
goTo.marker('33');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "33", docComment: "" });
verify.quickInfoAt("33q", "(method) i2.nc_fnfoo(b: number): string");
goTo.marker('34');
@@ -206,21 +192,13 @@ verify.completionListContains("nc_f", "(method) i3.nc_f(a: number): string", "")
verify.completionListContains("nc_l", "(property) i3.nc_l: (b: number) => string", "");
verify.completionListContains("nc_x", "(property) i3.nc_x: number", "");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("Function i3 f");
verify.currentParameterHelpArgumentDocCommentIs("number parameter");
verify.signatureHelp({ marker: "42", docComment: "Function i3 f", parameterDocComment: "number parameter" });
goTo.marker('43');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("comment i3 l b");
verify.signatureHelp({ marker: "43", docComment: "", parameterDocComment: "comment i3 l b" });
verify.quickInfoAt("43q", "(property) i3.l: (b: number) => string");
goTo.marker('44');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "44", docComment: "" });
verify.quickInfoAt("44q", "(method) i3.nc_f(a: number): string");
goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "45", docComment: "" });
verify.quickInfoAt("45q", "(property) i3.nc_l: (b: number) => string");

View File

@@ -102,8 +102,7 @@ goTo.marker('2');
verify.completionListContains("b", "var b: number", "b's comment");
verify.completionListContains("foo", "function foo(): number", "foo's comment");
goTo.marker('3');
verify.currentSignatureHelpDocCommentIs("foo's comment");
verify.signatureHelp({ marker: "3", docComment: "foo's comment" });
verify.quickInfoAt("3q", "function foo(): number", "foo's comment");
goTo.marker('4');
@@ -115,8 +114,7 @@ verify.completionListContains("fooExport", "function m1.fooExport(): number", "e
verify.completionListContains("m2", "namespace m1.m2");
verify.quickInfoIs("function m1.fooExport(): number", "exported function");
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("exported function");
verify.signatureHelp({ marker: "6", docComment: "exported function" });
verify.quickInfoAt("7", "var myvar: m1.m2.c");

View File

@@ -233,12 +233,8 @@ verify.quickInfos({
o4q: ["function f1(a: number): number (+1 overload)", "this is signature 1"]
});
goTo.marker('4');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
goTo.marker('o4');
verify.currentSignatureHelpDocCommentIs("this is signature 1");
verify.currentParameterHelpArgumentDocCommentIs("param a");
verify.signatureHelp({ marker: "4", overloadsCount: 2 });
verify.signatureHelp({ marker: "o4", overloadsCount: 2, docComment: "this is signature 1", parameterDocComment: "param a" });
verify.quickInfos({
5: "function f2(a: number): number (+1 overload)",
@@ -248,13 +244,10 @@ verify.quickInfos({
o8q: "function f2(a: number): number (+1 overload)"
});
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("this is signature 2");
verify.currentParameterHelpArgumentDocCommentIs("");
goTo.marker('o8');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("param a");
verify.signatureHelp(
{ marker: "8", overloadsCount: 2, docComment: "this is signature 2" },
{ marker: "o8", overloadsCount: 2, parameterDocComment: "param a" },
);
verify.quickInfos({
9: "function f3(a: number): number (+1 overload)",
@@ -264,13 +257,7 @@ verify.quickInfos({
o12q: "function f3(a: number): number (+1 overload)"
});
goTo.marker('12');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
goTo.marker('o12');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: ["12", "o12"], overloadsCount: 2 });
verify.quickInfos({
13: ["function f4(a: number): number (+1 overload)", "this is signature 4 - with number parameter"],
@@ -280,13 +267,10 @@ verify.quickInfos({
o16q: ["function f4(a: number): number (+1 overload)", "this is signature 4 - with number parameter"]
});
goTo.marker('16');
verify.currentSignatureHelpDocCommentIs("this is signature 4 - with string parameter");
verify.currentParameterHelpArgumentDocCommentIs("");
goTo.marker('o16');
verify.currentSignatureHelpDocCommentIs("this is signature 4 - with number parameter");
verify.currentParameterHelpArgumentDocCommentIs("param a");
verify.signatureHelp(
{ marker: "16", overloadsCount: 2, docComment: "this is signature 4 - with string parameter" },
{ marker: "o16", overloadsCount: 2, docComment: "this is signature 4 - with number parameter", parameterDocComment: "param a" },
);
goTo.marker('17');
verify.completionListContains('f1', 'function f1(a: number): number (+1 overload)', 'this is signature 1');
@@ -304,24 +288,16 @@ verify.completionListContains('i3_i', 'var i3_i: i3\nnew (a: string) => any (+1
verify.not.completionListContains('i4', 'interface i4', '');
verify.completionListContains('i4_i', 'var i4_i: i4\nnew (a: string) => any (+1 overload)', '');
goTo.marker('19');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "19", overloadsCount: 2 });
verify.quickInfoAt("19q", "var i1_i: i1\nnew (b: number) => any (+1 overload)");
goTo.marker('20');
verify.currentSignatureHelpDocCommentIs("new 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "20", overloadsCount: 2, docComment: "new 1" });
verify.quickInfoAt("20q", "var i1_i: i1\nnew (a: string) => any (+1 overload)", "new 1");
goTo.marker('21');
verify.currentSignatureHelpDocCommentIs("this signature 1");
verify.currentParameterHelpArgumentDocCommentIs("param a");
verify.signatureHelp({ marker: "21", overloadsCount: 2, docComment: "this signature 1", parameterDocComment: "param a" });
verify.quickInfoAt("21q", "var i1_i: i1\n(a: number) => number (+1 overload)", "this signature 1");
goTo.marker('22');
verify.currentSignatureHelpDocCommentIs("this is signature 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "22", overloadsCount: 2, docComment: "this is signature 2" });
goTo.marker('22q');
verify.quickInfoAt("22q", "var i1_i: i1\n(b: string) => number (+1 overload)", "this is signature 2");
@@ -331,104 +307,64 @@ verify.completionListContains('foo2', '(method) i1.foo2(a: number): number (+1 o
verify.completionListContains('foo3', '(method) i1.foo3(a: number): number (+1 overload)', '');
verify.completionListContains('foo4', '(method) i1.foo4(a: number): number (+1 overload)', 'foo4 1');
goTo.marker('24');
verify.currentSignatureHelpDocCommentIs("foo 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "24", overloadsCount: 2, docComment: "foo 1" });
verify.quickInfoAt("24q", "(method) i1.foo(a: number): number (+1 overload)", "foo 1");
goTo.marker('25');
verify.currentSignatureHelpDocCommentIs("foo 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "25", overloadsCount: 2, docComment: "foo 2" });
verify.quickInfoAt("25q", "(method) i1.foo(b: string): number (+1 overload)", "foo 2");
goTo.marker('26');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "26", overloadsCount: 2 });
verify.quickInfoAt("26q", "(method) i1.foo2(a: number): number (+1 overload)");
goTo.marker('27');
verify.currentSignatureHelpDocCommentIs("foo2 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "27", overloadsCount: 2, docComment: "foo2 2" });
verify.quickInfoAt("27q", "(method) i1.foo2(b: string): number (+1 overload)", "foo2 2");
goTo.marker('28');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "28", overloadsCount: 2 });
verify.quickInfoAt("28q", "(method) i1.foo3(a: number): number (+1 overload)");
goTo.marker('29');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "29", overloadsCount: 2 });
verify.quickInfoAt("29q", "(method) i1.foo3(b: string): number (+1 overload)");
goTo.marker('30');
verify.currentSignatureHelpDocCommentIs("foo4 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "30", overloadsCount: 2, docComment: "foo4 1" });
verify.quickInfoAt("30q", "(method) i1.foo4(a: number): number (+1 overload)", "foo4 1");
goTo.marker('31');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "31", overloadsCount: 2 });
verify.quickInfoAt("31q", "(method) i1.foo4(b: string): number (+1 overload)");
goTo.marker('32');
verify.currentSignatureHelpDocCommentIs("new 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "32", overloadsCount: 2, docComment: "new 2" });
verify.quickInfoAt("32q", "var i2_i: i2\nnew (b: number) => any (+1 overload)", "new 2");
goTo.marker('33');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "33", overloadsCount: 2 });
verify.quickInfoAt("33q", "var i2_i: i2\nnew (a: string) => any (+1 overload)");
goTo.marker('34');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "34", overloadsCount: 2 });
verify.quickInfoAt("34q", "var i2_i: i2\n(a: number) => number (+1 overload)");
goTo.marker('35');
verify.currentSignatureHelpDocCommentIs("this is signature 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "35", overloadsCount: 2, docComment: "this is signature 2" });
verify.quickInfoAt("35q", "var i2_i: i2\n(b: string) => number (+1 overload)", "this is signature 2");
goTo.marker('36');
verify.currentSignatureHelpDocCommentIs("new 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "36", overloadsCount: 2, docComment: "new 2" });
verify.quickInfoAt("36q", "var i3_i: i3\nnew (b: number) => any (+1 overload)", "new 2");
goTo.marker('37');
verify.currentSignatureHelpDocCommentIs("new 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "37", overloadsCount: 2, docComment: "new 1" });
verify.quickInfoAt("37q", "var i3_i: i3\nnew (a: string) => any (+1 overload)", "new 1");
goTo.marker('38');
verify.currentSignatureHelpDocCommentIs("this is signature 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "38", overloadsCount: 2, docComment: "this is signature 1" });
verify.quickInfoAt("38q", "var i3_i: i3\n(a: number) => number (+1 overload)", "this is signature 1");
goTo.marker('39');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "39", overloadsCount: 2 });
verify.quickInfoAt("39q", "var i3_i: i3\n(b: string) => number (+1 overload)");
goTo.marker('40');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "40", overloadsCount: 2 });
verify.quickInfoAt("40q", "var i4_i: i4\nnew (b: number) => any (+1 overload)");
goTo.marker('41');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "41", overloadsCount: 2 });
verify.quickInfoAt("41q", "var i4_i: i4\nnew (a: string) => any (+1 overload)");
goTo.marker('42');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "42", overloadsCount: 2 });
verify.quickInfoAt("42q", "var i4_i: i4\n(a: number) => number (+1 overload)");
goTo.marker('43');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "43", overloadsCount: 2 });
verify.quickInfoAt("43q", "var i4_i: i4\n(b: string) => number (+1 overload)");
goTo.marker('44');
@@ -438,104 +374,64 @@ verify.completionListContains('prop3', '(method) c.prop3(a: number): number (+1
verify.completionListContains('prop4', '(method) c.prop4(a: number): number (+1 overload)', 'prop4 1');
verify.completionListContains('prop5', '(method) c.prop5(a: number): number (+1 overload)', 'prop5 1');
goTo.marker('45');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "45", overloadsCount: 2 });
verify.quickInfoAt("45q", "(method) c.prop1(a: number): number (+1 overload)");
goTo.marker('46');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "46", overloadsCount: 2 });
verify.quickInfoAt("46q", "(method) c.prop1(b: string): number (+1 overload)");
goTo.marker('47');
verify.currentSignatureHelpDocCommentIs("prop2 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "47", overloadsCount: 2, docComment: "prop2 1" });
verify.quickInfoAt("47q", "(method) c.prop2(a: number): number (+1 overload)", "prop2 1");
goTo.marker('48');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "48", overloadsCount: 2 });
verify.quickInfoAt("48q", "(method) c.prop2(b: string): number (+1 overload)");
goTo.marker('49');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "49", overloadsCount: 2 });
verify.quickInfoAt("49q", "(method) c.prop3(a: number): number (+1 overload)");
goTo.marker('50');
verify.currentSignatureHelpDocCommentIs("prop3 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "50", overloadsCount: 2, docComment: "prop3 2" });
verify.quickInfoAt("50q", "(method) c.prop3(b: string): number (+1 overload)", "prop3 2");
goTo.marker('51');
verify.currentSignatureHelpDocCommentIs("prop4 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "51", overloadsCount: 2, docComment: "prop4 1" });
verify.quickInfoAt("51q", "(method) c.prop4(a: number): number (+1 overload)", "prop4 1");
goTo.marker('52');
verify.currentSignatureHelpDocCommentIs("prop4 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "52", overloadsCount: 2, docComment: "prop4 2" });
verify.quickInfoAt("52q", "(method) c.prop4(b: string): number (+1 overload)", "prop4 2");
goTo.marker('53');
verify.currentSignatureHelpDocCommentIs("prop5 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "53", overloadsCount: 2, docComment: "prop5 1" });
verify.quickInfoAt("53q", "(method) c.prop5(a: number): number (+1 overload)", "prop5 1");
goTo.marker('54');
verify.currentSignatureHelpDocCommentIs("prop5 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "54", overloadsCount: 2, docComment: "prop5 2" });
verify.quickInfoAt("54q", "(method) c.prop5(b: string): number (+1 overload)", "prop5 2");
goTo.marker('55');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "55", overloadsCount: 2 });
verify.quickInfoAt("55q", "constructor c1(a: number): c1 (+1 overload)");
goTo.marker('56');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "56", overloadsCount: 2 });
verify.quickInfoAt("56q", "constructor c1(b: string): c1 (+1 overload)");
goTo.marker('57');
verify.currentSignatureHelpDocCommentIs("c2 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "57", overloadsCount: 2, docComment: "c2 1" });
verify.quickInfoAt("57q", "constructor c2(a: number): c2 (+1 overload)", "c2 1");
goTo.marker('58');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "58", overloadsCount: 2 });
verify.quickInfoAt("58q", "constructor c2(b: string): c2 (+1 overload)");
goTo.marker('59');
verify.currentSignatureHelpDocCommentIs("");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "59", overloadsCount: 2 });
verify.quickInfoAt("59q", "constructor c3(a: number): c3 (+1 overload)");
goTo.marker('60');
verify.currentSignatureHelpDocCommentIs("c3 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "60", overloadsCount: 2, docComment: "c3 2" });
verify.quickInfoAt("60q", "constructor c3(b: string): c3 (+1 overload)", "c3 2");
goTo.marker('61');
verify.currentSignatureHelpDocCommentIs("c4 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "61", overloadsCount: 2, docComment: "c4 1" });
verify.quickInfoAt("61q", "constructor c4(a: number): c4 (+1 overload)", "c4 1");
goTo.marker('62');
verify.currentSignatureHelpDocCommentIs("c4 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "62", overloadsCount: 2, docComment: "c4 2" });
verify.quickInfoAt("62q", "constructor c4(b: string): c4 (+1 overload)", "c4 2");
goTo.marker('63');
verify.currentSignatureHelpDocCommentIs("c5 1");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "63", overloadsCount: 2, docComment: "c5 1" });
verify.quickInfoAt("63q", "constructor c5(a: number): c5 (+1 overload)", "c5 1");
goTo.marker('64');
verify.currentSignatureHelpDocCommentIs("c5 2");
verify.currentParameterHelpArgumentDocCommentIs("");
verify.signatureHelp({ marker: "64", overloadsCount: 2, docComment: "c5 2" });
verify.quickInfoAt("64q", "constructor c5(b: string): c5 (+1 overload)", "c5 2");
goTo.marker('65');

View File

@@ -64,12 +64,10 @@ verify.completions(
},
)
goTo.marker('5');
verify.currentSignatureHelpDocCommentIs("foos comment");
verify.signatureHelp({ marker: "5", docComment: "foos comment" });
verify.quickInfoAt("5q", "function foo(): void", "foos comment");
goTo.marker('6');
verify.currentSignatureHelpDocCommentIs("fooVar comment");
verify.signatureHelp({ marker: "6", docComment: "fooVar comment" });
verify.quickInfoAt("6q", "var fooVar: () => void", "fooVar comment");
verify.completions({
@@ -80,12 +78,10 @@ verify.completions({
],
});
goTo.marker('8');
verify.currentSignatureHelpDocCommentIs("foos comment");
verify.signatureHelp({ marker: "8", docComment: "foos comment" });
verify.quickInfoAt("8q", "function foo(): void", "foos comment");
goTo.marker('9');
verify.currentSignatureHelpDocCommentIs("fooVar comment");
verify.signatureHelp({ marker: "9", docComment: "fooVar comment" });
verify.quickInfos({
"9q": ["var fooVar: () => void", "fooVar comment"],
"9aq": ["var fooVar: () => void", "fooVar comment"]

View File

@@ -53,16 +53,14 @@ verify.completionListContains("test2", "(method) test2(): a1.connectModule", und
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");
verify.signatureHelp(
{ marker: "4", text: "test1(res: any, req: any, next: any): void" },
{ marker: "5", text: "test2(): a1.connectModule" },
);
verify.quickInfoAt("6", "var r1: a1.connectModule", undefined);
goTo.marker('7');
verify.currentSignatureHelpIs("a(): a1.connectExport");
verify.signatureHelp({ marker: "7", text: "a(): a1.connectExport" });
verify.quickInfoAt("8", "var r2: a1.connectExport", undefined);
@@ -73,16 +71,14 @@ verify.completionListContains("test2", "(method) test2(): a1.connectModule", und
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");
verify.signatureHelp(
{ marker: "10", text: "test1(res: any, req: any, next: any): void" },
{ marker: "11", text: "test2(): a1.connectModule" },
);
verify.quickInfoAt("12", "var r3: a1.connectModule", undefined);
goTo.marker('13');
verify.currentSignatureHelpIs("a1(): a1.connectExport");
verify.signatureHelp({ marker: "13", text: "a1(): a1.connectExport" });
verify.quickInfoAt("14", "var r4: a1.connectExport", undefined);

View File

@@ -169,7 +169,6 @@ declare namespace FourSlashInterface {
completionListContainsClassElementKeywords(): void;
completionListContainsConstructorParameterKeywords(): void;
completionListAllowsNewIdentifier(): void;
signatureHelpPresent(): void;
errorExistsBetweenMarkers(startMarker: string, endMarker: string): void;
errorExistsAfterMarker(markerName?: string): void;
errorExistsBeforeMarker(markerName?: string): void;
@@ -263,17 +262,8 @@ declare namespace FourSlashInterface {
rangesWithSameTextAreRenameLocations(): void;
rangesAreRenameLocations(options?: Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges?: Range[] });
findReferencesDefinitionDisplayPartsAtCaretAre(expected: ts.SymbolDisplayPart[]): void;
currentParameterHelpArgumentNameIs(name: string): void;
currentParameterSpanIs(parameter: string): void;
currentParameterHelpArgumentDocCommentIs(docComment: string): void;
currentSignatureHelpDocCommentIs(docComment: string): void;
currentSignatureHelpTagsAre(tags: ts.JSDocTagInfo[]): void;
signatureHelpCountIs(expected: number): void;
signatureHelpArgumentCountIs(expected: number): void;
signatureHelpCurrentArgumentListIsVariadic(expected: boolean);
currentSignatureParameterCountIs(expected: number): void;
currentSignatureTypeParameterCountIs(expected: number): void;
currentSignatureHelpIs(expected: string): void;
noSignatureHelp(...markers: string[]): void;
signatureHelp(...options: VerifySignatureHelpOptions[]): void;
// Checks that there are no compile errors.
noErrors(): void;
numberOfErrorsInCurrentFile(expected: number): void;
@@ -555,6 +545,27 @@ declare namespace FourSlashInterface {
readonly sourceDisplay?: string,
};
interface VerifySignatureHelpOptions {
marker?: ArrayOrSingle<string>;
/** @default 1 */
overloadsCount?: number;
docComment?: string;
text?: string;
name?: string;
parameterName?: string;
parameterSpan?: string;
parameterDocComment?: string;
parameterCount?: number;
argumentCount?: number;
isVariadic?: boolean;
tags?: ReadonlyArray<JSDocTagInfo>;
}
interface JSDocTagInfo {
name: string;
text: string | undefined;
}
type ArrayOrSingle<T> = T | ReadonlyArray<T>;
}
declare function verifyOperationIsCancelled(f: any): void;

View File

@@ -11,5 +11,4 @@
////var i = new C1;
////i.attr(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(3);
verify.signatureHelp({ marker: "1", overloadsCount: 3 });

View File

@@ -21,14 +21,7 @@
////b./*quickInfoB*/x;
////c./*quickInfoC*/x;
goTo.marker('signatureA');
verify.currentSignatureHelpIs('x(a: number): void');
goTo.marker('signatureB');
verify.currentSignatureHelpIs('x(a: number): void');
goTo.marker('signatureC');
verify.currentSignatureHelpIs('x(a: number): void');
verify.signatureHelp({ marker: ["signatureA", "signatureB", "signatureC"], text: "x(a: number): void" });
goTo.marker('completionA');
verify.completionListContains("x", "(method) x(a: number): void");

View File

@@ -8,12 +8,11 @@
////var /*2*/r = foo(/*1*/1, "");
////var /*4*/r2 = r(/*3*/"");
// goTo.marker('1');
// verify.currentSignatureHelpIs('foo(x: number, y: string): (a: string) => number');
// TODO: GH##23631
// verify.signatureHelp({ marker: "1", text: "foo(x: number, y: string): (a: string) => number" });
verify.quickInfoAt("2", "var r: (a: string) => number");
goTo.marker('3');
verify.currentSignatureHelpIs('r(a: string): number');
verify.signatureHelp({ marker: "3", text: "r(a: string): number" });
verify.quickInfoAt("4", "var r2: number");

View File

@@ -11,12 +11,10 @@
////var /*2*/r = x.foo(/*1*/3);
////var /*4*/r2 = r(/*3*/4);
goTo.marker('1');
verify.currentSignatureHelpIs('foo(x: number): (a: number) => number');
verify.signatureHelp({ marker: "1", text: "foo(x: number): (a: number) => number" });
verify.quickInfoAt("2", "var r: (a: number) => number");
goTo.marker('3');
verify.currentSignatureHelpIs('r(a: number): number');
verify.signatureHelp({ marker: "3", text: "r(a: number): number" });
verify.quickInfoAt("4", "var r2: number");

View File

@@ -3,5 +3,4 @@
////function f<T>(a: T): T { return null; }
////f(/**/
goTo.marker();
verify.currentSignatureHelpIs('f(a: {}): {}');
verify.signatureHelp({ marker: "", text: "f(a: {}): {}" });

View File

@@ -3,5 +3,4 @@
////var f = <T>(a: T) => a;
////f(/**/
goTo.marker();
verify.currentSignatureHelpIs('f(a: {}): {}');
verify.signatureHelp({ marker: "", text: "f(a: {}): {}" });

View File

@@ -16,24 +16,19 @@
////foo6(1, </*6*/ // signature help shows y as {}
////foo7(1, <string>(/*7*/ // signature help shows y as T
goTo.marker('1');
verify.currentSignatureHelpIs('foo1<T>(x: number, callback: (y1: T) => number): void');
// goTo.marker('2');
// verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void');
goTo.marker('3');
verify.currentSignatureHelpIs('foo3<T>(x: number, callback: (y3: T) => number): void');
// goTo.marker('4');
// verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void');
goTo.marker('5');
verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: string) => number): void');
verify.signatureHelp(
{ marker: "1", text: "foo1<T>(x: number, callback: (y1: T) => number): void" },
// TODO: GH#23631
// { marker: "2", text: "foo2(x: number, callback: (y2: {}) => number): void" },
{ marker: "3", text: "foo3<T>(x: number, callback: (y3: T) => number): void" },
// TODO: GH#23631
// { marker: "4", text: "foo4(x: number, callback: (y4: string) => number): void" },
{ marker: "5", text: "foo5(x: number, callback: (y5: string) => number): void" },
);
goTo.marker('6');
// verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void');
// TODO: GH#23631
// verify.signatureHelp({ text: "foo6(x: number, callback: (y6: {}) => number): void" });
edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests
goTo.marker('7');
verify.currentSignatureHelpIs('foo7<T>(x: number, callback: (y7: T) => number): void');
verify.signatureHelp({ marker: "7", text: "foo7<T>(x: number, callback: (y7: T) => number): void" });

View File

@@ -23,24 +23,16 @@
////foo6(1, </*6*/ // signature help shows y as {}
////foo7(1, <string>(/*7*/ // signature help shows y as T
goTo.marker('1');
verify.currentSignatureHelpIs('foo1<T>(x: number, callback: (y1: T) => number): void');
// goTo.marker('2');
// verify.currentSignatureHelpIs('foo2(x: number, callback: (y2: {}) => number): void');
goTo.marker('3');
verify.currentSignatureHelpIs('foo3<T>(x: number, callback: (y3: T) => number): void');
// goTo.marker('4');
// verify.currentSignatureHelpIs('foo4(x: number, callback: (y4: string) => number): void');
goTo.marker('5');
verify.currentSignatureHelpIs('foo5(x: number, callback: (y5: string) => number): void');
verify.signatureHelp(
{ marker: "1", text: "foo1<T>(x: number, callback: (y1: T) => number): void" },
{ marker: "2", text: "foo2<T>(x: number, callback: (y2: T) => number): void" },
{ marker: "3", text: "foo3<T>(x: number, callback: (y3: T) => number): void" },
{ marker: "4", text: "foo4(x: number, callback: (y4: string) => number): void" },
{ marker: "5", text: "foo5(x: number, callback: (y5: string) => number): void" },
);
goTo.marker('6');
// verify.currentSignatureHelpIs('foo6(x: number, callback: (y6: {}) => number): void');
verify.signatureHelp({ text: "foo6(x: number, callback: (y6: {}) => number): void" });
edit.insert('string>(null,null);'); // need to make this line parse so we can get reasonable LS answers to later tests
goTo.marker('7');
verify.currentSignatureHelpIs('foo7<T>(x: number, callback: (y7: T) => number): void');
verify.signatureHelp({ marker: "7", text: "foo7<T>(x: number, callback: (y7: T) => number): void" })

View File

@@ -13,25 +13,19 @@
////testFunction<any, any,/*4*/ any>(null, null, null);
////testFunction<, ,/*5*/>(null, null, null);
// goTo.marker("1");
// verify.currentSignatureParameterCountIs(3);
// verify.currentSignatureHelpIs("testFunction<T extends IFoo, U, M extends IFoo>(a: T, b: U, c: M): M");
// verify.currentParameterHelpArgumentNameIs("T");
// verify.currentParameterSpanIs("T extends IFoo");
// goTo.marker("2");
// verify.currentParameterHelpArgumentNameIs("U");
// verify.currentParameterSpanIs("U");
goTo.marker("3");
verify.currentParameterHelpArgumentNameIs("a");
verify.currentParameterSpanIs("a: any");
goTo.marker("4");
verify.currentParameterHelpArgumentNameIs("M");
verify.currentParameterSpanIs("M extends IFoo");
goTo.marker("5");
verify.currentParameterHelpArgumentNameIs("M");
verify.currentParameterSpanIs("M extends IFoo");
verify.signatureHelp(
// TODO: GH#23631
/*
{
marker: "1",
text: "testFunction<T extends IFoo, U, M extends IFoo>(a: T, b: U, c: M): M",
parameterCount: 3,
parameterName: "T",
parameterSpan: "T extends IFoo",
},
{ marker: "2", parameterName: "U", parameterSpan: "U" },
*/
{ marker: "3", parameterName: "a", parameterSpan: "a: any" },
{ marker: "4", parameterName: "M", parameterSpan: "M extends IFoo" },
{ marker: "5", parameterName: "M", parameterSpan: "M extends IFoo" },
);

View File

@@ -7,29 +7,28 @@
////}
////
////// Constructor calls
////new testClass</*construcor1*/
////new testClass<IFoo, /*construcor2*/
////new testClass</*construcor3*/>(null, null, null)
////new testClass<,,/*construcor4*/>(null, null, null)
////new testClass<IFoo,/*construcor5*/IFoo,IFoo>(null, null, null)
////new testClass</*constructor1*/
////new testClass<IFoo, /*constructor2*/
////new testClass</*constructor3*/>(null, null, null)
////new testClass<,,/*constructor4*/>(null, null, null)
////new testClass<IFoo,/*constructor5*/IFoo,IFoo>(null, null, null)
// goTo.marker("construcor1");
// verify.currentSignatureHelpIs("testClass<T extends IFoo, U, M extends IFoo>(a: T, b: U, c: M): testClass<T, U, M>");
// verify.currentParameterHelpArgumentNameIs("T");
// verify.currentParameterSpanIs("T extends IFoo");
// goTo.marker("construcor2");
// verify.currentParameterHelpArgumentNameIs("U");
// verify.currentParameterSpanIs("U");
goTo.marker("construcor3");
verify.currentParameterHelpArgumentNameIs("T");
verify.currentParameterSpanIs("T extends IFoo");
goTo.marker("construcor4");
verify.currentParameterHelpArgumentNameIs("M");
verify.currentParameterSpanIs("M extends IFoo");
goTo.marker("construcor5");
verify.currentParameterHelpArgumentNameIs("U");
verify.currentParameterSpanIs("U");
verify.signatureHelp(
// TODO: GH#23631
/*
{
marker: "constructor1",
text: "testClass<T extends IFoo, U, M extends IFoo>(a: T, b: U, c: M): testClass<T, U, M>",
parameterName: "T",
parameterSpan: "T extends IFoo",
},
{
marker: "constructor2",
parameterName: "U",
parameterSpan: "U",
},
*/
{ marker: "constructor3", parameterName: "T", parameterSpan: "T extends IFoo" },
{ marker: "constructor4", parameterName: "M", parameterSpan: "M extends IFoo" },
{ marker: "constructor5", parameterName: "U", parameterSpan: "U" },
);

View File

@@ -12,23 +12,20 @@
////class Bar<T> extends testClass</*type3*/
////var x : testClass<,, /*type4*/any>;
// goTo.marker("type1");
// verify.signatureHelpCountIs(1);
// verify.currentSignatureHelpIs("testClass<T extends IFoo, U, M extends IFoo>");
// verify.currentParameterHelpArgumentNameIs("T");
// verify.currentParameterSpanIs("T extends IFoo");
// TODO: GH#23631
// goTo.marker("type2");
// verify.signatureHelpCountIs(1);
// verify.currentParameterHelpArgumentNameIs("T");
// verify.currentParameterSpanIs("T extends IFoo");
// goTo.marker("type3");
// verify.signatureHelpCountIs(1);
// verify.currentParameterHelpArgumentNameIs("T");
// verify.currentParameterSpanIs("T extends IFoo");
// goTo.marker("type4");
// verify.signatureHelpCountIs(1);
// verify.currentParameterHelpArgumentNameIs("M");
// verify.currentParameterSpanIs("M extends IFoo");
if (false) {
verify.signatureHelp(
{
marker: ["type1", "type2", "type3"],
text: "testClass<T extends IFoo, U, M extends IFoo>",
parameterName: "T",
parameterSpan: "T extends IFoo",
},
{
marker: "type4",
parameterName: "M",
parameterSpan: "M extends IFoo",
}
);
}

View File

@@ -3,16 +3,16 @@
// @allowNonTsExtensions: true
// @Filename: file.js
//// "use strict";
////
////
//// class Something {
////
////
//// /**
//// * @param {number} a
//// */
//// constructor(a, b) {
//// a/*body*/
//// }
////
////
//// /**
//// * @param {number} a
//// */
@@ -27,8 +27,11 @@ edit.insert('.');
verify.completionListContains('toFixed', undefined, undefined, 'method');
edit.backspace();
goTo.marker('sig');
verify.currentSignatureHelpIs('Something(a: number, b: any): Something');
verify.signatureHelp({
marker: "sig",
text: "Something(a: number, b: any): Something",
tags: [{ name: "param", text: "a" }],
});
goTo.marker('method');
edit.insert('.');

View File

@@ -35,4 +35,14 @@ edit.insert('y.');
verify.completionListContains("toUpperCase", /*displayText:*/ undefined, /*documentation*/ undefined, "method");
edit.backspace(2);
edit.insert('z(');
verify.currentSignatureHelpIs("z(a: number | boolean, b: string[]): string");
verify.signatureHelp({
text: "z(a: number | boolean, b: string[]): string",
// TODO: GH#24129
parameterDocComment: "The first param\nThe first param",
tags: [
{ name: "param", text: "a The first param" },
{ name: "param", text: "b The second param" },
{ name: "param", text: "a The first param" },
{ name: "param", text: "b The second param" },
],
});

View File

@@ -9,7 +9,7 @@
// Do resolve without typeCheck
goTo.marker('1');
edit.insert("alert(");
verify.currentSignatureHelpIs("alert(message?: any): void");
verify.signatureHelp({ text: "alert(message?: any): void" });
// TypeCheck
verify.errorExistsAfterMarker('1');

View File

@@ -17,5 +17,4 @@ goTo.marker('1');
/**** BUG: Should be an error to invoke a call signature on a namespace import ****/
//verify.errorExistsBeforeMarker('1');
verify.quickInfoIs("(alias) foo(): number\nimport foo");
goTo.marker('2');
verify.signatureHelpArgumentCountIs(1);
verify.signatureHelp({ marker: "2", argumentCount: 1 });

View File

@@ -5,8 +5,7 @@
//// /** @type {function(string, boolean=): number} */
//// var f6;
////
////
//// f6('', /**/false)
goTo.marker();
verify.currentSignatureHelpIs('f6(arg0: string, arg1?: boolean): number')
verify.signatureHelp({ marker: "", text: "f6(arg0: string, arg1?: boolean): number" });

View File

@@ -14,5 +14,16 @@
//////...
////}
////pathFilter(/**/'foo', 'bar', 'baz', {});
goTo.marker();
verify.currentSignatureHelpDocCommentIs("Filters a path based on a regexp or glob pattern.");
verify.signatureHelp({
marker: "",
docComment: "Filters a path based on a regexp or glob pattern.",
parameterDocComment: "The base path where the search will be performed.",
tags: [
{ name: "param", text: "basePath The base path where the search will be performed." },
{ name: "param", text: "pattern A string defining a regexp of a glob pattern." },
{ name: "param", text: "type The search pattern type, can be a regexp or a glob." },
{ name: "param", text: "options A object containing options to the search." },
{ name: "return", text: "A list containing the filtered paths." },
],
});

View File

@@ -3,17 +3,22 @@
// @Filename: Foo.js
/////**
//// * @param {string} p1 - A string param
//// * @param {string?} p2 - An optional param
//// * @param {string?} p2 - An optional param
//// * @param {string} [p3] - Another optional param
//// * @param {string} [p4="test"] - An optional param with a default value
//// */
////function f1(p1, p2, p3, p4){}
////f1(/*1*/'foo', /*2*/'bar', /*3*/'baz', /*4*/'qux');
goTo.marker('1');
verify.currentParameterHelpArgumentDocCommentIs("- A string param");
goTo.marker('2');
verify.currentParameterHelpArgumentDocCommentIs("- An optional param ");
goTo.marker('3');
verify.currentParameterHelpArgumentDocCommentIs("- Another optional param");
goTo.marker('4');
verify.currentParameterHelpArgumentDocCommentIs("- An optional param with a default value");
const tags: ReadonlyArray<FourSlashInterface.JSDocTagInfo> = [
{ name: "param", text: "p1 - A string param" },
{ name: "param", text: "p2 - An optional param" },
{ name: "param", text: "p3 - Another optional param" },
{ name: "param", text: "p4 - An optional param with a default value" },
];
verify.signatureHelp(
{ marker: "1", parameterDocComment: "- A string param", tags },
{ marker: "2", parameterDocComment: "- An optional param", tags },
{ marker: "3", parameterDocComment: "- Another optional param", tags },
{ marker: "4", parameterDocComment: "- An optional param with a default value", tags },
);

View File

@@ -61,15 +61,20 @@
verify.baselineQuickInfo();
goTo.marker("10");
verify.currentSignatureHelpTagsAre([{name: "myjsdoctag", text:"this is a comment"}])
goTo.marker("11");
verify.currentSignatureHelpTagsAre([{name: "mytag", text:"comment1 comment2"}])
goTo.marker("12");
verify.currentSignatureHelpTagsAre([{name: "mytag"}])
goTo.marker("13");
verify.currentSignatureHelpTagsAre([{ name: "returns", text: "a value" }])
verify.signatureHelp(
{
marker: "10",
docComment: "This is the constructor.",
tags: [{ name: "myjsdoctag", text:"this is a comment" }],
},
{
marker: "11",
docComment: "method1 documentation",
tags: [{ name: "mytag", text: "comment1 comment2" }],
},
{ marker: "12", tags: [{ name: "mytag", text: undefined }] },
{ marker: "13", tags: [{ name: "returns", text: "a value" }] },
);
goTo.marker('14');
verify.completionEntryDetailIs(

View File

@@ -12,6 +12,15 @@
////}
////find(''/**/);
goTo.marker();
verify.currentSignatureHelpIs("find<T>(l: T[], x: T): T")
// There currently isn't a way to display the return tag comment
verify.signatureHelp({
marker: "",
text: "find<T>(l: T[], x: T): T",
docComment: "Find an item",
tags: [
// TODO: GH#24130
{ name: "template", text: "T\n " },
{ name: "param", text: "l" },
{ name: "param", text: "x" },
{ name: "returns", text: "The names of the found item(s)." },
],
});

View File

@@ -4,11 +4,5 @@
////new/*1*/ Foo
////new /*2*/Foo(/*3*/)
goTo.marker('1');
verify.not.signatureHelpPresent();
goTo.marker('2');
verify.not.signatureHelpPresent();
goTo.marker('3');
verify.signatureHelpPresent();
verify.noSignatureHelp("1", "2");
verify.signatureHelp({ marker: "3", text: "Foo(): Foo" });

View File

@@ -9,10 +9,11 @@
////var /*2*/x = foo(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs('foo(name: "order"): string');
verify.signatureHelp({
marker: "1",
overloadsCount: 4,
text: 'foo(name: "order"): string',
})
edit.insert('"hi"');
goTo.marker('2');
verify.quickInfoIs('var x: string');
verify.quickInfoAt("2", "var x: string");

View File

@@ -5,7 +5,4 @@
////blah('hola/*1*/,/*2*/')
// making sure the comma in a string literal doesn't trigger param help on the second function param
goTo.marker('1');
verify.currentParameterHelpArgumentNameIs('foo');
goTo.marker('2');
verify.currentParameterHelpArgumentNameIs('foo');
verify.signatureHelp({ marker: test.markerNames(), parameterName: "foo" });

View File

@@ -5,7 +5,4 @@
////foo("test"/*1*/);
////foo(b/*2*/);
goTo.marker("1");
verify.currentParameterHelpArgumentNameIs("a");
goTo.marker("2");
verify.currentParameterHelpArgumentNameIs("a");
verify.signatureHelp({ marker: test.markerNames(), parameterName: "a" });

View File

@@ -4,5 +4,4 @@
////function x(arg: m.c) { return arg; }
////x(/**/
goTo.marker();
verify.currentSignatureHelpIs('x(arg: m.c): m.c');
verify.signatureHelp({ marker: "", text: "x(arg: m.c): m.c" });

View File

@@ -13,5 +13,4 @@ verify.quickInfos({
2: "(parameter) value: T"
});
goTo.marker('3');
verify.currentSignatureHelpIs('map(fn: (k: string, value: number, context: any) => void, context: any): void');
verify.signatureHelp({ marker: "3", text: "map(fn: (k: string, value: number, context: any) => void, context: any): void" });

View File

@@ -16,10 +16,9 @@
////}
////var x = new /*2*/B(/*1*/
goTo.marker("1");
verify.currentSignatureHelpIs("B(a: Foo<I>, b: number): B");
verify.signatureHelp({ marker: "1", text: "B(a: Foo<I>, b: number): B" });
edit.insert("null,");
verify.currentSignatureHelpIs("B(a: Foo<I>, b: number): B");
verify.signatureHelp({ text: "B(a: Foo<I>, b: number): B" });
edit.insert("10);");
verify.quickInfoAt("2", "constructor B(a: Foo<I>, b: number): B");

View File

@@ -5,5 +5,4 @@
////}
////var x = new A(/*1*/
goTo.marker("1");
verify.not.signatureHelpPresent();
verify.noSignatureHelp("1");

View File

@@ -5,5 +5,4 @@
////}
////var x = new A(/*1*/
goTo.marker("1");
verify.not.signatureHelpPresent();
verify.noSignatureHelp("1");

View File

@@ -3,5 +3,4 @@
////function f(...x: any[]) { }
////f(/**/);
goTo.marker();
verify.currentParameterHelpArgumentNameIs('x');
verify.signatureHelp({ marker: "", parameterName: "x", isVariadic: true });

View File

@@ -7,10 +7,9 @@
//// foo(/*1*/)
////}
goTo.marker('1');
verify.signatureHelpPresent();
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(0);
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpDocCommentIs('');
verify.signatureHelp({
marker: "1",
argumentCount: 0,
parameterCount: 1,
docComment: "",
});

View File

@@ -1,4 +1,4 @@
/// <reference path='fourslash.ts' />
/// <reference path='../fourslash.ts' />
// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file0.ts
////declare function fn(x: string, y: number);
@@ -9,5 +9,4 @@
// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts
////fn(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.signatureHelp({ marker: "1", overloadsCount: 2 });

View File

@@ -1,4 +1,4 @@
/// <reference path='fourslash.ts' />
/// <reference path='../fourslash.ts' />
// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file0.ts
////declare function fn(x: string, y: number);
@@ -9,5 +9,4 @@
// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts
////fn(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.signatureHelp({ marker: "1", overloadsCount: 2 });

View File

@@ -5,13 +5,17 @@
////}
////anonymousFunctionTest(5, "")(/*anonymousFunction1*/1, /*anonymousFunction2*/"");
goTo.marker('anonymousFunction1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs('(a: number, b: string): string');
verify.currentParameterHelpArgumentNameIs("a");
verify.currentParameterSpanIs("a: number");
goTo.marker('anonymousFunction2');
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: string");
verify.signatureHelp(
{
marker: "anonymousFunction1",
text: '(a: number, b: string): string',
parameterCount: 2,
parameterName: "a",
parameterSpan: "a: number",
},
{
marker: "anonymousFunction2",
parameterName: "b",
parameterSpan: "b: string",
},
);

View File

@@ -5,11 +5,10 @@
////
////Foo(/**/
goTo.marker();
verify.signatureHelpPresent();
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void");
verify.currentSignatureParameterCountIs(2);
verify.currentParameterHelpArgumentNameIs("arg1");
verify.currentParameterSpanIs("arg1: string");
verify.signatureHelp({
marker: "",
text: "Foo(arg1: string, arg2: string): void",
parameterCount: 2,
parameterName: "arg1",
parameterSpan: "arg1: string",
})

View File

@@ -5,11 +5,10 @@
////
////Foo(/**/;
goTo.marker();
verify.signatureHelpPresent();
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void");
verify.currentSignatureParameterCountIs(2);
verify.currentParameterHelpArgumentNameIs("arg1");
verify.currentParameterSpanIs("arg1: string");
verify.signatureHelp({
marker: "",
text: "Foo(arg1: string, arg2: string): void",
parameterCount: 2,
parameterName: "arg1",
parameterSpan: "arg1: string",
});

View File

@@ -3,14 +3,17 @@
////function fnTest(str: string, num: number) { }
////fnTest(/*1*/'', /*2*/5);
goTo.marker('1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs('fnTest(str: string, num: number): void');
verify.currentParameterHelpArgumentNameIs('str');
verify.currentParameterSpanIs("str: string");
goTo.marker('2');
verify.currentParameterHelpArgumentNameIs('num');
verify.currentParameterSpanIs("num: number");
verify.signatureHelp(
{
marker: "1",
text: 'fnTest(str: string, num: number): void',
parameterCount: 2,
parameterName: "str",
parameterSpan: "str: string",
},
{
marker: "2",
parameterName: "num",
parameterSpan: "num: number",
},
);

View File

@@ -12,17 +12,21 @@
////someOptional(1, 2, 3);
////someOptional(); // no error here; x and y are optional in JS
goTo.marker('1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs('allOptional(...args: any[]): void');
verify.currentParameterHelpArgumentNameIs('args');
verify.currentParameterSpanIs("...args: any[]");
goTo.marker('2');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(3);
verify.currentSignatureHelpIs('someOptional(x: any, y: any, ...args: any[]): void');
verify.currentParameterHelpArgumentNameIs('x');
verify.currentParameterSpanIs("x: any");
verify.numberOfErrorsInCurrentFile(0);
verify.noErrors();
verify.signatureHelp(
{
marker: "1",
text: "allOptional(...args: any[]): void",
parameterCount: 1,
parameterName: "args",
parameterSpan: "...args: any[]",
isVariadic: true,
},
{
marker: "2",
text: "someOptional(x: any, y: any, ...args: any[]): void",
parameterCount: 3,
parameterName: "x",
parameterSpan: "x: any",
isVariadic: true,
});

View File

@@ -3,15 +3,17 @@
////class sampleCls { constructor(str: string, num: number) { } }
////var x = new sampleCls(/*1*/"", /*2*/5);
goTo.marker('1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs('sampleCls(str: string, num: number): sampleCls');
verify.currentParameterHelpArgumentNameIs('str');
verify.currentParameterSpanIs("str: string");
goTo.marker('2');
verify.currentParameterHelpArgumentNameIs('num');
verify.currentParameterSpanIs("num: number");
verify.signatureHelp(
{
marker: "1",
text: "sampleCls(str: string, num: number): sampleCls",
parameterCount: 2,
parameterName: "str",
parameterSpan: "str: string",
},
{
marker: "2",
parameterName: "num",
parameterSpan: "num: number",
},
)

View File

@@ -10,9 +10,12 @@
////}
////var a = new Circle(/**/
goTo.marker('');
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("Circle(radius: number): Circle");
verify.currentParameterHelpArgumentNameIs("radius");
verify.currentParameterSpanIs("radius: number");
verify.currentParameterHelpArgumentDocCommentIs("The radius of the circle.");
verify.signatureHelp({
marker: "",
text: "Circle(radius: number): Circle",
parameterName: "radius",
parameterSpan: "radius: number",
docComment: "Initialize a circle.",
parameterDocComment: "The radius of the circle.",
tags: [{ name: "param", text: "radius The radius of the circle." }],
});

View File

@@ -13,10 +13,11 @@
//// }
////}
goTo.marker('indirectSuperCall');
verify.signatureHelpCountIs(2);
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs('B2(n: number): B2');
verify.currentParameterHelpArgumentNameIs("n");
verify.currentParameterSpanIs("n: number");
verify.signatureHelp({
marker: "indirectSuperCall",
overloadsCount: 2,
text: "B2(n: number): B2",
parameterCount: 1,
parameterName: "n",
parameterSpan: "n: number",
});

View File

@@ -4,13 +4,19 @@
////var x = new clsOverload(/*1*/);
////var y = new clsOverload(/*2*/'');
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.currentSignatureParameterCountIs(0);
verify.currentSignatureHelpIs('clsOverload(): clsOverload');
goTo.marker('2');
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs('clsOverload(test: string): clsOverload');
verify.currentParameterHelpArgumentNameIs('test');
verify.currentParameterSpanIs("test: string");
verify.signatureHelp(
{
marker: "1",
overloadsCount: 2,
text: "clsOverload(): clsOverload",
parameterCount: 0,
},
{
marker: "2",
overloadsCount: 2,
text: "clsOverload(test: string): clsOverload",
parameterCount: 1,
parameterName: "test",
parameterSpan: "test: string",
},
);

View File

@@ -7,14 +7,13 @@
////function Bar<T>(arg1: string, arg2: string) { }
////Bar</*2*/>();
goTo.marker('1');
verify.signatureHelpPresent();
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("Foo(arg1: string, arg2: string): void");
verify.currentSignatureParameterCountIs(2);
verify.currentParameterHelpArgumentNameIs("arg1");
verify.currentParameterSpanIs("arg1: string");
goTo.marker('2');
verify.signatureHelpPresent();
verify.signatureHelp(
{
marker: "1",
text: "Foo(arg1: string, arg2: string): void",
parameterCount: 2,
parameterName: "arg1",
parameterSpan: "arg1: string",
},
{ marker: "2", text: "Bar<T>(arg1: string, arg2: string): void" },
);

View File

@@ -6,16 +6,11 @@
////f<number>(/*3*/);
////f<number, string, boolean>(/*4*/);
goTo.marker("1");
verify.currentSignatureHelpIs("f(x: number, y: string): number");
goTo.marker("2");
verify.currentSignatureHelpIs("f<T = boolean, U = string>(x: T, y: U): T");
goTo.marker("3");
// too few -- fill in rest with {}
verify.currentSignatureHelpIs("f(x: number, y: {}): number");
goTo.marker("4");
// too many -- ignore extra type arguments
verify.currentSignatureHelpIs("f(x: number, y: string): number");
verify.signatureHelp(
{ marker: "1", text: "f(x: number, y: string): number" },
{ marker: "2", text: "f<T = boolean, U = string>(x: T, y: U): T" },
// too few -- fill in rest with {}
{ marker: "3", text: "f(x: number, y: {}): number" },
// too many -- ignore extra type arguments
{ marker: "4", text: "f(x: number, y: string): number" },
);

View File

@@ -17,9 +17,7 @@
//// }
////}
goTo.marker('1');
verify.signatureHelpPresent();
verify.currentSignatureHelpIs('B(): B');
goTo.marker('2');
verify.currentSignatureHelpIs('B2(x: number): B2');
verify.signatureHelp(
{ marker: "1", text: "B(): B" },
{ marker: "2", text: "B2(x: number): B2" },
);

View File

@@ -6,13 +6,18 @@
////functionOverload(/*functionOverload1*/);
////functionOverload(""/*functionOverload2*/);
goTo.marker('functionOverload1');
verify.signatureHelpCountIs(2);
verify.currentSignatureParameterCountIs(0);
verify.currentSignatureHelpIs('functionOverload(): any');
goTo.marker('functionOverload2');
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs('functionOverload(test: string): any');
verify.currentParameterHelpArgumentNameIs("test");
verify.currentParameterSpanIs("test: string");
verify.signatureHelp(
{
marker: "functionOverload1",
overloadsCount: 2,
text: "functionOverload(): any",
parameterCount: 0,
},
{
marker: "functionOverload2",
overloadsCount: 2,
text: "functionOverload(test: string): any",
parameterName: "test",
parameterSpan: "test: string",
},
);

View File

@@ -4,14 +4,18 @@
//// callback(/*parameterFunction1*/5, /*parameterFunction2*/"");
////}
goTo.marker('parameterFunction1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs('callback(a: number, b: string): void');
verify.currentParameterHelpArgumentNameIs("a");
verify.currentParameterSpanIs("a: number");
goTo.marker('parameterFunction2');
verify.currentSignatureHelpIs('callback(a: number, b: string): void');
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: string");
verify.signatureHelp(
{
marker: "parameterFunction1",
text: "callback(a: number, b: string): void",
parameterCount: 2,
parameterName: "a",
parameterSpan: "a: number",
},
{
marker: "parameterFunction2",
text: "callback(a: number, b: string): void",
parameterName: "b",
parameterSpan: "b: string",
},
);

View File

@@ -4,7 +4,8 @@
////}
////var implicitConstructor = new ImplicitConstructor(/**/);
goTo.marker();
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("ImplicitConstructor(): ImplicitConstructor");
verify.currentSignatureParameterCountIs(0);
verify.signatureHelp({
marker: "",
text: "ImplicitConstructor(): ImplicitConstructor",
parameterCount: 0,
});

View File

@@ -12,4 +12,4 @@
goTo.marker();
edit.insert('(');
verify.currentSignatureHelpIs('abs(str: string): string');
verify.signatureHelp({ text: "abs(str: string): string" });

View File

@@ -5,7 +5,5 @@
//// /*2*/
////});
goTo.marker('1');
verify.signatureHelpPresent();
goTo.marker('2');
verify.not.signatureHelpPresent();
verify.signatureHelp({ marker: "1", text: "forEach(f: () => void): any" })
verify.noSignatureHelp("2");

View File

@@ -4,5 +4,4 @@
////}
////foo(/*1*/
goTo.marker('1');
verify.currentSignatureHelpIs("foo(x: number, callback: (x: {}) => number): void");
verify.signatureHelp({ marker: "1", text: "foo(x: number, callback: (x: {}) => number): void" });

View File

@@ -5,5 +5,4 @@
//// for (/**/
////});
goTo.marker();
verify.not.signatureHelpPresent();
verify.noSignatureHelp("");

View File

@@ -9,5 +9,4 @@
// @Filename: signatureHelpInFunctionCallOnFunctionDeclarationInMultipleFiles_file2.ts
////fn(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.signatureHelp({ marker: "1", overloadsCount: 2 });

View File

@@ -1,19 +0,0 @@
/// <reference path='fourslash.ts' />
/////**
//// * Returns the substring at the specified location within a String object.
//// * @param start The zero-based index integer indicating the beginning of the substring.
//// * @param end Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.
//// * If end is omitted, the characters from start through the end of the original string are returned.
//// */
////function foo(start: number, end?: number) {
//// return "";
////}
////
////foo(/*1*/
goTo.marker('1');
verify.currentParameterHelpArgumentDocCommentIs("The zero-based index integer indicating the beginning of the substring.");
edit.insert("10,");
verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.");
edit.insert(" ");
verify.currentParameterHelpArgumentDocCommentIs("Zero-based index integer indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\nIf end is omitted, the characters from start through the end of the original string are returned.");

View File

@@ -3,7 +3,6 @@
//// class base { constructor (public n: number, public y: string) { } }
//// (new base(/**/
goTo.marker();
verify.currentParameterHelpArgumentNameIs('n');
verify.signatureHelp({ marker: "", parameterName: "n" });
edit.insert('0, ');
verify.currentParameterHelpArgumentNameIs('y');
verify.signatureHelp({ parameterName: "y" });

View File

@@ -15,17 +15,8 @@
//// x.f3(5,/*incompleteCalls3*/
////}
goTo.marker('incompleteCalls1');
verify.currentSignatureHelpIs("f1(): void");
verify.currentSignatureParameterCountIs(0);
goTo.marker('incompleteCalls2');
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs("f2(n: number): number");
goTo.marker('incompleteCalls3');
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs("f3(n: number, s: string): string");
verify.currentParameterHelpArgumentNameIs("s");
verify.currentParameterSpanIs("s: string");
verify.signatureHelp(
{ marker: "incompleteCalls1", text: "f1(): void", parameterCount: 0 },
{ marker: "incompleteCalls2", text: "f2(n: number): number", parameterCount: 1 },
{ marker: "incompleteCalls3", text: "f3(n: number, s: string): string", parameterCount: 2, parameterName: "s", parameterSpan: "s: string" },
);

View File

@@ -6,11 +6,4 @@
////cl/*invalidContext*/ass InvalidSignatureHelpLocation { }
////InvalidSignatureHelpLocation(/*validContext*/);
goTo.marker('insideComment');
verify.not.signatureHelpPresent();
goTo.marker('invalidContext');
verify.not.signatureHelpPresent();
goTo.marker('validContext');
verify.not.signatureHelpPresent();
verify.noSignatureHelp("insideComment", "invalidContext", "validContext");

View File

@@ -3,8 +3,4 @@
////class clsOverload { constructor(); constructor(test: string); constructor(test?: string) { } }
////var x = new clsOverload/*beforeOpenParen*/()/*afterCloseParen*/;
goTo.marker('beforeOpenParen');
verify.not.signatureHelpPresent();
goTo.marker('afterCloseParen');
verify.not.signatureHelpPresent();
verify.noSignatureHelp("beforeOpenParen", "afterCloseParen");

View File

@@ -6,7 +6,9 @@
////
////foo(/**/
goTo.marker();
verify.currentSignatureHelpIs("foo(n: number): string");
verify.currentParameterHelpArgumentNameIs("n");
verify.currentParameterSpanIs("n: number");
verify.signatureHelp({
marker: "",
text: "foo(n: number): string",
parameterName: "n",
parameterSpan: "n: number",
});

View File

@@ -3,6 +3,4 @@
////class sampleCls { constructor(str: string, num: number) { } }
////var x = new sampleCls/**/;
goTo.marker();
verify.signatureHelpCountIs(0);
verify.not.signatureHelpPresent();
verify.noSignatureHelp("");

View File

@@ -3,15 +3,18 @@
////var objectLiteral = { n: 5, s: "", f: (a: number, b: string) => "" };
////objectLiteral.f(/*objectLiteral1*/4, /*objectLiteral2*/"");
goTo.marker('objectLiteral1');
verify.signatureHelpCountIs(1);
verify.currentSignatureParameterCountIs(2);
verify.currentSignatureHelpIs('f(a: number, b: string): string');
verify.currentParameterHelpArgumentNameIs("a");
verify.currentParameterSpanIs("a: number");
goTo.marker('objectLiteral2');
verify.currentSignatureHelpIs('f(a: number, b: string): string');
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: string");
verify.signatureHelp(
{
marker: "objectLiteral1",
text: "f(a: number, b: string): string",
parameterCount: 2,
parameterName: "a",
parameterSpan: "a: number",
},
{
marker: "objectLiteral2",
text: "f(a: number, b: string): string",
parameterName: "b",
parameterSpan: "b: string",
},
);

View File

@@ -6,15 +6,18 @@
////declare function fn2(x: string, y: number);
////fn('', fn2(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs("fn2(x: string): any");
verify.currentParameterHelpArgumentNameIs("x");
verify.currentParameterSpanIs("x: string");
verify.signatureHelp({
marker: "1",
overloadsCount: 2,
text: "fn2(x: string): any",
parameterName: "x",
parameterSpan: "x: string",
});
edit.insert("'',");
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs("fn2(x: string, y: number): any");
verify.currentParameterHelpArgumentNameIs("y");
verify.currentParameterSpanIs("y: number");
verify.signatureHelp({
overloadsCount: 2,
text: "fn2(x: string, y: number): any",
parameterName: "y",
parameterSpan: "y: number",
});

View File

@@ -10,17 +10,8 @@
////x1('hi'/*2*/);
////x1('bye'/*3*/);
goTo.marker('1');
verify.signatureHelpCountIs(3);
verify.currentParameterHelpArgumentNameIs("z");
verify.currentParameterSpanIs("z: string");
goTo.marker('2');
verify.signatureHelpCountIs(3);
verify.currentParameterHelpArgumentNameIs("x");
verify.currentParameterSpanIs("x: \"hi\"");
goTo.marker('3');
verify.signatureHelpCountIs(3);
verify.currentParameterHelpArgumentNameIs("y");
verify.currentParameterSpanIs("y: \"bye\"");
verify.signatureHelp(
{ marker: "1", overloadsCount: 3, parameterName: "z", parameterSpan: "z: string" },
{ marker: "2", overloadsCount: 3, parameterName: "x", parameterSpan: 'x: "hi"' },
{ marker: "3", overloadsCount: 3, parameterName: "y", parameterSpan: 'y: "bye"' },
);

View File

@@ -4,15 +4,18 @@
////declare function fn(x: string, y: number);
////fn(/*1*/
goTo.marker('1');
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs("fn(x: string): any");
verify.currentParameterHelpArgumentNameIs("x");
verify.currentParameterSpanIs("x: string");
verify.signatureHelp({
marker: "1",
overloadsCount: 2,
text: "fn(x: string): any",
parameterName: "x",
parameterSpan: "x: string",
});
edit.insert("'',");
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs("fn(x: string, y: number): any");
verify.currentParameterHelpArgumentNameIs("y");
verify.currentParameterSpanIs("y: number");
verify.signatureHelp({
overloadsCount: 2,
text: "fn(x: string, y: number): any",
parameterName: "y",
parameterSpan: "y: number",
});

View File

@@ -7,14 +7,18 @@
////
////f(1/**/
goTo.marker();
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(n: number): any");
verify.currentParameterHelpArgumentNameIs("n");
verify.currentParameterSpanIs("n: number");
verify.signatureHelp({
marker: "",
overloadsCount: 4,
text: "f(n: number): any",
parameterName: "n",
parameterSpan: "n: number",
});
edit.insert(", ");
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(n: number, b: boolean): any");
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: boolean");
verify.signatureHelp({
overloadsCount: 4,
text: "f(n: number, b: boolean): any",
parameterName: "b",
parameterSpan: "b: boolean",
});

View File

@@ -7,14 +7,18 @@
////
////f(1/**/ var
goTo.marker();
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(n: number): any");
verify.currentParameterHelpArgumentNameIs("n");
verify.currentParameterSpanIs("n: number");
verify.signatureHelp({
marker: "",
overloadsCount: 4,
text: "f(n: number): any",
parameterName: "n",
parameterSpan: "n: number",
});
edit.insert(", ");
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(n: number, b: boolean): any");
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: boolean");
verify.signatureHelp({
overloadsCount: 4,
text: "f(n: number, b: boolean): any",
parameterName: "b",
parameterSpan: "b: boolean",
});

View File

@@ -7,20 +7,26 @@
////
////f(/**/
goTo.marker();
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(): any");
verify.currentSignatureParameterCountIs(0);
verify.signatureHelpArgumentCountIs(0);
verify.signatureHelp({
marker: "",
overloadsCount: 4,
text: "f(): any",
parameterCount: 0,
argumentCount: 0,
});
edit.insert("x, ");
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(s: string, b: boolean): any");
verify.currentSignatureParameterCountIs(2);
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: boolean");
verify.signatureHelp({
overloadsCount: 4,
text: "f(s: string, b: boolean): any",
parameterCount: 2,
parameterName: "b",
parameterSpan: "b: boolean",
});
edit.insert("x, ");
verify.signatureHelpCountIs(4);
verify.currentSignatureHelpIs("f(s: string, b: boolean): any");
verify.currentSignatureParameterCountIs(2);
verify.signatureHelp({
overloadsCount: 4,
text: "f(s: string, b: boolean): any",
parameterCount: 2,
});

View File

@@ -10,4 +10,4 @@
goTo.marker("1");
edit.insert("super(");
verify.currentSignatureHelpIs("B(x: string): B");
verify.signatureHelp({ text: "B(x: string): B" });

View File

@@ -7,14 +7,8 @@
//// f2(/*2*/)
//// f3(/*3*/)
goTo.marker("1");
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("f1(a: any): a is number");
goTo.marker("2");
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("f2<T>(a: any): a is T");
goTo.marker("3");
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("f3(a: any, ...b: any[]): a is number");
verify.signatureHelp(
{ marker: "1", text: "f1(a: any): a is number" },
{ marker: "2", text: "f2<T>(a: any): a is T" },
{ marker: "3", text: "f3(a: any, ...b: any[]): a is number", isVariadic: true },
)

View File

@@ -1,17 +1,22 @@
/// <reference path='fourslash.ts' />
////class ConstructorCall {
////class ConstructorCall {
//// constructor(str: string, num: number) {
//// }
////}
////var x = new ConstructorCall(/*constructorCall1*/1,/*constructorCall2*/2);
goTo.marker('constructorCall1');
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall");
verify.currentParameterHelpArgumentNameIs("str");
verify.currentParameterSpanIs("str: string");
goTo.marker('constructorCall2');
verify.currentSignatureHelpIs("ConstructorCall(str: string, num: number): ConstructorCall");
verify.currentParameterHelpArgumentNameIs("num");
verify.currentParameterSpanIs("num: number");
verify.signatureHelp(
{
marker: "constructorCall1",
text: "ConstructorCall(str: string, num: number): ConstructorCall",
parameterName: "str",
parameterSpan: "str: string",
},
{
marker: "constructorCall2",
text: "ConstructorCall(str: string, num: number): ConstructorCall",
parameterName: "num",
parameterSpan: "num: number",
},
);

View File

@@ -6,14 +6,17 @@
////functionCall(/*functionCall1*/);
////functionCall("", /*functionCall2*/1);
goTo.marker('functionCall1');
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("functionCall(str: string, num: number): void");
verify.currentParameterHelpArgumentNameIs("str");
verify.currentParameterSpanIs("str: string");
goTo.marker('functionCall2');
verify.currentSignatureHelpIs("functionCall(str: string, num: number): void");
verify.currentParameterHelpArgumentNameIs("num");
verify.currentParameterSpanIs("num: number");
verify.signatureHelp(
{
marker: "functionCall1",
text: "functionCall(str: string, num: number): void",
parameterName: "str",
parameterSpan: "str: string",
},
{
marker: "functionCall2",
text: "functionCall(str: string, num: number): void",
parameterName: "num",
parameterSpan: "num: number",
},
);

View File

@@ -10,8 +10,9 @@
//// }
////}
goTo.marker('superCall');
verify.signatureHelpCountIs(1);
verify.currentSignatureHelpIs("SuperCallBase(b: boolean): SuperCallBase");
verify.currentParameterHelpArgumentNameIs("b");
verify.currentParameterSpanIs("b: boolean");
verify.signatureHelp({
marker: "superCall",
text: "SuperCallBase(b: boolean): SuperCallBase",
parameterName: "b",
parameterSpan: "b: boolean",
});

View File

@@ -1,28 +1,35 @@
/// <reference path='fourslash.ts' />
////class SuperOverloadlBase {
////class SuperOverloadBase {
//// constructor();
//// constructor(test: string);
//// constructor(test?: string) {
//// }
////}
////class SuperOverLoad1 extends SuperOverloadlBase {
////class SuperOverLoad1 extends SuperOverloadBase {
//// constructor() {
//// super(/*superOverload1*/);
//// }
////}
////class SuperOverLoad2 extends SuperOverloadlBase {
////class SuperOverLoad2 extends SuperOverloadBase {
//// constructor() {
//// super(""/*superOverload2*/);
//// }
////}
goTo.marker('superOverload1');
verify.signatureHelpCountIs(2);
verify.currentSignatureHelpIs("SuperOverloadlBase(): SuperOverloadlBase");
verify.currentSignatureParameterCountIs(0);
goTo.marker('superOverload2');
verify.currentSignatureParameterCountIs(1);
verify.currentSignatureHelpIs("SuperOverloadlBase(test: string): SuperOverloadlBase");
verify.currentParameterHelpArgumentNameIs("test");
verify.currentParameterSpanIs("test: string");
verify.signatureHelp(
{
marker: "superOverload1",
overloadsCount: 2,
text: "SuperOverloadBase(): SuperOverloadBase",
parameterCount: 0,
},
{
marker: "superOverload2",
overloadsCount: 2,
text: "SuperOverloadBase(test: string): SuperOverloadBase",
parameterCount: 1,
parameterName: "test",
parameterSpan: "test: string",
},
);

View File

@@ -5,12 +5,11 @@
////
//// 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*/`
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(4);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("templateStrings");
verify.currentParameterSpanIs("templateStrings: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 4,
parameterCount: 4,
parameterName: "templateStrings",
parameterSpan: "templateStrings: any",
});

View File

@@ -5,12 +5,11 @@
////
//// 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*/
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(4);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("templateStrings");
verify.currentParameterSpanIs("templateStrings: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 4,
parameterCount: 4,
parameterName: "templateStrings",
parameterSpan: "templateStrings: any",
});

View File

@@ -5,12 +5,11 @@
////
//// f ` qwerty ${/*1*/ /*2*/123/*3*/ /*4*/} asdf ${ 41234 } zxcvb ${ g ` ` } `
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(4);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("x");
verify.currentParameterSpanIs("x: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 4,
parameterCount: 4,
parameterName: "x",
parameterSpan: "x: any",
});

View File

@@ -5,12 +5,11 @@
////
//// f ` qwerty ${ 123 } asdf ${/*1*/ /*2*/ /*3*/41/*4*/234/*5*/ /*6*/} zxcvb ${ g ` ` } `
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(4);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("y");
verify.currentParameterSpanIs("y: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 4,
parameterCount: 4,
parameterName: "y",
parameterSpan: "y: any",
});

View File

@@ -5,12 +5,11 @@
////
//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${/*1*/ /*2*/g/*3*/ /*4*/` `/*5*/ /*6*/} `
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(4);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("z");
verify.currentParameterSpanIs("z: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 4,
parameterCount: 4,
parameterName: "z",
parameterSpan: "z: any",
});

View File

@@ -5,12 +5,11 @@
////
//// f ` qwerty ${ 123 } asdf ${ 41234 } zxcvb ${ g `/*1*/ /*2*/ /*3*/` } `
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(1);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('g(templateStrings: any, x: any, y: any, z: any): string');
verify.currentParameterHelpArgumentNameIs("templateStrings");
verify.currentParameterSpanIs("templateStrings: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "g(templateStrings: any, x: any, y: any, z: any): string",
argumentCount: 1,
parameterCount: 4,
parameterName: "templateStrings",
parameterSpan: "templateStrings: any",
});

View File

@@ -5,12 +5,11 @@
////
//// f `/*1*/ /*2*/
goTo.eachMarker(() => {
verify.signatureHelpCountIs(1);
verify.signatureHelpArgumentCountIs(1);
verify.currentSignatureParameterCountIs(4);
verify.currentSignatureHelpIs('f(templateStrings: any, x: any, y: any, z: any): number');
verify.currentParameterHelpArgumentNameIs("templateStrings");
verify.currentParameterSpanIs("templateStrings: any");
});
verify.signatureHelp({
marker: test.markerNames(),
text: "f(templateStrings: any, x: any, y: any, z: any): number",
argumentCount: 1,
parameterCount: 4,
parameterName: "templateStrings",
parameterSpan: "templateStrings: any",
});

Some files were not shown because too many files have changed in this diff Show More