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

Method TokenSourceMapRange

internal/printer/emitcontext.go:618–625  ·  view source on GitHub ↗

Gets the range for a token of a node when emitting source maps.

(node *ast.Node, kind ast.Kind)

Source from the content-addressed store, hash-verified

616
617// Gets the range for a token of a node when emitting source maps.
618func (c *EmitContext) TokenSourceMapRange(node *ast.Node, kind ast.Kind) (core.TextRange, bool) {
619 if emitNode := c.emitNodes.TryGet(node); emitNode != nil && emitNode.tokenSourceMapRanges != nil {
620 if loc, ok := emitNode.tokenSourceMapRanges[kind]; ok {
621 return loc, true
622 }
623 }
624 return core.TextRange{}, false
625}
626
627// Sets the range for a token of a node when emitting source maps.
628func (c *EmitContext) SetTokenSourceMapRange(node *ast.Node, kind ast.Kind, loc core.TextRange) {

Callers 1

Calls 1

TryGetMethod · 0.80

Tested by

no test coverage detected