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

Function GetScannerForSourceFile

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

Source from the content-addressed store, hash-verified

2504}
2505
2506func GetScannerForSourceFile(sourceFile *ast.SourceFile, pos int) *Scanner {
2507 s := NewScanner()
2508 s.text = sourceFile.Text()
2509 s.pos = pos
2510 s.end = len(s.text)
2511 s.languageVariant = sourceFile.LanguageVariant
2512 s.Scan()
2513 return s
2514}
2515
2516func ScanTokenAtPosition(sourceFile *ast.SourceFile, pos int) ast.Kind {
2517 s := GetScannerForSourceFile(sourceFile, pos)

Callers 15

getTokenFromNodeListFunction · 0.92
nodeEndsWithFunction · 0.92
GetLastChildFunction · 0.92
GetFirstTokenFunction · 0.92
promoteFromTypeOnlyFunction · 0.92
deleteTypeKeywordFunction · 0.92
getTokenAtPositionFunction · 0.92
findRightmostValidTokenFunction · 0.92
FindNextTokenFunction · 0.92
FindChildOfKindFunction · 0.92
getVisualListRangeFunction · 0.92

Calls 4

ScanMethod · 0.95
NewScannerFunction · 0.85
lenFunction · 0.85
TextMethod · 0.65

Tested by

no test coverage detected