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

Method addDeepCloneReparse

internal/parser/reparser.go:26–32  ·  view source on GitHub ↗

Deep-clone the given node and add the clone to the reparsed clone list. The list is used by ast.GetReparsedNodeForNode to locate reparsed clones of JSDoc nodes. Since the binder attaches symbols to reparsed nodes and not to JSDoc nodes, we need the mapping when obtaining symbols and types from JSDoc

(node *ast.Node)

Source from the content-addressed store, hash-verified

24// to locate reparsed clones of JSDoc nodes. Since the binder attaches symbols to reparsed nodes and not to JSDoc nodes, we
25// need the mapping when obtaining symbols and types from JSDoc nodes.
26func (p *Parser) addDeepCloneReparse(node *ast.Node) *ast.Node {
27 clone := p.factory.DeepCloneReparse(node)
28 if clone != nil {
29 p.reparsedClones = append(p.reparsedClones, clone)
30 }
31 return clone
32}
33
34func (p *Parser) addTransformedReparse(newNode *ast.Node, old *ast.Node) *ast.Node {
35 p.finishReparsedNode(newNode, old)

Callers 6

reparseUnhostedMethod · 0.95
reparseJSDocSignatureMethod · 0.95
gatherTypeParametersMethod · 0.95
reparseHostedMethod · 0.95
wrapInJSDocNamespaceMethod · 0.95

Calls 2

DeepCloneReparseMethod · 0.80
appendFunction · 0.50

Tested by

no test coverage detected