From 9c764cb966cd62d8eaa83fbb7d91646a850dc256 Mon Sep 17 00:00:00 2001 From: Wilco Kusee Date: Fri, 29 Nov 2019 15:14:42 +0100 Subject: Only allow renames to valid identifiers --- crates/ra_lsp_server/src/main_loop/handlers.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src') diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index c81fa7f67..137f26302 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs @@ -13,7 +13,7 @@ use ra_ide::{ AssistId, FileId, FilePosition, FileRange, Query, Runnable, RunnableKind, SearchScope, }; use ra_prof::profile; -use ra_syntax::{AstNode, SyntaxKind, TextRange, TextUnit}; +use ra_syntax::{tokenize, AstNode, SyntaxKind, TextRange, TextUnit}; use rustc_hash::FxHashMap; use serde::{Deserialize, Serialize}; use serde_json::to_value; @@ -506,6 +506,12 @@ pub fn handle_rename(world: WorldSnapshot, params: RenameParams) -> Result return Ok(None), -- cgit v1.2.3