Which token an overlay ref claims — the whole point of the atomisation.
(result: HighlightResult, line: number, ref: LineRef)
| 63 | |
| 64 | /** Which token an overlay ref claims — the whole point of the atomisation. */ |
| 65 | function claimedText(result: HighlightResult, line: number, ref: LineRef): string | undefined { |
| 66 | const tokens = tokensOf(result, line); |
| 67 | const claimed = assignRefs(tokens, [ref]); |
| 68 | const [index] = [...claimed.keys()]; |
| 69 | return index === undefined ? undefined : tokens[index]?.text; |
| 70 | } |
| 71 | |
| 72 | describe('which languages classify', () => { |
| 73 | it('answers for every language the engine indexes, without throwing', () => { |
no test coverage detected