diff options
author | Aleksey Kladov <[email protected]> | 2019-10-25 09:19:26 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-25 09:30:46 +0100 |
commit | 8d2fd59cfb00211573419b0a59cf91d92d636f5a (patch) | |
tree | feafe88a932c70aa9e25a6b87323094e2b40b750 /crates/ra_lsp_server | |
parent | 518f99e16b993e3414a81181c8bad7a89e590ece (diff) |
make typing infra slightly more extensible
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), |