* The token on the left of the position is the token that strictly includes the position * or sits to the left of the cursor if it is on a boundary. For example * * fo|o -> will return foo * foo |bar -> will return foo *
(file, position)
| 127523 | * |
| 127524 | */ |
| 127525 | function findTokenOnLeftOfPosition(file, position) { |
| 127526 | // Ideally, getTokenAtPosition should return a token. However, it is currently |
| 127527 | // broken, so we do a check to make sure the result was indeed a token. |
| 127528 | var tokenAtPosition = getTokenAtPosition(file, position); |
| 127529 | if (ts.isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { |
| 127530 | return tokenAtPosition; |
| 127531 | } |
| 127532 | return findPrecedingToken(position, file); |
| 127533 | } |
| 127534 | ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; |
| 127535 | function findNextToken(previousToken, parent, sourceFile) { |
| 127536 | return find(parent); |
nothing calls this directly
no test coverage detected