Skip to content

Commit a897104

Browse files
committed
Add test for empty arguments and arity filtering
1 parent 03821df commit a897104

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/harness/fourslash.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,6 @@ module FourSlash {
944944
this.validate("error", message, renameInfo.localizedErrorMessage);
945945
}
946946

947-
//private getFormalParameter() {
948-
// var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
949-
// return help.formal;
950-
//}
951-
952947
private getActiveSignatureHelpItem() {
953948
var help = this.languageService.getSignatureHelpItems(this.activeFile.fileName, this.currentCaretPosition);
954949

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
////declare function f();
4+
////declare function f(s: string);
5+
////declare function f(s: string, b: boolean);
6+
////declare function f(n: number, b: boolean);
7+
////
8+
////f(/**/
9+
10+
goTo.marker();
11+
verify.signatureHelpCountIs(4);
12+
verify.currentSignatureHelpIs("f(): any");
13+
verify.currentSignatureParamterCountIs(0);
14+
15+
edit.insert(", ");
16+
verify.signatureHelpCountIs(4);
17+
verify.currentSignatureHelpIs("f(s: string, b: boolean): any");
18+
verify.currentSignatureParamterCountIs(2);
19+
verify.currentParameterHelpArgumentNameIs("b");
20+
verify.currentParameterSpanIs("b: boolean");
21+
22+
// What should the intended behavior be if there are too many arguments?
23+
edit.insert(", ");
24+
verify.signatureHelpCountIs(4);
25+
verify.currentSignatureHelpIs("f(): any");
26+
verify.currentSignatureParamterCountIs(0);

0 commit comments

Comments
 (0)