mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(39899): include in NavigationBar default exported call expression arguments (#40412)
This commit is contained in:
@@ -310,7 +310,7 @@ namespace ts.NavigationBar {
|
||||
|
||||
case SyntaxKind.ExportAssignment: {
|
||||
const expression = (<ExportAssignment>node).expression;
|
||||
const child = isObjectLiteralExpression(expression) ? expression :
|
||||
const child = isObjectLiteralExpression(expression) || isCallExpression(expression) ? expression :
|
||||
isArrowFunction(expression) || isFunctionExpression(expression) ? expression.body : undefined;
|
||||
if (child) {
|
||||
startNode(node);
|
||||
@@ -843,16 +843,11 @@ namespace ts.NavigationBar {
|
||||
}
|
||||
|
||||
// Otherwise, we need to aggregate each identifier to build up the qualified name.
|
||||
const result: string[] = [];
|
||||
|
||||
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
|
||||
|
||||
const result = [getTextOfIdentifierOrLiteral(moduleDeclaration.name)];
|
||||
while (moduleDeclaration.body && moduleDeclaration.body.kind === SyntaxKind.ModuleDeclaration) {
|
||||
moduleDeclaration = <ModuleDeclaration>moduleDeclaration.body;
|
||||
|
||||
result.push(getTextOfIdentifierOrLiteral(moduleDeclaration.name));
|
||||
}
|
||||
|
||||
return result.join(".");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
//// d: 1
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
//// function foo(props: { x: number; y: number }) {}
|
||||
//// export default foo({ x: 1, y: 1 });
|
||||
|
||||
verify.navigationTree({
|
||||
"text": '"navigationItemsExportDefaultExpression"',
|
||||
@@ -90,6 +93,21 @@ verify.navigationTree({
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "default",
|
||||
"kind": "const",
|
||||
"kindModifiers": "export",
|
||||
"childItems": [
|
||||
{
|
||||
"text": "x",
|
||||
"kind": "property"
|
||||
},
|
||||
{
|
||||
"text": "y",
|
||||
"kind": "property"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "AB",
|
||||
"kind": "class",
|
||||
@@ -119,6 +137,10 @@ verify.navigationTree({
|
||||
"kind": "class"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"text": "foo",
|
||||
"kind": "function"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user