@@ -47,10 +47,8 @@ import {
4747 getSyntacticModifierFlags ,
4848 getTextOfIdentifierOrLiteral ,
4949 getTextOfNode ,
50- hasDynamicName ,
5150 hasJSDocNodes ,
5251 Identifier ,
53- idText ,
5452 ImportClause ,
5553 InterfaceDeclaration ,
5654 InternalSymbolName ,
@@ -62,8 +60,10 @@ import {
6260 isCallExpression ,
6361 isClassDeclaration ,
6462 isClassLike ,
63+ isComputedPropertyName ,
6564 isDeclaration ,
6665 isElementAccessExpression ,
66+ isEntityNameExpression ,
6767 isExportAssignment ,
6868 isExpression ,
6969 isExternalModule ,
@@ -73,6 +73,7 @@ import {
7373 isJSDocTypeAlias ,
7474 isModuleBlock ,
7575 isModuleDeclaration ,
76+ isNumericLiteral ,
7677 isObjectLiteralExpression ,
7778 isParameterPropertyDeclaration ,
7879 isPrivateIdentifier ,
@@ -82,6 +83,7 @@ import {
8283 isPropertyNameLiteral ,
8384 isStatic ,
8485 isStringLiteralLike ,
86+ isStringOrNumericLiteralLike ,
8587 isToken ,
8688 isVariableDeclaration ,
8789 lastOrUndefined ,
@@ -306,19 +308,15 @@ function addNodeWithRecursiveInitializer(node: VariableDeclaration | PropertyAss
306308 }
307309}
308310
309- /**
310- * Historically, we've elided dynamic names from the nav tree (including late bound names),
311- * but included certain "well known" symbol names. While we no longer distinguish those well-known
312- * symbols from other unique symbols, we do the below to retain those members in the nav tree.
313- */
314311function hasNavigationBarName ( node : Declaration ) {
315- return ! hasDynamicName ( node ) ||
316- (
317- node . kind !== SyntaxKind . BinaryExpression &&
318- isPropertyAccessExpression ( node . name . expression ) &&
319- isIdentifier ( node . name . expression . expression ) &&
320- idText ( node . name . expression . expression ) === "Symbol"
321- ) ;
312+ const name = getNameOfDeclaration ( node ) ;
313+ if ( name === undefined ) return false ;
314+
315+ if ( isComputedPropertyName ( name ) ) {
316+ const expression = name . expression ;
317+ return isEntityNameExpression ( expression ) || isNumericLiteral ( expression ) || isStringOrNumericLiteralLike ( expression ) ;
318+ }
319+ return ! ! name ;
322320}
323321
324322/** Look for navigation bar items in node's subtree, adding them to the current `parent`. */
0 commit comments