We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29bdd43 commit 8f8980cCopy full SHA for 8f8980c
crates/rust-analyzer/src/main_loop/handlers.rs
@@ -184,6 +184,10 @@ pub fn handle_on_type_formatting(
184
// `text.char_at(position) == typed_char`.
185
position.offset -= TextUnit::of_char('.');
186
let char_typed = params.ch.chars().next().unwrap_or('\0');
187
+ assert!({
188
+ let text = world.analysis().file_text(position.file_id)?;
189
+ text[position.offset.to_usize()..].starts_with(char_typed)
190
+ });
191
192
// We have an assist that inserts ` ` after typing `->` in `fn foo() ->{`,
193
// but it requires precise cursor positioning to work, and one can't
0 commit comments