mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
update isCompletedNode
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user