More cases and tests for them.

This commit is contained in:
Daniel Rosenwasser 2015-03-17 12:21:35 -07:00
parent ad084ded72
commit 754a8a617c
13 changed files with 113 additions and 1 deletions

View file

@ -160,8 +160,25 @@ module ts {
}
return isCompletedNode((<DoStatement>n).statement, sourceFile);
case SyntaxKind.TypeQuery:
return isCompletedNode((<TypeQueryNode>n).exprName, sourceFile);
case SyntaxKind.TypeOfExpression:
return isCompletedNode((<TypeOfExpression>n).expression, sourceFile);
case SyntaxKind.DeleteExpression:
case SyntaxKind.VoidExpression:
case SyntaxKind.YieldExpression:
case SyntaxKind.SpreadElementExpression:
let unaryWordExpression = (<TypeOfExpression|DeleteExpression|VoidExpression|YieldExpression|SpreadElementExpression>n);
return isCompletedNode(unaryWordExpression.expression, sourceFile);
case SyntaxKind.TaggedTemplateExpression:
return isCompletedNode((<TaggedTemplateExpression>n).template, sourceFile);
case SyntaxKind.TemplateExpression:
let lastSpan = lastOrUndefined((<TemplateExpression>n).templateSpans);
return isCompletedNode(lastSpan, sourceFile);
case SyntaxKind.TemplateSpan:
return nodeIsPresent((<TemplateSpan>n).literal);
case SyntaxKind.PrefixUnaryExpression:
return isCompletedNode((<PrefixUnaryExpression>n).operand, sourceFile);
case SyntaxKind.BinaryExpression:

View file

@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = delete /*1*/
goTo.marker("1");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => delete /*1*/
goTo.marker("1");
verify.completionListContains("x");
verify.completionListContains("p");

View file

@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = [1,2,.../*1*/
goTo.marker("1");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => [1,2,.../*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => x `abc ${ /*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => x `abc ${ 123 } ${ /*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => `abc ${ /*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => `abc ${ 123 } ${ /*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,7 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = typeof /*1*/
goTo.marker("1");
verify.completionListContains("x");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => typeof /*1*/
goTo.marker("1");
verify.completionListContains("x");
verify.completionListContains("p");

View file

@ -0,0 +1,8 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = (p) => void /*1*/
goTo.marker("1");
verify.completionListContains("p");
verify.completionListContains("x");

View file

@ -0,0 +1,10 @@
/// <reference path='fourslash.ts' />
////var x;
////var y = function* gen(p) { yield /*1*/
goTo.marker("1");
// These tentatively don't work.
verify.not.completionListContains("p");
verify.not.completionListContains("gen");
verify.not.completionListContains("x");