From fdd4df97ba5ce1f59abf9e945052fc6f3e077c3a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 6 May 2020 15:26:40 +0200 Subject: Use SourceChange for assists --- crates/ra_assists/src/lib.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'crates/ra_assists/src/lib.rs') diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index f4f37614f..8cd8f89c4 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs @@ -19,9 +19,8 @@ pub mod ast_transform; use hir::Semantics; use ra_db::{FileId, FileRange}; -use ra_ide_db::RootDatabase; -use ra_syntax::{TextRange, TextSize}; -use ra_text_edit::TextEdit; +use ra_ide_db::{source_change::SourceChange, RootDatabase}; +use ra_syntax::TextRange; pub(crate) use crate::assist_ctx::{Assist, AssistCtx}; @@ -57,21 +56,14 @@ impl AssistLabel { } } -#[derive(Debug, Clone)] -pub struct AssistAction { - pub edit: TextEdit, - pub cursor_position: Option, - pub file: AssistFile, -} - #[derive(Debug, Clone)] pub struct ResolvedAssist { pub label: AssistLabel, - pub action: AssistAction, + pub action: SourceChange, } #[derive(Debug, Clone, Copy)] -pub enum AssistFile { +enum AssistFile { CurrentFile, TargetFile(FileId), } -- cgit v1.2.3