Skip to content

Commit 7d6c0f0

Browse files
Add ArrowFunction and sort cases.
1 parent 81b6588 commit 7d6c0f0

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

src/compiler/utilities.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -681,32 +681,33 @@ module ts {
681681

682682
export function isDeclaration(node: Node): boolean {
683683
switch (node.kind) {
684-
case SyntaxKind.TypeParameter:
685-
case SyntaxKind.Parameter:
686-
case SyntaxKind.VariableDeclaration:
684+
case SyntaxKind.ArrowFunction:
687685
case SyntaxKind.BindingElement:
688-
case SyntaxKind.PropertyDeclaration:
689-
case SyntaxKind.PropertySignature:
690-
case SyntaxKind.PropertyAssignment:
691-
case SyntaxKind.ShorthandPropertyAssignment:
686+
case SyntaxKind.ClassDeclaration:
687+
case SyntaxKind.Constructor:
688+
case SyntaxKind.EnumDeclaration:
692689
case SyntaxKind.EnumMember:
693-
case SyntaxKind.MethodDeclaration:
694-
case SyntaxKind.MethodSignature:
690+
case SyntaxKind.ExportSpecifier:
695691
case SyntaxKind.FunctionDeclaration:
692+
case SyntaxKind.FunctionExpression:
696693
case SyntaxKind.GetAccessor:
697-
case SyntaxKind.SetAccessor:
698-
case SyntaxKind.Constructor:
699-
case SyntaxKind.ClassDeclaration:
700-
case SyntaxKind.InterfaceDeclaration:
701-
case SyntaxKind.TypeAliasDeclaration:
702-
case SyntaxKind.EnumDeclaration:
703-
case SyntaxKind.ModuleDeclaration:
704-
case SyntaxKind.ImportEqualsDeclaration:
705694
case SyntaxKind.ImportClause:
695+
case SyntaxKind.ImportEqualsDeclaration:
706696
case SyntaxKind.ImportSpecifier:
697+
case SyntaxKind.InterfaceDeclaration:
698+
case SyntaxKind.MethodDeclaration:
699+
case SyntaxKind.MethodSignature:
700+
case SyntaxKind.ModuleDeclaration:
707701
case SyntaxKind.NamespaceImport:
708-
case SyntaxKind.ExportSpecifier:
709-
case SyntaxKind.FunctionExpression:
702+
case SyntaxKind.Parameter:
703+
case SyntaxKind.PropertyAssignment:
704+
case SyntaxKind.PropertyDeclaration:
705+
case SyntaxKind.PropertySignature:
706+
case SyntaxKind.SetAccessor:
707+
case SyntaxKind.ShorthandPropertyAssignment:
708+
case SyntaxKind.TypeAliasDeclaration:
709+
case SyntaxKind.TypeParameter:
710+
case SyntaxKind.VariableDeclaration:
710711
return true;
711712
}
712713
return false;

0 commit comments

Comments
 (0)