mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Builder in constructor aruguments + tests.
This commit is contained in:
@@ -656,12 +656,10 @@ module FourSlash {
|
||||
}
|
||||
}
|
||||
|
||||
public verifyCompletionListIsBuilder(negative: boolean) {
|
||||
public verifyCompletionListHasBuilder(negative: boolean) {
|
||||
var completions = this.getCompletionListAtCaret();
|
||||
|
||||
if (!completions) {
|
||||
this.raiseError("Expected completion list");
|
||||
} else if ((completions && !completions.isBuilder) && !negative) {
|
||||
if ((completions && !completions.isBuilder) && !negative) {
|
||||
this.raiseError("Expected builder completion entry");
|
||||
} else if ((completions && completions.isBuilder) && negative) {
|
||||
this.raiseError("Un-expected builder completion entry");
|
||||
|
||||
@@ -2376,9 +2376,11 @@ module ts {
|
||||
// variable declarations
|
||||
switch (previousToken.kind) {
|
||||
case SyntaxKind.CommaToken:
|
||||
return containingNodeKind === SyntaxKind.CallExpression;
|
||||
return containingNodeKind === SyntaxKind.CallExpression
|
||||
|| containingNodeKind === SyntaxKind.Constructor;
|
||||
case SyntaxKind.OpenParenToken:
|
||||
return containingNodeKind === SyntaxKind.CallExpression;
|
||||
return containingNodeKind === SyntaxKind.CallExpression
|
||||
|| containingNodeKind === SyntaxKind.Constructor;
|
||||
case SyntaxKind.ModuleKeyword:
|
||||
return true;
|
||||
case SyntaxKind.DotToken:
|
||||
@@ -2435,7 +2437,6 @@ module ts {
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
case SyntaxKind.Constructor:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.CallSignature:
|
||||
@@ -2482,7 +2483,9 @@ module ts {
|
||||
case SyntaxKind.PrivateKeyword:
|
||||
case SyntaxKind.StaticKeyword:
|
||||
case SyntaxKind.DotDotDotToken:
|
||||
return containingNodeKind === SyntaxKind.Parameter || containingNodeKind === SyntaxKind.PropertyDeclaration;
|
||||
return containingNodeKind === SyntaxKind.Parameter
|
||||
|| containingNodeKind === SyntaxKind.PropertyDeclaration
|
||||
|| containingNodeKind === SyntaxKind.Constructor;
|
||||
|
||||
case SyntaxKind.ClassKeyword:
|
||||
case SyntaxKind.EnumKeyword:
|
||||
|
||||
@@ -10,26 +10,19 @@
|
||||
|
||||
////function testFunction(a, b/*parameterName4*/
|
||||
|
||||
////class bar1{ constructor(/*constructorParamter1*/
|
||||
////class bar5{ constructor(public /*constructorParamter1*/
|
||||
|
||||
////class bar2{ constructor(a/*constructorParamter2*/
|
||||
////class bar6{ constructor(public a/*constructorParamter2*/
|
||||
|
||||
////class bar3{ constructor(a, /*constructorParamter3*/
|
||||
////class bar7{ constructor(private a/*constructorParamter3*/
|
||||
|
||||
////class bar4{ constructor(a, b/*constructorParamter4*/
|
||||
////class bar8{ constructor(.../*constructorParamter4*/
|
||||
|
||||
////class bar5{ constructor(public /*constructorParamter5*/
|
||||
|
||||
////class bar6{ constructor(public a/*constructorParamter6*/
|
||||
|
||||
////class bar7{ constructor(private a/*constructorParamter7*/
|
||||
|
||||
////class bar8{ constructor(.../*constructorParamter8*/
|
||||
|
||||
////class bar9{ constructor(...a/*constructorParamter9*/
|
||||
////class bar9{ constructor(...a/*constructorParamter5*/
|
||||
|
||||
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.completionListIsEmpty();
|
||||
verify.not.completionListIsBuilder();
|
||||
});
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
test.markers().forEach((m) => {
|
||||
goTo.position(m.position, m.fileName);
|
||||
verify.not.completionListIsEmpty();
|
||||
debugger;
|
||||
verify.completionListIsBuilder();
|
||||
});
|
||||
@@ -173,7 +173,7 @@ module FourSlashInterface {
|
||||
}
|
||||
|
||||
public completionListIsBuilder() {
|
||||
FourSlash.currentTestState.verifyCompletionListIsBuilder(this.negative);
|
||||
FourSlash.currentTestState.verifyCompletionListHasBuilder(this.negative);
|
||||
}
|
||||
|
||||
public memberListIsEmpty() {
|
||||
|
||||
Reference in New Issue
Block a user