Skip to main content

is_keyword_position

Function is_keyword_position 

Source
pub fn is_keyword_position(line: &str) -> bool
Expand description

A bare word at a declaration/statement start: the line up to the cursor is only leading whitespace plus an optional partial identifier (no operators, colons, or brackets). Fires on an empty line too. Disjoint from is_type_position, whose triggers (:/->/[) make this false.