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

Method JSDoc

internal/ast/ast.go:1560–1574  ·  view source on GitHub ↗

if you provide nil for file, this code will walk to the root of the tree to find the file

(file *SourceFile)

Source from the content-addressed store, hash-verified

1558
1559// if you provide nil for file, this code will walk to the root of the tree to find the file
1560func (node *Node) JSDoc(file *SourceFile) []*Node {
1561 if node.Flags&NodeFlagsHasJSDoc == 0 {
1562 return nil
1563 }
1564 if file == nil {
1565 file = GetSourceFileOfNode(node)
1566 if file == nil {
1567 return nil
1568 }
1569 }
1570 if file.hasLazyJSDoc {
1571 return file.resolveJSDoc(node)
1572 }
1573 return file.jsdocCache[node]
1574}
1575
1576// EagerJSDoc returns JSDoc nodes that have already been parsed and cached,
1577// without triggering lazy JSDoc parsing.

Callers 15

getSmartSelectionRangeFunction · 0.95
getJSDocFunction · 0.80
hasJSDocTagsFunction · 0.80
declarationJSDocTagsFunction · 0.80
hasJSDocNodesFunction · 0.80
getAllJSDocTagsFunction · 0.80
GetNameTableMethod · 0.80
GetJSDocDeprecatedTagFunction · 0.80
GetNodeAtPositionFunction · 0.80
ForEachChildAndJSDocFunction · 0.80

Calls 2

GetSourceFileOfNodeFunction · 0.85
resolveJSDocMethod · 0.80

Tested by

no test coverage detected