| 63 | } |
| 64 | |
| 65 | func 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 | |
| 78 | func GetLineStartPositionForPosition(position int, sourceFile *ast.SourceFile) int { |
| 79 | lineStarts := scanner.GetECMALineStarts(sourceFile) |