Skip to main content

identifier_at

Function identifier_at 

pub fn identifier_at(text: &str, offset: usize) -> Option<(String, Span)>
Expand description

The identifier-ish token covering offset — its text and span.

Hole-aware (issue #473): interpolation holes are expanded, so a cursor inside "… \(name) …" lands on the hole’s identifier token rather than the opaque InterpStr token. The token-kind filter is wider than Ident because the literal kinds carry hover-worthy names too (Result, Option, Effect).