From 7344d28768c43d8955bf23c183d606be08f27c64 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Mon, 10 Dec 2018 22:09:12 +0100 Subject: extract AtomEdit and Edit into new ra_text_edit crate --- crates/ra_analysis/src/completion.rs | 3 ++- crates/ra_analysis/src/lib.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ra_analysis/src') diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index 0f154112a..e83330966 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs @@ -1,10 +1,11 @@ mod reference_completion; use ra_editor::find_node_at_offset; +use ra_text_edit::AtomEdit; use ra_syntax::{ algo::visit::{visitor_ctx, VisitorCtx}, ast, - AstNode, AtomEdit, + AstNode, SyntaxNodeRef, }; use ra_db::SyntaxDatabase; diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index eaf24cb36..2f8f1dab5 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -18,7 +18,8 @@ pub mod mock_analysis; use std::{fmt, sync::Arc}; -use ra_syntax::{AtomEdit, SourceFileNode, TextRange, TextUnit}; +use ra_syntax::{SourceFileNode, TextRange, TextUnit}; +use ra_text_edit::AtomEdit; use ra_db::FileResolverImp; use rayon::prelude::*; use relative_path::RelativePathBuf; -- cgit v1.2.3 From 0527e3b283af0153cf13fa64fe73862a5b7655c8 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Tue, 11 Dec 2018 19:07:17 +0100 Subject: rename Edit to TextEdit and AtomEdit to AtomTextEdit --- crates/ra_analysis/src/completion.rs | 4 ++-- crates/ra_analysis/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src') diff --git a/crates/ra_analysis/src/completion.rs b/crates/ra_analysis/src/completion.rs index e83330966..f480af611 100644 --- a/crates/ra_analysis/src/completion.rs +++ b/crates/ra_analysis/src/completion.rs @@ -1,7 +1,7 @@ mod reference_completion; use ra_editor::find_node_at_offset; -use ra_text_edit::AtomEdit; +use ra_text_edit::AtomTextEdit; use ra_syntax::{ algo::visit::{visitor_ctx, VisitorCtx}, ast, @@ -34,7 +34,7 @@ pub(crate) fn completions( let original_file = db.source_file(position.file_id); // Insert a fake ident to get a valid parse tree let file = { - let edit = AtomEdit::insert(position.offset, "intellijRulezz".to_string()); + let edit = AtomTextEdit::insert(position.offset, "intellijRulezz".to_string()); original_file.reparse(&edit) }; diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 2f8f1dab5..22fff71ab 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs @@ -19,7 +19,7 @@ pub mod mock_analysis; use std::{fmt, sync::Arc}; use ra_syntax::{SourceFileNode, TextRange, TextUnit}; -use ra_text_edit::AtomEdit; +use ra_text_edit::AtomTextEdit; use ra_db::FileResolverImp; use rayon::prelude::*; use relative_path::RelativePathBuf; @@ -121,7 +121,7 @@ pub struct SourceChange { #[derive(Debug)] pub struct SourceFileNodeEdit { pub file_id: FileId, - pub edits: Vec, + pub edits: Vec, } #[derive(Debug)] -- cgit v1.2.3