@@ -47,10 +47,8 @@ import {
47
47
getSyntacticModifierFlags ,
48
48
getTextOfIdentifierOrLiteral ,
49
49
getTextOfNode ,
50
- hasDynamicName ,
51
50
hasJSDocNodes ,
52
51
Identifier ,
53
- idText ,
54
52
ImportClause ,
55
53
InterfaceDeclaration ,
56
54
InternalSymbolName ,
@@ -62,8 +60,10 @@ import {
62
60
isCallExpression ,
63
61
isClassDeclaration ,
64
62
isClassLike ,
63
+ isComputedPropertyName ,
65
64
isDeclaration ,
66
65
isElementAccessExpression ,
66
+ isEntityNameExpression ,
67
67
isExportAssignment ,
68
68
isExpression ,
69
69
isExternalModule ,
@@ -73,6 +73,7 @@ import {
73
73
isJSDocTypeAlias ,
74
74
isModuleBlock ,
75
75
isModuleDeclaration ,
76
+ isNumericLiteral ,
76
77
isObjectLiteralExpression ,
77
78
isParameterPropertyDeclaration ,
78
79
isPrivateIdentifier ,
@@ -82,6 +83,7 @@ import {
82
83
isPropertyNameLiteral ,
83
84
isStatic ,
84
85
isStringLiteralLike ,
86
+ isStringOrNumericLiteralLike ,
85
87
isToken ,
86
88
isVariableDeclaration ,
87
89
lastOrUndefined ,
@@ -306,19 +308,15 @@ function addNodeWithRecursiveInitializer(node: VariableDeclaration | PropertyAss
306
308
}
307
309
}
308
310
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
- */
314
311
function 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 ;
322
320
}
323
321
324
322
/** Look for navigation bar items in node's subtree, adding them to the current `parent`. */
0 commit comments