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

Function getCloseTokenForOpenToken

internal/format/util.go:65–76  ·  view source on GitHub ↗
(kind ast.Kind)

Source from the content-addressed store, hash-verified

63}
64
65func getCloseTokenForOpenToken(kind ast.Kind) ast.Kind {
66 // TODO: matches strada - seems like it could handle more pairs of braces, though? [] notably missing
67 switch kind {
68 case ast.KindOpenParenToken:
69 return ast.KindCloseParenToken
70 case ast.KindLessThanToken:
71 return ast.KindGreaterThanToken
72 case ast.KindOpenBraceToken:
73 return ast.KindCloseBraceToken
74 }
75 return ast.KindUnknown
76}
77
78func GetLineStartPositionForPosition(position int, sourceFile *ast.SourceFile) int {
79 lineStarts := scanner.GetECMALineStarts(sourceFile)

Callers 1

processChildNodesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected