MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getTargetOfAliasLikeExpression

Method getTargetOfAliasLikeExpression

internal/checker/checker.go:14914–14927  ·  view source on GitHub ↗
(expression *ast.Node)

Source from the content-addressed store, hash-verified

14912}
14913
14914func (c *Checker) getTargetOfAliasLikeExpression(expression *ast.Node) *ast.Symbol {
14915 if ast.IsClassExpression(expression) {
14916 return c.checkExpressionCached(expression).symbol
14917 }
14918 if !ast.IsEntityName(expression) && !ast.IsEntityNameExpression(expression) {
14919 return nil
14920 }
14921 aliasLike := c.resolveEntityName(expression, ast.SymbolFlagsValue|ast.SymbolFlagsType|ast.SymbolFlagsNamespace, true /*ignoreErrors*/, true /*dontResolveAlias*/, nil /*location*/)
14922 if aliasLike != nil {
14923 return aliasLike
14924 }
14925 c.checkExpressionCached(expression)
14926 return c.getResolvedSymbolOrNil(expression)
14927}
14928
14929func (c *Checker) getTargetOfNamespaceExportDeclaration(node *ast.Node) *ast.Symbol {
14930 if ast.CanHaveSymbol(node.Parent) {

Calls 6

checkExpressionCachedMethod · 0.95
resolveEntityNameMethod · 0.95
IsClassExpressionFunction · 0.92
IsEntityNameFunction · 0.92
IsEntityNameExpressionFunction · 0.92

Tested by

no test coverage detected