]> git.lizzy.rs Git - rust.git/commitdiff
fix usages after rename
authorAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 8 Jan 2019 19:30:32 +0000 (22:30 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Tue, 8 Jan 2019 19:30:32 +0000 (22:30 +0300)
Cargo.lock
crates/ra_analysis/Cargo.toml
crates/ra_analysis/src/extend_selection.rs
crates/ra_analysis/src/imp.rs
crates/ra_analysis/src/lib.rs
crates/ra_analysis/src/syntax_highlighting.rs
crates/ra_cli/Cargo.toml
crates/ra_cli/src/main.rs
crates/ra_ide_api_light/Cargo.toml
crates/ra_ide_api_light/src/lib.rs

index f1d8e5462c291e4b47d956bdebca949f0ae6b0ac..f99a0342432e7cde06adf0cbaf6b1f161e366507 100644 (file)
@@ -171,7 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "crossbeam-utils 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -548,7 +548,7 @@ version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -645,8 +645,8 @@ dependencies = [
  "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)",
  "ra_db 0.1.0",
- "ra_editor 0.1.0",
  "ra_hir 0.1.0",
+ "ra_ide_api_light 0.1.0",
  "ra_syntax 0.1.0",
  "ra_text_edit 0.1.0",
  "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -668,7 +668,7 @@ dependencies = [
  "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "ra_editor 0.1.0",
+ "ra_ide_api_light 0.1.0",
  "ra_syntax 0.1.0",
  "tools 0.1.0",
 ]
@@ -686,20 +686,6 @@ dependencies = [
  "test_utils 0.1.0",
 ]
 
-[[package]]
-name = "ra_editor"
-version = "0.1.0"
-dependencies = [
- "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "ra_syntax 0.1.0",
- "ra_text_edit 0.1.0",
- "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "superslice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "test_utils 0.1.0",
-]
-
 [[package]]
 name = "ra_hir"
 version = "0.1.0"
@@ -718,6 +704,20 @@ dependencies = [
  "test_utils 0.1.0",
 ]
 
+[[package]]
+name = "ra_ide_api_light"
+version = "0.1.0"
+dependencies = [
+ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "join_to_string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ra_syntax 0.1.0",
+ "ra_text_edit 0.1.0",
+ "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "superslice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "test_utils 0.1.0",
+]
+
 [[package]]
 name = "ra_lsp_server"
 version = "0.1.0"
@@ -806,7 +806,7 @@ dependencies = [
 
 [[package]]
 name = "rand"
-version = "0.6.3"
+version = "0.6.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -815,7 +815,7 @@ dependencies = [
  "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand_os 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -861,13 +861,14 @@ dependencies = [
 
 [[package]]
 name = "rand_os"
-version = "0.1.0"
+version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
  "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -909,6 +910,14 @@ dependencies = [
  "num_cpus 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "rdrand"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "redox_syscall"
 version = "0.1.50"
@@ -1164,7 +1173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)",
  "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1551,17 +1560,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0"
 "checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c"
 "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
-"checksum rand 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b65e163105a6284f841bd23100a015895f54340e88a5ffc9ca7b8b33827cfce0"
+"checksum rand 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3906503e80ac6cbcacb2c2973fa8e473f24d7e2747c8c92bb230c2441cad96b5"
 "checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
 "checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372"
 "checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
 "checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
 "checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
-"checksum rand_os 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de5ac4de1c2973e1391dc305cb0fbf8788cb58068e98255439b7485a77022273"
+"checksum rand_os 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f46fbd5550acf75b0c2730f5dd1873751daf9beb8f11b44027778fae50d7feca"
 "checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
 "checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
 "checksum rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "373814f27745b2686b350dd261bfd24576a6fb0e2c5919b3a2b6005f820b0473"
 "checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
+"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
 "checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2"
 "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
 "checksum regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "37e7cbbd370869ce2e8dff25c7018702d10b21a20ef7135316f8daecd6c25b7f"
index 11c78ced82c48745dfab179a28b5464db3901936..3c08142795c3355f92a4fedff2ab0a00b016af71 100644 (file)
@@ -16,7 +16,7 @@ parking_lot = "0.7.0"
 unicase = "2.2.0"
 
 ra_syntax = { path = "../ra_syntax" }
-ra_editor = { path = "../ra_editor" }
+ra_ide_api_light = { path = "../ra_ide_api_light" }
 ra_text_edit = { path = "../ra_text_edit" }
 ra_db = { path = "../ra_db" }
 hir = { path = "../ra_hir", package = "ra_hir" }
