@@ -877,14 +877,14 @@ namespace ts {
877877 // specially by `getSymbolAtLocation`.
878878 if ( isModifier ( node ) && ( forRename || node . kind !== SyntaxKind . DefaultKeyword ) ? contains ( parent . modifiers , node ) :
879879 node . kind === SyntaxKind . ClassKeyword ? isClassDeclaration ( parent ) || isClassExpression ( node ) :
880- node . kind === SyntaxKind . FunctionKeyword ? isFunctionDeclaration ( parent ) || isFunctionExpression ( node ) :
881- node . kind === SyntaxKind . InterfaceKeyword ? isInterfaceDeclaration ( parent ) :
882- node . kind === SyntaxKind . EnumKeyword ? isEnumDeclaration ( parent ) :
883- node . kind === SyntaxKind . TypeKeyword ? isTypeAliasDeclaration ( parent ) :
884- node . kind === SyntaxKind . NamespaceKeyword || node . kind === SyntaxKind . ModuleKeyword ? isModuleDeclaration ( parent ) :
885- node . kind === SyntaxKind . ImportKeyword ? isImportEqualsDeclaration ( parent ) :
886- node . kind === SyntaxKind . GetKeyword ? isGetAccessorDeclaration ( parent ) :
887- node . kind === SyntaxKind . SetKeyword && isSetAccessorDeclaration ( parent ) ) {
880+ node . kind === SyntaxKind . FunctionKeyword ? isFunctionDeclaration ( parent ) || isFunctionExpression ( node ) :
881+ node . kind === SyntaxKind . InterfaceKeyword ? isInterfaceDeclaration ( parent ) :
882+ node . kind === SyntaxKind . EnumKeyword ? isEnumDeclaration ( parent ) :
883+ node . kind === SyntaxKind . TypeKeyword ? isTypeAliasDeclaration ( parent ) :
884+ node . kind === SyntaxKind . NamespaceKeyword || node . kind === SyntaxKind . ModuleKeyword ? isModuleDeclaration ( parent ) :
885+ node . kind === SyntaxKind . ImportKeyword ? isImportEqualsDeclaration ( parent ) :
886+ node . kind === SyntaxKind . GetKeyword ? isGetAccessorDeclaration ( parent ) :
887+ node . kind === SyntaxKind . SetKeyword && isSetAccessorDeclaration ( parent ) ) {
888888 const location = getAdjustedLocationForDeclaration ( parent , forRename ) ;
889889 if ( location ) {
890890 return location ;
@@ -1947,6 +1947,16 @@ namespace ts {
19471947 return undefined ;
19481948 }
19491949
1950+ export function isTextWhiteSpaceLike ( text : string , startPos : number , endPos : number ) : boolean {
1951+ for ( let i = startPos ; i < endPos ; i ++ ) {
1952+ if ( ! isWhiteSpaceLike ( text . charCodeAt ( i ) ) ) {
1953+ return false ;
1954+ }
1955+ }
1956+
1957+ return true ;
1958+ }
1959+
19501960 // #endregion
19511961
19521962 // Display-part writer helpers
0 commit comments