Document d; d.setContent(`void main() { writeln("hello world"); }`); assert(d.wordRangeAt(0) == [0, 4]); assert(d.wordRangeAt(3) == [0, 4]); assert(d.wordRangeAt(4) == [0, 4]); assert(d.wordRangeAt(5) == [5, 9]); assert(d.wordRangeAt(9) == [5, 9]); assert(d.wordRangeAt(10) == [10, 10]); assert(d.wordRangeAt(14) == [14, 21]); assert(d.wordRangeAt(20) == [14, 21]); assert(d.wordRangeAt(21) == [14, 21]); assert(d.wordRangeAt(23) == [23, 28]); assert(d.wordRangeAt(27) == [23, 28]); assert(d.wordRangeAt(28) == [23, 28]); assert(d.wordRangeAt(29) == [29, 34]); assert(d.wordRangeAt(30) == [29, 34]); assert(d.wordRangeAt(34) == [29, 34]);
Returns the word range at a given byte position.