From fda70badf8957eba6650cc12d2f485d5e213bb82 Mon Sep 17 00:00:00 2001 From: Sergey Parilin Date: Fri, 22 Mar 2019 15:24:43 +0300 Subject: [PATCH] line_index and line_index_utils moved to ra_ide_api --- Cargo.lock | 2 ++ crates/ra_ide_api/Cargo.toml | 2 ++ crates/ra_ide_api/src/lib.rs | 5 ++++- crates/{ra_ide_api_light => ra_ide_api}/src/line_index.rs | 0 .../{ra_ide_api_light => ra_ide_api}/src/line_index_utils.rs | 0 crates/ra_ide_api_light/src/lib.rs | 4 ---- 6 files changed, 8 insertions(+), 5 deletions(-) rename crates/{ra_ide_api_light => ra_ide_api}/src/line_index.rs (100%) rename crates/{ra_ide_api_light => ra_ide_api}/src/line_index_utils.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 50fe1fa23b..9c7afe74b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1005,6 +1005,7 @@ dependencies = [ "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proptest 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "ra_assists 0.1.0", "ra_db 0.1.0", "ra_hir 0.1.0", @@ -1014,6 +1015,7 @@ dependencies = [ "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", "unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml index 40b7a8d0a3..ac8c8057bc 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide_api/Cargo.toml @@ -14,6 +14,7 @@ fst = "0.3.1" rustc-hash = "1.0" parking_lot = "0.7.0" unicase = "2.2.0" +superslice = "1.0.0" jemallocator = { version = "0.1.9", optional = true } jemalloc-ctl = { version = "0.2.0", optional = true } @@ -28,6 +29,7 @@ ra_assists = { path = "../ra_assists" } [dev-dependencies] insta = "0.7.0" +proptest = "0.9.0" [features] jemalloc = [ "jemallocator", "jemalloc-ctl" ] diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 81ca57035f..35f38fbb7b 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -33,6 +33,8 @@ mod impls; mod assists; mod diagnostics; mod syntax_tree; +mod line_index; +mod line_index_utils; #[cfg(test)] mod marks; @@ -60,10 +62,11 @@ pub use crate::{ references::ReferenceSearchResult, assists::{Assist, AssistId}, hover::{HoverResult}, + line_index::{LineIndex, LineCol}, + line_index_utils::translate_offset_with_edit, }; pub use ra_ide_api_light::{ Fold, FoldKind, HighlightedRange, Severity, StructureNode, LocalEdit, - LineIndex, LineCol, translate_offset_with_edit, }; pub use ra_db::{ Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId, diff --git a/crates/ra_ide_api_light/src/line_index.rs b/crates/ra_ide_api/src/line_index.rs similarity index 100% rename from crates/ra_ide_api_light/src/line_index.rs rename to crates/ra_ide_api/src/line_index.rs diff --git a/crates/ra_ide_api_light/src/line_index_utils.rs b/crates/ra_ide_api/src/line_index_utils.rs similarity index 100% rename from crates/ra_ide_api_light/src/line_index_utils.rs rename to crates/ra_ide_api/src/line_index_utils.rs diff --git a/crates/ra_ide_api_light/src/lib.rs b/crates/ra_ide_api_light/src/lib.rs index 47b30255b9..556d44c259 100644 --- a/crates/ra_ide_api_light/src/lib.rs +++ b/crates/ra_ide_api_light/src/lib.rs @@ -4,8 +4,6 @@ //! an edit or some auxiliary info. mod folding_ranges; -mod line_index; -mod line_index_utils; mod structure; #[cfg(test)] mod test_utils; @@ -23,8 +21,6 @@ use ra_syntax::{ pub use crate::{ folding_ranges::{folding_ranges, Fold, FoldKind}, - line_index::{LineCol, LineIndex}, - line_index_utils::translate_offset_with_edit, structure::{file_structure, StructureNode}, join_lines::join_lines, typing::{on_enter, on_dot_typed, on_eq_typed},