MCPcopy
hub / github.com/microsoft/typescript-go / MostOriginal

Method MostOriginal

internal/printer/emitcontext.go:487–496  ·  view source on GitHub ↗

Gets the most original node associated with this node by walking Original pointers. NOTE: This method is analogous to `getOriginalNode` in the old compiler, but the name has changed to avoid accidental conflation with `SetOriginal`/`Original`

(node *ast.Node)

Source from the content-addressed store, hash-verified

485// NOTE: This method is analogous to `getOriginalNode` in the old compiler, but the name has changed to avoid accidental
486// conflation with `SetOriginal`/`Original`
487func (c *EmitContext) MostOriginal(node *ast.Node) *ast.Node {
488 if node != nil {
489 original := c.Original(node)
490 for original != nil {
491 node = original
492 original = c.Original(node)
493 }
494 }
495 return node
496}
497
498// Gets the original parse tree node for a given node.
499//

Callers 15

ParseNodeMethod · 0.95
getTextOfNodeMethod · 0.80
hasTrailingCommaMethod · 0.80
setSourceFileMethod · 0.80
symbolToTypeNodeMethod · 0.80
setTextRangeMethod · 0.80
IsOriginalNodeSingleLineFunction · 0.80
isInternalDeclarationMethod · 0.80

Calls 1

OriginalMethod · 0.95

Tested by

no test coverage detected