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

Method UpdateSourceFile

internal/ast/ast.go:2691–2698  ·  view source on GitHub ↗
(node *SourceFile, statements *StatementList, endOfFileToken *TokenNode)

Source from the content-addressed store, hash-verified

2689}
2690
2691func (f *NodeFactory) UpdateSourceFile(node *SourceFile, statements *StatementList, endOfFileToken *TokenNode) *Node {
2692 if statements != node.Statements || endOfFileToken != node.EndOfFileToken {
2693 updated := f.NewSourceFile(node.parseOptions, node.text, statements, endOfFileToken).AsSourceFile()
2694 updated.copyFrom(node)
2695 return updateNode(updated.AsNode(), node.AsNode(), f.hooks)
2696 }
2697 return node.AsNode()
2698}
2699
2700func (node *SourceFile) ECMALineMap() []core.TextPos {
2701 node.ecmaLineMapMu.RLock()

Callers 8

transformSourceFileMethod · 0.80
visitSourceFileMethod · 0.80
visitSourceFileMethod · 0.80
visitSourceFileMethod · 0.80
visitSourceFileMethod · 0.80
visitSourceFileMethod · 0.80
VisitEachChildMethod · 0.80

Calls 5

NewSourceFileMethod · 0.95
updateNodeFunction · 0.85
AsSourceFileMethod · 0.80
AsNodeMethod · 0.65
copyFromMethod · 0.45

Tested by

no test coverage detected