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

Function GetRangeOfTokenAtPosition

internal/scanner/scanner.go:2521–2524  ·  view source on GitHub ↗
(sourceFile *ast.SourceFile, pos int)

Source from the content-addressed store, hash-verified

2519}
2520
2521func GetRangeOfTokenAtPosition(sourceFile *ast.SourceFile, pos int) core.TextRange {
2522 s := GetScannerForSourceFile(sourceFile, pos)
2523 return core.NewTextRange(s.tokenStart, s.pos)
2524}
2525
2526func GetTokenPosOfNode(node *ast.Node, sourceFile *ast.SourceFile, includeJSDoc bool) int {
2527 // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't*

Callers 7

errorOnFirstTokenMethod · 0.92
GetErrorRangeForNodeFunction · 0.85

Calls 2

NewTextRangeFunction · 0.92
GetScannerForSourceFileFunction · 0.85

Tested by

no test coverage detected