aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock17
-rw-r--r--crates/call_info/Cargo.toml26
-rw-r--r--crates/completion/Cargo.toml1
-rw-r--r--crates/completion/src/completion_context.rs3
-rw-r--r--crates/ide/Cargo.toml1
-rw-r--r--crates/ide/src/call_hierarchy.rs2
-rw-r--r--crates/ide/src/lib.rs4
-rw-r--r--crates/ide/src/syntax_highlighting/injection.rs2
-rw-r--r--crates/ide_db/Cargo.toml3
-rw-r--r--crates/ide_db/src/call_info.rs (renamed from crates/call_info/src/lib.rs)7
-rw-r--r--crates/ide_db/src/lib.rs1
11 files changed, 14 insertions, 53 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a69aef199..bc0f0862d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -128,20 +128,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
128checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 128checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
129 129
130[[package]] 130[[package]]
131name = "call_info"
132version = "0.0.0"
133dependencies = [
134 "base_db",
135 "either",
136 "expect-test",
137 "hir",
138 "ide_db",
139 "stdx",
140 "syntax",
141 "test_utils",
142]
143
144[[package]]
145name = "cargo_metadata" 131name = "cargo_metadata"
146version = "0.12.0" 132version = "0.12.0"
147source = "registry+https://github.com/rust-lang/crates.io-index" 133source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -269,7 +255,6 @@ name = "completion"
269version = "0.0.0" 255version = "0.0.0"
270dependencies = [ 256dependencies = [
271 "base_db", 257 "base_db",
272 "call_info",
273 "expect-test", 258 "expect-test",
274 "hir", 259 "hir",
275 "ide_db", 260 "ide_db",
@@ -643,7 +628,6 @@ version = "0.0.0"
643dependencies = [ 628dependencies = [
644 "assists", 629 "assists",
645 "base_db", 630 "base_db",
646 "call_info",
647 "cfg", 631 "cfg",
648 "completion", 632 "completion",
649 "either", 633 "either",
@@ -672,6 +656,7 @@ version = "0.0.0"
672dependencies = [ 656dependencies = [
673 "base_db", 657 "base_db",
674 "either", 658 "either",
659 "expect-test",
675 "fst", 660 "fst",
676 "hir", 661 "hir",
677 "log", 662 "log",
diff --git a/crates/call_info/Cargo.toml b/crates/call_info/Cargo.toml
deleted file mode 100644
index 98c0bd6db..000000000
--- a/crates/call_info/Cargo.toml
+++ /dev/null
@@ -1,26 +0,0 @@
1[package]
2name = "call_info"
3version = "0.0.0"
4description = "TBD"
5license = "MIT OR Apache-2.0"
6authors = ["rust-analyzer developers"]
7edition = "2018"
8
9[lib]
10doctest = false
11
12[dependencies]
13either = "1.5.3"
14
15stdx = { path = "../stdx", version = "0.0.0" }
16syntax = { path = "../syntax", version = "0.0.0" }
17base_db = { path = "../base_db", version = "0.0.0" }
18ide_db = { path = "../ide_db", version = "0.0.0" }
19test_utils = { path = "../test_utils", version = "0.0.0" }
20
21# call_info crate should depend only on the top-level `hir` package. if you need
22# something from some `hir_xxx` subpackage, reexport the API via `hir`.
23hir = { path = "../hir", version = "0.0.0" }
24
25[dev-dependencies]
26expect-test = "1.0"
diff --git a/crates/completion/Cargo.toml b/crates/completion/Cargo.toml
index 8b6e80448..b79ee33f7 100644
--- a/crates/completion/Cargo.toml
+++ b/crates/completion/Cargo.toml
@@ -21,7 +21,6 @@ base_db = { path = "../base_db", version = "0.0.0" }
21ide_db = { path = "../ide_db", version = "0.0.0" } 21ide_db = { path = "../ide_db", version = "0.0.0" }
22profile = { path = "../profile", version = "0.0.0" } 22profile = { path = "../profile", version = "0.0.0" }
23test_utils = { path = "../test_utils", version = "0.0.0" } 23test_utils = { path = "../test_utils", version = "0.0.0" }
24call_info = { path = "../call_info", version = "0.0.0" }
25 24
26# completions crate should depend only on the top-level `hir` package. if you need 25# completions crate should depend only on the top-level `hir` package. if you need
27# something from some `hir_xxx` subpackage, reexport the API via `hir`. 26# something from some `hir_xxx` subpackage, reexport the API via `hir`.
diff --git a/crates/completion/src/completion_context.rs b/crates/completion/src/completion_context.rs
index e4f86d0e0..97c5c04ba 100644
--- a/crates/completion/src/completion_context.rs
+++ b/crates/completion/src/completion_context.rs
@@ -1,9 +1,8 @@
1//! See `CompletionContext` structure. 1//! See `CompletionContext` structure.
2 2
3use base_db::{FilePosition, SourceDatabase}; 3use base_db::{FilePosition, SourceDatabase};
4use call_info::ActiveParameter;
5use hir::{Local, ScopeDef, Semantics, SemanticsScope, Type}; 4use hir::{Local, ScopeDef, Semantics, SemanticsScope, Type};
6use ide_db::RootDatabase; 5use ide_db::{call_info::ActiveParameter, RootDatabase};
7use syntax::{ 6use syntax::{
8 algo::{find_covering_element, find_node_at_offset}, 7 algo::{find_covering_element, find_node_at_offset},
9 ast, match_ast, AstNode, NodeOrToken, 8 ast, match_ast, AstNode, NodeOrToken,
diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml
index 76b52fa04..145c6156c 100644
--- a/crates/ide/Cargo.toml
+++ b/crates/ide/Cargo.toml
@@ -30,7 +30,6 @@ profile = { path = "../profile", version = "0.0.0" }
30test_utils = { path = "../test_utils", version = "0.0.0" } 30test_utils = { path = "../test_utils", version = "0.0.0" }
31assists = { path = "../assists", version = "0.0.0" } 31assists = { path = "../assists", version = "0.0.0" }
32ssr = { path = "../ssr", version = "0.0.0" } 32ssr = { path = "../ssr", version = "0.0.0" }
33call_info = { path = "../call_info", version = "0.0.0" }
34completion = { path = "../completion", version = "0.0.0" } 33completion = { path = "../completion", version = "0.0.0" }
35 34
36# ide should depend only on the top-level `hir` package. if you need 35# ide should depend only on the top-level `hir` package. if you need
diff --git a/crates/ide/src/call_hierarchy.rs b/crates/ide/src/call_hierarchy.rs
index 9d6433fe0..a259d9849 100644
--- a/crates/ide/src/call_hierarchy.rs
+++ b/crates/ide/src/call_hierarchy.rs
@@ -2,8 +2,8 @@
2 2
3use indexmap::IndexMap; 3use indexmap::IndexMap;
4 4
5use call_info::FnCallNode;
6use hir::Semantics; 5use hir::Semantics;
6use ide_db::call_info::FnCallNode;
7use ide_db::RootDatabase; 7use ide_db::RootDatabase;
8use syntax::{ast, match_ast, AstNode, TextRange}; 8use syntax::{ast, match_ast, AstNode, TextRange};
9 9
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index cecfae4c7..d84b970d4 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -80,10 +80,10 @@ pub use crate::{
80 Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange, 80 Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange,
81 }, 81 },
82}; 82};
83pub use call_info::CallInfo;
84pub use completion::{ 83pub use completion::{
85 CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat, 84 CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
86}; 85};
86pub use ide_db::call_info::CallInfo;
87 87
88pub use assists::{ 88pub use assists::{
89 utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist, 89 utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist,
@@ -396,7 +396,7 @@ impl Analysis {
396 396
397 /// Computes parameter information for the given call expression. 397 /// Computes parameter information for the given call expression.
398 pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>> { 398 pub fn call_info(&self, position: FilePosition) -> Cancelable<Option<CallInfo>> {
399 self.with_db(|db| call_info::call_info(db, position)) 399 self.with_db(|db| ide_db::call_info::call_info(db, position))
400 } 400 }
401 401
402 /// Computes call hierarchy candidates for the given file position. 402 /// Computes call hierarchy candidates for the given file position.
diff --git a/crates/ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs
index acd91b26c..59a74bc02 100644
--- a/crates/ide/src/syntax_highlighting/injection.rs
+++ b/crates/ide/src/syntax_highlighting/injection.rs
@@ -3,8 +3,8 @@
3use std::{collections::BTreeMap, convert::TryFrom}; 3use std::{collections::BTreeMap, convert::TryFrom};
4 4
5use ast::{HasQuotes, HasStringValue}; 5use ast::{HasQuotes, HasStringValue};
6use call_info::ActiveParameter;
7use hir::Semantics; 6use hir::Semantics;
7use ide_db::call_info::ActiveParameter;
8use itertools::Itertools; 8use itertools::Itertools;
9use syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize}; 9use syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize};
10 10
diff --git a/crates/ide_db/Cargo.toml b/crates/ide_db/Cargo.toml
index 320fb15e5..3ff7a1a6a 100644
--- a/crates/ide_db/Cargo.toml
+++ b/crates/ide_db/Cargo.toml
@@ -29,3 +29,6 @@ test_utils = { path = "../test_utils", version = "0.0.0" }
29# ide should depend only on the top-level `hir` package. if you need 29# ide should depend only on the top-level `hir` package. if you need
30# something from some `hir_xxx` subpackage, reexport the API via `hir`. 30# something from some `hir_xxx` subpackage, reexport the API via `hir`.
31hir = { path = "../hir", version = "0.0.0" } 31hir = { path = "../hir", version = "0.0.0" }
32
33[dev-dependencies]
34expect-test = "1.0"
diff --git a/crates/call_info/src/lib.rs b/crates/ide_db/src/call_info.rs
index c45406c25..83a602b9a 100644
--- a/crates/call_info/src/lib.rs
+++ b/crates/ide_db/src/call_info.rs
@@ -2,7 +2,6 @@
2use base_db::FilePosition; 2use base_db::FilePosition;
3use either::Either; 3use either::Either;
4use hir::{HasAttrs, HirDisplay, Semantics, Type}; 4use hir::{HasAttrs, HirDisplay, Semantics, Type};
5use ide_db::RootDatabase;
6use stdx::format_to; 5use stdx::format_to;
7use syntax::{ 6use syntax::{
8 ast::{self, ArgListOwner}, 7 ast::{self, ArgListOwner},
@@ -10,6 +9,8 @@ use syntax::{
10}; 9};
11use test_utils::mark; 10use test_utils::mark;
12 11
12use crate::RootDatabase;
13
13/// Contains information about a call site. Specifically the 14/// Contains information about a call site. Specifically the
14/// `FunctionSignature`and current parameter. 15/// `FunctionSignature`and current parameter.
15#[derive(Debug)] 16#[derive(Debug)]
@@ -228,9 +229,9 @@ impl FnCallNode {
228 229
229#[cfg(test)] 230#[cfg(test)]
230mod tests { 231mod tests {
232 use crate::RootDatabase;
231 use base_db::{fixture::ChangeFixture, FilePosition}; 233 use base_db::{fixture::ChangeFixture, FilePosition};
232 use expect_test::{expect, Expect}; 234 use expect_test::{expect, Expect};
233 use ide_db::RootDatabase;
234 use test_utils::{mark, RangeOrOffset}; 235 use test_utils::{mark, RangeOrOffset};
235 236
236 /// Creates analysis from a multi-file fixture, returns positions marked with <|>. 237 /// Creates analysis from a multi-file fixture, returns positions marked with <|>.
@@ -249,7 +250,7 @@ mod tests {
249 250
250 fn check(ra_fixture: &str, expect: Expect) { 251 fn check(ra_fixture: &str, expect: Expect) {
251 let (db, position) = position(ra_fixture); 252 let (db, position) = position(ra_fixture);
252 let call_info = crate::call_info(&db, position); 253 let call_info = crate::call_info::call_info(&db, position);
253 let actual = match call_info { 254 let actual = match call_info {
254 Some(call_info) => { 255 Some(call_info) => {
255 let docs = match &call_info.doc { 256 let docs = match &call_info.doc {
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs
index 88f74265c..303f7c964 100644
--- a/crates/ide_db/src/lib.rs
+++ b/crates/ide_db/src/lib.rs
@@ -12,6 +12,7 @@ pub mod imports_locator;
12pub mod source_change; 12pub mod source_change;
13pub mod ty_filter; 13pub mod ty_filter;
14pub mod traits; 14pub mod traits;
15pub mod call_info;
15 16
16use std::{fmt, sync::Arc}; 17use std::{fmt, sync::Arc};
17 18