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

Function withTokenStart

internal/format/context.go:73–76  ·  view source on GitHub ↗
(loc *ast.Node, file *ast.SourceFile)

Source from the content-addressed store, hash-verified

71}
72
73func withTokenStart(loc *ast.Node, file *ast.SourceFile) core.TextRange {
74 startPos := scanner.GetTokenPosOfNode(loc, file, false)
75 return core.NewTextRange(startPos, loc.End())
76}
77
78func (this *FormattingContext) blockIsOnOneLine(node *ast.Node) core.Tristate {
79 openBrace := astnav.FindChildOfKind(node, ast.KindOpenBraceToken, this.SourceFile)

Callers 7

findEnclosingNodeFunction · 0.85
getScanStartPositionFunction · 0.85
getOwnOrInheritedDeltaFunction · 0.85
executeMethod · 0.85
processNodeMethod · 0.85
nodeIsOnOneLineMethod · 0.85

Calls 3

GetTokenPosOfNodeFunction · 0.92
NewTextRangeFunction · 0.92
EndMethod · 0.65

Tested by

no test coverage detected