index 3b130f96648d3879d9c34eb85fc0ecab22f1a65d..c3c809c9fe3369c09af8d9ade57ad9e97821fc76 100644 (file)
@@ -14,7 +14,7 @@ pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRang
     if let Some(range) = extend_selection_in_macro(db, &source_file, frange) {
         return range;
     }
-    ra_editor::extend_selection(source_file.syntax(), frange.range).unwrap_or(frange.range)
+    ra_ide_api_light::extend_selection(source_file.syntax(), frange.range).unwrap_or(frange.range)
 }
 
 fn extend_selection_in_macro(
@@ -25,7 +25,7 @@ fn extend_selection_in_macro(
     let macro_call = find_macro_call(source_file.syntax(), frange.range)?;
     let (off, exp) = hir::MacroDef::ast_expand(macro_call)?;
     let dst_range = exp.map_range_forward(frange.range - off)?;
-    let dst_range = ra_editor::extend_selection(&exp.syntax(), dst_range)?;
+    let dst_range = ra_ide_api_light::extend_selection(&exp.syntax(), dst_range)?;
     let src_range = exp.map_range_back(dst_range)? + off;
     Some(src_range)
 }
index 2b9963b3c23d1a2f7314c9dd4f04511d9d22758e..7c60ab7d6f4ec1b0c65df96a08bb22440b8cd967 100644 (file)
@@ -6,7 +6,7 @@
     self, Problem, source_binder,
 };
 use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase};
-use ra_editor::{self, assists, LocalEdit, Severity};
+use ra_ide_api_light::{self, assists, LocalEdit, Severity};
 use ra_syntax::{
     TextRange, AstNode, SourceFile,
     ast::{self, NameOwner},
@@ -194,7 +194,7 @@ fn find_binding<'a>(
     pub(crate) fn diagnostics(&self, file_id: FileId) -> Cancelable<Vec<Diagnostic>> {
         let syntax = self.source_file(file_id);
 
-        let mut res = ra_editor::diagnostics(&syntax)
+        let mut res = ra_ide_api_light::diagnostics(&syntax)
             .into_iter()
             .map(|d| Diagnostic {
                 range: d.range,
index 48df08416b0d1e21b80455f66629dba589a77c67..183e3670691e7f6fa134a58820a8a3465967f015 100644 (file)
@@ -44,7 +44,7 @@ macro_rules! ctry {
     completion::{CompletionItem, CompletionItemKind, InsertText},
     runnables::{Runnable, RunnableKind},
 };
-pub use ra_editor::{
+pub use ra_ide_api_light::{
     Fold, FoldKind, HighlightedRange, Severity, StructureNode,
     LineIndex, LineCol, translate_offset_with_edit,
 };
@@ -336,25 +336,28 @@ pub fn extend_selection(&self, frange: FileRange) -> TextRange {
     /// Returns position of the mathcing brace (all types of braces are
     /// supported).
     pub fn matching_brace(&self, file: &SourceFile, offset: TextUnit) -> Option<TextUnit> {
-        ra_editor::matching_brace(file, offset)
+        ra_ide_api_light::matching_brace(file, offset)
     }
     /// Returns a syntax tree represented as `String`, for debug purposes.
     // FIXME: use a better name here.
     pub fn syntax_tree(&self, file_id: FileId) -> String {
         let file = self.db.source_file(file_id);
-        ra_editor::syntax_tree(&file)
+        ra_ide_api_light::syntax_tree(&file)
     }
     /// Returns an edit to remove all newlines in the range, cleaning up minor
     /// stuff like trailing commas.
     pub fn join_lines(&self, frange: FileRange) -> SourceChange {
         let file = self.db.source_file(frange.file_id);
-        SourceChange::from_local_edit(frange.file_id, ra_editor::join_lines(&file, frange.range))
+        SourceChange::from_local_edit(
+            frange.file_id,
+            ra_ide_api_light::join_lines(&file, frange.range),
+        )
     }
     /// Returns an edit which should be applied when opening a new line, fixing
     /// up minor stuff like continuing the comment.
     pub fn on_enter(&self, position: FilePosition) -> Option<SourceChange> {
         let file = self.db.source_file(position.file_id);
-        let edit = ra_editor::on_enter(&file, position.offset)?;
+        let edit = ra_ide_api_light::on_enter(&file, position.offset)?;
         Some(SourceChange::from_local_edit(position.file_id, edit))
     }
     /// Returns an edit which should be applied after `=` was typed. Primarily,
@@ -362,25 +365,25 @@ pub fn on_enter(&self, position: FilePosition) -> Option<SourceChange> {
     // FIXME: use a snippet completion instead of this hack here.
     pub fn on_eq_typed(&self, position: FilePosition) -> Option<SourceChange> {
         let file = self.db.source_file(position.file_id);
-        let edit = ra_editor::on_eq_typed(&file, position.offset)?;
+        let edit = ra_ide_api_light::on_eq_typed(&file, position.offset)?;
         Some(SourceChange::from_local_edit(position.file_id, edit))
     }
     /// Returns an edit which should be applied when a dot ('.') is typed on a blank line, indenting the line appropriately.
     pub fn on_dot_typed(&self, position: FilePosition) -> Option<SourceChange> {
         let file = self.db.source_file(position.file_id);
-        let edit = ra_editor::on_dot_typed(&file, position.offset)?;
+        let edit = ra_ide_api_light::on_dot_typed(&file, position.offset)?;
         Some(SourceChange::from_local_edit(position.file_id, edit))
     }
     /// Returns a tree representation of symbols in the file. Useful to draw a
     /// file outline.
     pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
         let file = self.db.source_file(file_id);
-        ra_editor::file_structure(&file)
+        ra_ide_api_light::file_structure(&file)
     }
     /// Returns the set of folding ranges.
     pub fn folding_ranges(&self, file_id: FileId) -> Vec<Fold> {
         let file = self.db.source_file(file_id);
-        ra_editor::folding_ranges(&file)
+        ra_ide_api_light::folding_ranges(&file)
     }
     /// Fuzzy searches for a symbol.
     pub fn symbol_search(&self, query: Query) -> Cancelable<Vec<NavigationTarget>> {
index d2dc6cfbb9b4a1e3746cfb4bf086757394f91f38..cb19e9515a14f1e4ca34d136b79b073dd753afe7 100644 (file)
@@ -1,22 +1,21 @@
 use ra_syntax::{ast, AstNode,};
-use ra_editor::HighlightedRange;
 use ra_db::SyntaxDatabase;
 
 use crate::{
+    FileId, Cancelable, HighlightedRange,
     db::RootDatabase,
-    FileId, Cancelable,
 };
 
 pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Cancelable<Vec<HighlightedRange>> {
     let source_file = db.source_file(file_id);
-    let mut res = ra_editor::highlight(source_file.syntax());
+    let mut res = ra_ide_api_light::highlight(source_file.syntax());
     for macro_call in source_file
         .syntax()
         .descendants()
         .filter_map(ast::MacroCall::cast)
     {
         if let Some((off, exp)) = hir::MacroDef::ast_expand(macro_call) {
-            let mapped_ranges = ra_editor::highlight(&exp.syntax())
+            let mapped_ranges = ra_ide_api_light::highlight(&exp.syntax())
                 .into_iter()
                 .filter_map(|r| {
                     let mapped_range = exp.map_range_back(r.range)?;
index 83f1d91e0b8273269335eab4efb4542aae3b228c..eb1722d5e77e1fd47bcb86d96a6d0bb202b8cb2c 100644 (file)
@@ -10,5 +10,5 @@ clap = "2.32.0"
 failure = "0.1.4"
 join_to_string = "0.1.1"
 ra_syntax = { path = "../ra_syntax" }
-ra_editor = { path = "../ra_editor" }
+ra_ide_api_light = { path = "../ra_ide_api_light" }
 tools = { path = "../tools" }
index 0d12f3a88a820e56e20d1acf90be89edcec86feb..43fb2fc4ce03e36de9b959154f23603bcbcc6247 100644 (file)
@@ -2,7 +2,7 @@
 
 use clap::{App, Arg, SubCommand};
 use join_to_string::join;
-use ra_editor::{extend_selection, file_structure, syntax_tree};
+use ra_ide_api_light::{extend_selection, file_structure, syntax_tree};
 use ra_syntax::{SourceFile, TextRange, TreePtr, AstNode};
 use tools::collect_tests;
 
index a97d2308f2b7c0eccd25d994af0a3ba063aa48f4..8c192fca6c02096f52140926b91dc8bb69e0f0aa 100644 (file)
@@ -1,6 +1,6 @@
 [package]
 edition = "2018"
-name = "ra_editor"
+name = "ra_ide_api_light"
 version = "0.1.0"
 authors = ["Aleksey Kladov <aleksey.kladov@gmail.com>"]
 publish = false
index 5a6af19b7cf96c7fd5e791832f0b32ef656a5726..40638eda8e3da7724c283ba1a6ed09aeb48273c8 100644 (file)
@@ -1,3 +1,8 @@
+//! This crate provides thouse IDE features which use only a single file.
+//!
+//! This usually means functions which take sytnax tree as an input and produce
+//! an edit or some auxilarly info.
+
 pub mod assists;
 mod extend_selection;
 mod folding_ranges;