word_at

Function word_at 

Source
pub fn word_at(text: &str, offset: u32) -> Option<String>
Expand description

The identifier the cursor is inside or immediately after.

“Immediately after” matters: an editor sends the position of the caret, and a caret at the end of total is one byte past the l. A server that only looked at the byte under the caret would answer nothing for the most common way of asking.