@@ -7099,23 +7099,6 @@ module ts {
70997099 return mapToArray ( symbols ) ;
71007100 }
71017101
7102- // True if the given identifier is the name of a type declaration node (class, interface, enum, type parameter, etc)
7103- function isTypeDeclarationName ( name : Node ) : boolean {
7104- return name . kind == SyntaxKind . Identifier &&
7105- isTypeDeclaration ( name . parent ) &&
7106- ( < Declaration > name . parent ) . name === name ;
7107- }
7108-
7109- function isTypeDeclaration ( node : Node ) : boolean {
7110- switch ( node . kind ) {
7111- case SyntaxKind . TypeParameter :
7112- case SyntaxKind . ClassDeclaration :
7113- case SyntaxKind . InterfaceDeclaration :
7114- case SyntaxKind . EnumDeclaration :
7115- return true ;
7116- }
7117- }
7118-
71197102 // True if the given identifier is part of a type reference
71207103 function isTypeReferenceIdentifier ( entityName : EntityName ) : boolean {
71217104 var node : Node = entityName ;
@@ -7194,75 +7177,6 @@ module ts {
71947177 return false ;
71957178 }
71967179
7197- function isTypeNode ( node : Node ) : boolean {
7198- if ( node . kind >= SyntaxKind . FirstTypeNode && node . kind <= SyntaxKind . LastTypeNode ) {
7199- return true ;
7200- }
7201-
7202- switch ( node . kind ) {
7203- case SyntaxKind . AnyKeyword :
7204- case SyntaxKind . NumberKeyword :
7205- case SyntaxKind . StringKeyword :
7206- case SyntaxKind . BooleanKeyword :
7207- return true ;
7208- case SyntaxKind . VoidKeyword :
7209- return node . parent . kind !== SyntaxKind . PrefixOperator ;
7210- case SyntaxKind . StringLiteral :
7211- // Specialized signatures can have string literals as their parameters' type names
7212- return node . parent . kind === SyntaxKind . Parameter ;
7213- // Identifiers and qualified names may be type nodes, depending on their context. Climb
7214- // above them to find the lowest container
7215- case SyntaxKind . Identifier :
7216- // If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
7217- if ( node . parent . kind === SyntaxKind . QualifiedName ) {
7218- node = node . parent ;
7219- }
7220- // Fall through
7221- case SyntaxKind . QualifiedName :
7222- // At this point, node is either a qualified name or an identifier
7223- var parent = node . parent ;
7224- if ( parent . kind === SyntaxKind . TypeQuery ) {
7225- return false ;
7226- }
7227- // Do not recursively call isTypeNode on the parent. In the example:
7228- //
7229- // var a: A.B.C;
7230- //
7231- // Calling isTypeNode would consider the qualified name A.B a type node. Only C or
7232- // A.B.C is a type node.
7233- if ( parent . kind >= SyntaxKind . FirstTypeNode && parent . kind <= SyntaxKind . LastTypeNode ) {
7234- return true ;
7235- }
7236- switch ( parent . kind ) {
7237- case SyntaxKind . TypeParameter :
7238- return node === ( < TypeParameterDeclaration > parent ) . constraint ;
7239- case SyntaxKind . Property :
7240- case SyntaxKind . Parameter :
7241- case SyntaxKind . VariableDeclaration :
7242- return node === ( < VariableDeclaration > parent ) . type ;
7243- case SyntaxKind . FunctionDeclaration :
7244- case SyntaxKind . FunctionExpression :
7245- case SyntaxKind . ArrowFunction :
7246- case SyntaxKind . Constructor :
7247- case SyntaxKind . Method :
7248- case SyntaxKind . GetAccessor :
7249- case SyntaxKind . SetAccessor :
7250- return node === ( < FunctionDeclaration > parent ) . type ;
7251- case SyntaxKind . CallSignature :
7252- case SyntaxKind . ConstructSignature :
7253- case SyntaxKind . IndexSignature :
7254- return node === ( < SignatureDeclaration > parent ) . type ;
7255- case SyntaxKind . TypeAssertion :
7256- return node === ( < TypeAssertion > parent ) . type ;
7257- case SyntaxKind . CallExpression :
7258- case SyntaxKind . NewExpression :
7259- return ( < CallExpression > parent ) . typeArguments . indexOf ( node ) >= 0 ;
7260- }
7261- }
7262-
7263- return false ;
7264- }
7265-
72667180 function isInRightSideOfImportOrExportAssignment ( node : EntityName ) {
72677181 while ( node . parent . kind === SyntaxKind . QualifiedName ) {
72687182 node = node . parent ;
0 commit comments