Adds support for showing default exports in the navtree#35477
Adds support for showing default exports in the navtree#35477
Conversation
|
This is good for review again, I've made the changes on the text we show 👍 |
| } | ||
| case SyntaxKind.Identifier: | ||
| return isImportClause(node.parent) ? ScriptElementKind.alias : ScriptElementKind.unknown; | ||
| case SyntaxKind.ExportAssignment: |
There was a problem hiding this comment.
I think this needs to handled similar to AssignmentDeclarationKind.ModuleExports so that export default function foo() shows the kind as function and not as const
There was a problem hiding this comment.
Yeah, makes sense - I've used isFunctionLikeKind to determine that and you can see some examples in the tests 👍
There was a problem hiding this comment.
Need to also handle ClassExpression?
There was a problem hiding this comment.
Instead of handling each case, I've switched to recurse in the node.expression
case SyntaxKind.ExportAssignment:
const scriptKind = getNodeKind((node as ExportAssignment).expression);
// If the expression didn't come back with something (like it does for an identifiers)
return scriptKind === ScriptElementKind.unknown ? ScriptElementKind.constElement : scriptKind;I'm open to this going a bit further and digging into the identifier and finding out out var/let/const, but I don't know how to pull out the declaration of a random identifier to check.
…hey are a const vs function
Fixes #34601
@mjbvz - I'm not 100% sure on what you want in the output, so I took my closest guess with the existing constants that passed back and forth