Returns a token if position is in [start-of-leading-trivia, end), includes JSDoc only in JS files
(sourceFile, position)
| 118071 | } |
| 118072 | /** Returns a token if position is in [start-of-leading-trivia, end), includes JSDoc only in JS files */ |
| 118073 | function getNodeAtPosition(sourceFile, position) { |
| 118074 | var current = sourceFile; |
| 118075 | var getContainingChild = function (child) { |
| 118076 | if (child.pos <= position && (position < child.end || (position === child.end && (child.kind === 1 /* SyntaxKind.EndOfFileToken */)))) { |
| 118077 | return child; |
| 118078 | } |
| 118079 | }; |
| 118080 | while (true) { |
| 118081 | var child = isJavaScriptFile && ts.hasJSDocNodes(current) && ts.forEach(current.jsDoc, getContainingChild) || ts.forEachChild(current, getContainingChild); |
| 118082 | if (!child) { |
| 118083 | return current; |
| 118084 | } |
| 118085 | current = child; |
| 118086 | } |
| 118087 | } |
| 118088 | } |
| 118089 | function getLibFileFromReference(ref) { |
| 118090 | var libName = ts.toFileNameLowerCase(ref.fileName); |
no test coverage detected