diff options
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index a29971d10..530c4d8b6 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -144,12 +144,8 @@ pub fn handle_on_type_formatting( | |||
144 | // in `ra_ide_api`, the `on_type` invariant is that | 144 | // in `ra_ide_api`, the `on_type` invariant is that |
145 | // `text.char_at(position) == typed_char`. | 145 | // `text.char_at(position) == typed_char`. |
146 | position.offset = position.offset - TextUnit::of_char('.'); | 146 | position.offset = position.offset - TextUnit::of_char('.'); |
147 | 147 | let char_typed = params.ch.chars().next().unwrap_or('\0'); | |
148 | let edit = match params.ch.as_str() { | 148 | let edit = world.analysis().on_char_typed(position, char_typed)?; |
149 | "=" => world.analysis().on_eq_typed(position), | ||
150 | "." => world.analysis().on_dot_typed(position), | ||
151 | _ => return Ok(None), | ||
152 | }?; | ||
153 | let mut edit = match edit { | 149 | let mut edit = match edit { |
154 | Some(it) => it, | 150 | Some(it) => it, |
155 | None => return Ok(None), | 151 | None => return Ok(None), |