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

Function GetDeclarationContainer

internal/ast/utilities.go:2571–2585  ·  view source on GitHub ↗
(node *Node)

Source from the content-addressed store, hash-verified

2569}
2570
2571func GetDeclarationContainer(node *Node) *Node {
2572 return FindAncestor(GetRootDeclaration(node), func(node *Node) bool {
2573 switch node.Kind {
2574 case KindVariableDeclaration,
2575 KindVariableDeclarationList,
2576 KindImportSpecifier,
2577 KindNamedImports,
2578 KindNamespaceImport,
2579 KindImportClause:
2580 return false
2581 default:
2582 return true
2583 }
2584 }).Parent
2585}
2586
2587// Indicates that a symbol is an alias that does not merge with a local declaration.
2588// OR Is a JSContainer which may merge an alias with a local declaration

Calls 2

FindAncestorFunction · 0.85
GetRootDeclarationFunction · 0.85

Tested by

no test coverage detected