@@ -7077,23 +7077,6 @@ module ts {
70777077 return mapToArray ( symbols ) ;
70787078 }
70797079
7080- // True if the given identifier is the name of a type declaration node (class, interface, enum, type parameter, etc)
7081- function isTypeDeclarationName ( name : Node ) : boolean {
7082- return name . kind == SyntaxKind . Identifier &&
7083- isTypeDeclaration ( name . parent ) &&
7084- ( < Declaration > name . parent ) . name === name ;
7085- }
7086-
7087- function isTypeDeclaration ( node : Node ) : boolean {
7088- switch ( node . kind ) {
7089- case SyntaxKind . TypeParameter :
7090- case SyntaxKind . ClassDeclaration :
7091- case SyntaxKind . InterfaceDeclaration :
7092- case SyntaxKind . EnumDeclaration :
7093- return true ;
7094- }
7095- }
7096-
70977080 // True if the given identifier is part of a type reference
70987081 function isTypeReferenceIdentifier ( entityName : EntityName ) : boolean {
70997082 var node : Node = entityName ;
@@ -7172,75 +7155,6 @@ module ts {
71727155 return false ;
71737156 }
71747157
7175- function isTypeNode ( node : Node ) : boolean {
7176- if ( node . kind >= SyntaxKind . FirstTypeNode && node . kind <= SyntaxKind . LastTypeNode ) {
7177- return true ;
7178- }
7179-
7180- switch ( node . kind ) {
7181- case SyntaxKind . AnyKeyword :
7182- case SyntaxKind . NumberKeyword :
7183- case SyntaxKind . StringKeyword :
7184- case SyntaxKind . BooleanKeyword :
7185- return true ;
7186- case SyntaxKind . VoidKeyword :
7187- return node . parent . kind !== SyntaxKind . PrefixOperator ;
7188- case SyntaxKind . StringLiteral :
7189- // Specialized signatures can have string literals as their parameters' type names
7190- return node . parent . kind === SyntaxKind . Parameter ;
7191- // Identifiers and qualified names may be type nodes, depending on their context. Climb
7192- // above them to find the lowest container
7193- case SyntaxKind . Identifier :
7194- // If the identifier is the RHS of a qualified name, then it's a type iff its parent is.
7195- if ( node . parent . kind === SyntaxKind . QualifiedName ) {
7196- node = node . parent ;
7197- }
7198- // Fall through
7199- case SyntaxKind . QualifiedName :
7200- // At this point, node is either a qualified name or an identifier
7201- var parent = node . parent ;
7202- if ( parent . kind === SyntaxKind . TypeQuery ) {
7203- return false ;
7204- }
7205- // Do not recursively call isTypeNode on the parent. In the example:
7206- //
7207- // var a: A.B.C;
7208- //
7209- // Calling isTypeNode would consider the qualified name A.B a type node. Only C or
7210- // A.B.C is a type node.
7211- if ( parent . kind >= SyntaxKind . FirstTypeNode && parent . kind <= SyntaxKind . LastTypeNode ) {
7212- return true ;
7213- }
7214- switch ( parent . kind ) {
7215- case SyntaxKind . TypeParameter :
7216- return node === ( < TypeParameterDeclaration > parent ) . constraint ;
7217- case SyntaxKind . Property :
7218- case SyntaxKind . Parameter :
7219- case SyntaxKind . VariableDeclaration :
7220- return node === ( < VariableDeclaration > parent ) . type ;
7221- case SyntaxKind . FunctionDeclaration :
7222- case SyntaxKind . FunctionExpression :
7223- case SyntaxKind . ArrowFunction :
7224- case SyntaxKind . Constructor :
7225- case SyntaxKind . Method :
7226- case SyntaxKind . GetAccessor :
7227- case SyntaxKind . SetAccessor :
7228- return node === ( < FunctionDeclaration > parent ) . type ;
7229- case SyntaxKind . CallSignature :
7230- case SyntaxKind . ConstructSignature :
7231- case SyntaxKind . IndexSignature :
7232- return node === ( < SignatureDeclaration > parent ) . type ;
7233- case SyntaxKind . TypeAssertion :
7234- return node === ( < TypeAssertion > parent ) . type ;
7235- case SyntaxKind . CallExpression :
7236- case SyntaxKind . NewExpression :
7237- return ( < CallExpression > parent ) . typeArguments . indexOf ( node ) >= 0 ;
7238- }
7239- }
7240-
7241- return false ;
7242- }
7243-
72447158 function isInRightSideOfImportOrExportAssignment ( node : EntityName ) {
72457159 while ( node . parent . kind === SyntaxKind . QualifiedName ) {
72467160 node = node . parent ;
0 commit comments