Skip to main content

ident_ending_at

Function ident_ending_at 

Source
pub fn ident_ending_at(text: &str, end: usize) -> Option<(&str, usize)>
Expand description

The identifier run ending at byte end in text(name, start) — the trim-back-to-a-non-identifier-boundary scan shared by every receiver/ identifier extraction in the LSP: value_receiver_rewrite above, symbols::receiver_segment_at (a member’s receiver, dot-preceded), and symbols::store_field_kind_at (a bare receiver’s own end offset, no dot). Each has different preconditions on what precedes end, but the boundary scan itself — walk back to the nearest non-identifier char, respecting UTF-8 boundaries — is one definition, so it can’t drift between them (a review flagged the previous three near-identical copies). None if nothing identifier-shaped precedes end.