MCPcopy Index your code
hub / github.com/microsoft/typescript-go / ECMALineMap

Method ECMALineMap

internal/ast/ast.go:2700–2714  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2698}
2699
2700func (node *SourceFile) ECMALineMap() []core.TextPos {
2701 node.ecmaLineMapMu.RLock()
2702 lineMap := node.ecmaLineMap
2703 node.ecmaLineMapMu.RUnlock()
2704 if lineMap == nil {
2705 node.ecmaLineMapMu.Lock()
2706 defer node.ecmaLineMapMu.Unlock()
2707 lineMap = node.ecmaLineMap
2708 if lineMap == nil {
2709 lineMap = core.ComputeECMALineStarts(node.Text())
2710 node.ecmaLineMap = lineMap
2711 }
2712 }
2713 return lineMap
2714}
2715
2716// GetNameTable returns a map of all names in the file to their positions.
2717// If the name appears more than once, the value is -1.

Callers

nothing calls this directly

Calls 4

TextMethod · 0.95
ComputeECMALineStartsFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected