aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock18
-rw-r--r--crates/ra_cli/Cargo.toml1
-rw-r--r--crates/ra_cli/src/main.rs2
-rw-r--r--crates/ra_ide_api/Cargo.toml1
-rw-r--r--crates/ra_ide_api/src/lib.rs11
-rw-r--r--crates/ra_ide_api/src/snapshots/tests__file_structure.snap (renamed from crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap)2
-rw-r--r--crates/ra_ide_api/src/structure.rs (renamed from crates/ra_ide_api_light/src/structure.rs)0
-rw-r--r--crates/ra_ide_api_light/Cargo.toml26
-rw-r--r--crates/ra_ide_api_light/src/lib.rs12
-rw-r--r--docs/dev/architecture.md13
10 files changed, 7 insertions, 79 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 1b5de271e..653eaa6c2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -929,7 +929,6 @@ dependencies = [
929 "ra_db 0.1.0", 929 "ra_db 0.1.0",
930 "ra_hir 0.1.0", 930 "ra_hir 0.1.0",
931 "ra_ide_api 0.1.0", 931 "ra_ide_api 0.1.0",
932 "ra_ide_api_light 0.1.0",
933 "ra_syntax 0.1.0", 932 "ra_syntax 0.1.0",
934 "tools 0.1.0", 933 "tools 0.1.0",
935] 934]
@@ -993,7 +992,6 @@ dependencies = [
993 "ra_db 0.1.0", 992 "ra_db 0.1.0",
994 "ra_fmt 0.1.0", 993 "ra_fmt 0.1.0",
995 "ra_hir 0.1.0", 994 "ra_hir 0.1.0",
996 "ra_ide_api_light 0.1.0",
997 "ra_syntax 0.1.0", 995 "ra_syntax 0.1.0",
998 "ra_text_edit 0.1.0", 996 "ra_text_edit 0.1.0",
999 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 997 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1005,22 +1003,6 @@ dependencies = [
1005] 1003]
1006 1004
1007[[package]] 1005[[package]]
1008name = "ra_ide_api_light"
1009version = "0.1.0"
1010dependencies = [
1011 "insta 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
1012 "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1013 "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
1014 "proptest 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
1015 "ra_fmt 0.1.0",
1016 "ra_syntax 0.1.0",
1017 "ra_text_edit 0.1.0",
1018 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1019 "superslice 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
1020 "test_utils 0.1.0",
1021]
1022
1023[[package]]
1024name = "ra_lsp_server" 1006name = "ra_lsp_server"
1025version = "0.1.0" 1007version = "0.1.0"
1026dependencies = [ 1008dependencies = [
diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml
index 4c666f556..467628236 100644
--- a/crates/ra_cli/Cargo.toml
+++ b/crates/ra_cli/Cargo.toml
@@ -14,7 +14,6 @@ indicatif = "0.11.0"
14 14
15ra_syntax = { path = "../ra_syntax" } 15ra_syntax = { path = "../ra_syntax" }
16ra_ide_api = { path = "../ra_ide_api" } 16ra_ide_api = { path = "../ra_ide_api" }
17ra_ide_api_light = { path = "../ra_ide_api_light" }
18tools = { path = "../tools" } 17tools = { path = "../tools" }
19ra_batch = { path = "../ra_batch" } 18ra_batch = { path = "../ra_batch" }
20ra_hir = { path = "../ra_hir" } 19ra_hir = { path = "../ra_hir" }
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs
index 5285f1f28..11f5541eb 100644
--- a/crates/ra_cli/src/main.rs
+++ b/crates/ra_cli/src/main.rs
@@ -5,7 +5,7 @@ use std::{fs, io::Read, path::Path, time::Instant};
5use clap::{App, Arg, SubCommand}; 5use clap::{App, Arg, SubCommand};
6use join_to_string::join; 6use join_to_string::join;
7use ra_ide_api::{Analysis, FileRange}; 7use ra_ide_api::{Analysis, FileRange};
8use ra_ide_api_light::file_structure; 8use ra_ide_api::file_structure;
9use ra_syntax::{SourceFile, TextRange, TreeArc, AstNode}; 9use ra_syntax::{SourceFile, TextRange, TreeArc, AstNode};
10use tools::collect_tests; 10use tools::collect_tests;
11use flexi_logger::Logger; 11use flexi_logger::Logger;
diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml
index c64226801..45bab4e28 100644
--- a/crates/ra_ide_api/Cargo.toml
+++ b/crates/ra_ide_api/Cargo.toml
@@ -20,7 +20,6 @@ jemallocator = { version = "0.1.9", optional = true }
20jemalloc-ctl = { version = "0.2.0", optional = true } 20jemalloc-ctl = { version = "0.2.0", optional = true }
21 21
22ra_syntax = { path = "../ra_syntax" } 22ra_syntax = { path = "../ra_syntax" }
23ra_ide_api_light = { path = "../ra_ide_api_light" }
24ra_text_edit = { path = "../ra_text_edit" } 23ra_text_edit = { path = "../ra_text_edit" }
25ra_db = { path = "../ra_db" } 24ra_db = { path = "../ra_db" }
26ra_fmt = { path = "../ra_fmt" } 25ra_fmt = { path = "../ra_fmt" }
diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs
index 8aa3eb088..9063f78a9 100644
--- a/crates/ra_ide_api/src/lib.rs
+++ b/crates/ra_ide_api/src/lib.rs
@@ -6,9 +6,6 @@
6//! database, and the `ra_hir` crate, where majority of the analysis happens. 6//! database, and the `ra_hir` crate, where majority of the analysis happens.
7//! However, IDE specific bits of the analysis (most notably completion) happen 7//! However, IDE specific bits of the analysis (most notably completion) happen
8//! in this crate. 8//! in this crate.
9//!
10//! The sibling `ra_ide_api_light` handles those bits of IDE functionality
11//! which are restricted to a single file and need only syntax.
12 9
13// For proving that RootDatabase is RefUnwindSafe. 10// For proving that RootDatabase is RefUnwindSafe.
14#![recursion_limit = "128"] 11#![recursion_limit = "128"]
@@ -33,10 +30,11 @@ mod impls;
33mod assists; 30mod assists;
34mod diagnostics; 31mod diagnostics;
35mod syntax_tree; 32mod syntax_tree;
36mod line_index;
37mod folding_ranges; 33mod folding_ranges;
34mod line_index;
38mod line_index_utils; 35mod line_index_utils;
39mod join_lines; 36mod join_lines;
37mod structure;
40mod typing; 38mod typing;
41mod matching_brace; 39mod matching_brace;
42 40
@@ -72,9 +70,10 @@ pub use crate::{
72 line_index_utils::translate_offset_with_edit, 70 line_index_utils::translate_offset_with_edit,
73 folding_ranges::{Fold, FoldKind}, 71 folding_ranges::{Fold, FoldKind},
74 syntax_highlighting::HighlightedRange, 72 syntax_highlighting::HighlightedRange,
73 structure::{StructureNode, file_structure},
75 diagnostics::Severity, 74 diagnostics::Severity,
76}; 75};
77pub use ra_ide_api_light::StructureNode; 76
78pub use ra_db::{ 77pub use ra_db::{
79 Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId, 78 Canceled, CrateGraph, CrateId, FileId, FilePosition, FileRange, SourceRootId,
80 Edition 79 Edition
@@ -388,7 +387,7 @@ impl Analysis {
388 /// file outline. 387 /// file outline.
389 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> { 388 pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> {
390 let file = self.db.parse(file_id); 389 let file = self.db.parse(file_id);
391 ra_ide_api_light::file_structure(&file) 390 structure::file_structure(&file)
392 } 391 }
393 392
394 /// Returns the set of folding ranges. 393 /// Returns the set of folding ranges.
diff --git a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap b/crates/ra_ide_api/src/snapshots/tests__file_structure.snap
index 8e4184b31..2efa8e22c 100644
--- a/crates/ra_ide_api_light/src/snapshots/tests__file_structure.snap
+++ b/crates/ra_ide_api/src/snapshots/tests__file_structure.snap
@@ -1,7 +1,7 @@
1--- 1---
2created: "2019-02-05T22:03:50.763530100Z" 2created: "2019-02-05T22:03:50.763530100Z"
3creator: [email protected] 3creator: [email protected]
4source: crates/ra_ide_api_light/src/structure.rs 4source: crates/ra_ide_api/src/structure.rs
5expression: structure 5expression: structure
6--- 6---
7[ 7[
diff --git a/crates/ra_ide_api_light/src/structure.rs b/crates/ra_ide_api/src/structure.rs
index ec2c9bbc6..ec2c9bbc6 100644
--- a/crates/ra_ide_api_light/src/structure.rs
+++ b/crates/ra_ide_api/src/structure.rs
diff --git a/crates/ra_ide_api_light/Cargo.toml b/crates/ra_ide_api_light/Cargo.toml
deleted file mode 100644
index 4e69f5325..000000000
--- a/crates/ra_ide_api_light/Cargo.toml
+++ /dev/null
@@ -1,26 +0,0 @@
1[package]
2edition = "2018"
3name = "ra_ide_api_light"
4version = "0.1.0"
5authors = ["rust-analyzer developers"]
6publish = false
7
8[dependencies]
9itertools = "0.8.0"
10superslice = "1.0.0"
11join_to_string = "0.1.1"
12rustc-hash = "1.0"
13
14ra_syntax = { path = "../ra_syntax" }
15ra_text_edit = { path = "../ra_text_edit" }
16ra_fmt = { path = "../ra_fmt" }
17
18[dev-dependencies]
19test_utils = { path = "../test_utils" }
20insta = "0.7.0"
21
22[dev-dependencies.proptest]
23version = "0.9.0"
24# Disable `fork` feature to allow compiling on webassembly
25default-features = false
26features = ["std", "bit-set", "break-dead-code"]
diff --git a/crates/ra_ide_api_light/src/lib.rs b/crates/ra_ide_api_light/src/lib.rs
deleted file mode 100644
index df7f144b6..000000000
--- a/crates/ra_ide_api_light/src/lib.rs
+++ /dev/null
@@ -1,12 +0,0 @@
1//! This crate provides those IDE features which use only a single file.
2//!
3//! This usually means functions which take syntax tree as an input and produce
4//! an edit or some auxiliary info.
5
6mod structure;
7
8use ra_syntax::TextRange;
9
10pub use crate::{
11 structure::{file_structure, StructureNode},
12};
diff --git a/docs/dev/architecture.md b/docs/dev/architecture.md
index f990d5bf0..890b18fcd 100644
--- a/docs/dev/architecture.md
+++ b/docs/dev/architecture.md
@@ -130,19 +130,6 @@ APIs in this crate are IDE centric: they take text offsets as input and produce
130offsets and strings as output. This works on top of rich code model powered by 130offsets and strings as output. This works on top of rich code model powered by
131`hir`. 131`hir`.
132 132
133### `crates/ra_ide_api_light`
134
135All IDE features which can be implemented if you only have access to a single
136file. `ra_ide_api_light` could be used to enhance editing of Rust code without
137the need to fiddle with build-systems, file synchronization and such.
138
139In a sense, `ra_ide_api_light` is just a bunch of pure functions which take a
140syntax tree as input.
141
142The tests for `ra_ide_api_light` are `#[cfg(test)] mod tests` unit-tests spread
143throughout its modules.
144
145
146### `crates/ra_lsp_server` 133### `crates/ra_lsp_server`
147 134
148An LSP implementation which wraps `ra_ide_api` into a langauge server protocol. 135An LSP implementation which wraps `ra_ide_api` into a langauge server protocol.