update isCompletedNode

This commit is contained in:
SaschaNaz
2015-09-10 06:32:43 +09:00
parent ad010ea8ee
commit b65cfe13da
2 changed files with 17 additions and 1 deletions
+6
View File
@@ -79,6 +79,8 @@ namespace ts {
case SyntaxKind.Block:
case SyntaxKind.ModuleBlock:
case SyntaxKind.CaseBlock:
case SyntaxKind.NamedImports:
case SyntaxKind.NamedExports:
return nodeEndsWith(n, SyntaxKind.CloseBraceToken, sourceFile);
case SyntaxKind.CatchClause:
return isCompletedNode((<CatchClause>n).block, sourceFile);
@@ -181,6 +183,10 @@ namespace ts {
case SyntaxKind.TemplateSpan:
return nodeIsPresent((<TemplateSpan>n).literal);
case SyntaxKind.ExportDeclaration:
case SyntaxKind.ImportDeclaration:
return nodeIsPresent((<ExportDeclaration | ImportDeclaration>n).moduleSpecifier);
case SyntaxKind.PrefixUnaryExpression:
return isCompletedNode((<PrefixUnaryExpression>n).operand, sourceFile);
case SyntaxKind.BinaryExpression:
@@ -23,6 +23,10 @@
////export/*formatOnEnter*/{/*formatOnEnterOpenBrace*/
/////*differentLineIndent*/x/*differentLineAutoformat*/
////} from "abc"
////
////export {
/////*incompleteExportDeclIndent*/
/////*incompleteExportDeclIndent2*/
format.selection("selectionStart", "selectionEnd");
@@ -68,4 +72,10 @@ goTo.marker("differentLineIndent");
verify.indentationIs(4);
edit.insertLine('');
goTo.marker("differentLineAutoformat");
verify.currentLineContentIs(" x");
verify.currentLineContentIs(" x");
goTo.marker("incompleteExportDeclIndent")
verify.indentationIs(4);
edit.insert("} from");
goTo.marker("incompleteExportDeclIndent2");
verify.indentationIs(4);