diff options
author | Wilco Kusee <[email protected]> | 2019-11-29 14:27:22 +0000 |
---|---|---|
committer | Wilco Kusee <[email protected]> | 2019-11-29 14:27:22 +0000 |
commit | f081c9d94dcc7a06e9c224e6b113a563d474ad18 (patch) | |
tree | eff6a5cfb4789df0c76fe3c17efd718b451b8a42 /crates/ra_lsp_server/src/main_loop | |
parent | 9c764cb966cd62d8eaa83fbb7d91646a850dc256 (diff) |
Also allow renaming to underscore
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 137f26302..0380788ac 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -508,7 +508,9 @@ pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result<Optio | |||
508 | 508 | ||
509 | // Only rename to valid identifiers | 509 | // Only rename to valid identifiers |
510 | let tokens = tokenize(¶ms.new_name); | 510 | let tokens = tokenize(¶ms.new_name); |
511 | if tokens.len() != 1 || tokens[0].kind != SyntaxKind::IDENT { | 511 | if tokens.len() != 1 |
512 | || (tokens[0].kind != SyntaxKind::IDENT && tokens[0].kind != SyntaxKind::UNDERSCORE) | ||
513 | { | ||
512 | return Ok(None); | 514 | return Ok(None); |
513 | } | 515 | } |
514 | 516 | ||