aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index 6f1e59b4b..16fb07266 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -146,6 +146,15 @@ pub fn handle_on_type_formatting(
146 // `text.char_at(position) == typed_char`. 146 // `text.char_at(position) == typed_char`.
147 position.offset = position.offset - TextUnit::of_char('.'); 147 position.offset = position.offset - TextUnit::of_char('.');
148 let char_typed = params.ch.chars().next().unwrap_or('\0'); 148 let char_typed = params.ch.chars().next().unwrap_or('\0');
149
150 // We have an assist that inserts ` ` after typing `->` in `fn foo() ->{`,
151 // but it requires precise cursor positioning to work, and one can't
152 // position the cursor with on_type formatting. So, let's just toggle this
153 // feature off here, hoping that we'll enable it one day, 😿.
154 if char_typed == '>' {
155 return Ok(None);
156 }
157
149 let edit = world.analysis().on_char_typed(position, char_typed)?; 158 let edit = world.analysis().on_char_typed(position, char_typed)?;
150 let mut edit = match edit { 159 let mut edit = match edit {
151 Some(it) => it, 160 Some(it) => it,