From b3856568af3a21bfd13584e06fce852f84811fdb Mon Sep 17 00:00:00 2001 From: Wilco Kusee Date: Fri, 29 Nov 2019 16:06:20 +0100 Subject: Push identifier check to rename function --- crates/ra_ide/src/lib.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'crates/ra_ide/src/lib.rs') diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 1f88791d7..d1bff4a76 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -56,7 +56,7 @@ use ra_db::{ salsa::{self, ParallelDatabase}, CheckCanceled, Env, FileLoader, SourceDatabase, }; -use ra_syntax::{tokenize, SourceFile, SyntaxKind, TextRange, TextUnit}; +use ra_syntax::{SourceFile, TextRange, TextUnit}; use crate::{db::LineIndexDatabase, display::ToNav, symbol_index::FileSymbol}; @@ -470,13 +470,6 @@ impl Analysis { position: FilePosition, new_name: &str, ) -> Cancelable>> { - let tokens = tokenize(new_name); - if tokens.len() != 1 - || (tokens[0].kind != SyntaxKind::IDENT && tokens[0].kind != SyntaxKind::UNDERSCORE) - { - return Ok(None); - } - self.with_db(|db| references::rename(db, position, new_name)) } -- cgit v1.2.3