Skip to content

Commit b6ea56e

Browse files
committed
Make call_info a part of ide_db
1 parent 8d3d509 commit b6ea56e

File tree

11 files changed

+14
-53
lines changed

11 files changed

+14
-53
lines changed

Cargo.lock

Lines changed: 1 addition & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/call_info/Cargo.toml

Lines changed: 0 additions & 26 deletions
This file was deleted.

crates/completion/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ base_db = { path = "../base_db", version = "0.0.0" }
2121
ide_db = { path = "../ide_db", version = "0.0.0" }
2222
profile = { path = "../profile", version = "0.0.0" }
2323
test_utils = { path = "../test_utils", version = "0.0.0" }
24-
call_info = { path = "../call_info", version = "0.0.0" }
2524

2625
# completions crate should depend only on the top-level `hir` package. if you need
2726
# something from some `hir_xxx` subpackage, reexport the API via `hir`.

crates/completion/src/completion_context.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! See `CompletionContext` structure.
22
33
use base_db::{FilePosition, SourceDatabase};
4-
use call_info::ActiveParameter;
54
use hir::{Local, ScopeDef, Semantics, SemanticsScope, Type};
6-
use ide_db::RootDatabase;
5+
use ide_db::{call_info::ActiveParameter, RootDatabase};
76
use syntax::{
87
algo::{find_covering_element, find_node_at_offset},
98
ast, match_ast, AstNode, NodeOrToken,

crates/ide/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ profile = { path = "../profile", version = "0.0.0" }
3030
test_utils = { path = "../test_utils", version = "0.0.0" }
3131
assists = { path = "../assists", version = "0.0.0" }
3232
ssr = { path = "../ssr", version = "0.0.0" }
33-
call_info = { path = "../call_info", version = "0.0.0" }
3433
completion = { path = "../completion", version = "0.0.0" }
3534

3635
# ide should depend only on the top-level `hir` package. if you need

crates/ide/src/call_hierarchy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
use indexmap::IndexMap;
44

5-
use call_info::FnCallNode;
65
use hir::Semantics;
6+
use ide_db::call_info::FnCallNode;
77
use ide_db::RootDatabase;
88
use syntax::{ast, match_ast, AstNode, TextRange};
99

crates/ide/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ pub use crate::{
8080
Highlight, HighlightModifier, HighlightModifiers, HighlightTag, HighlightedRange,
8181
},
8282
};
83-
pub use call_info::CallInfo;
8483
pub use completion::{
8584
CompletionConfig, CompletionItem, CompletionItemKind, CompletionScore, InsertTextFormat,
8685
};
86+
pub use ide_db::call_info::CallInfo;
8787

8888
pub use assists::{
8989
utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist,
@@ -396,7 +396,7 @@ impl Analysis {
396396

397397
/// Computes parameter information for the given call expression.
398398
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))
400400
}
401401

402402
/// Computes call hierarchy candidates for the given file position.

crates/ide/src/syntax_highlighting/injection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use std::{collections::BTreeMap, convert::TryFrom};
44

55
use ast::{HasQuotes, HasStringValue};
6-
use call_info::ActiveParameter;
76
use hir::Semantics;
7+
use ide_db::call_info::ActiveParameter;
88
use itertools::Itertools;
99
use syntax::{ast, AstToken, SyntaxNode, SyntaxToken, TextRange, TextSize};
1010

crates/ide_db/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ test_utils = { path = "../test_utils", version = "0.0.0" }
2929
# ide should depend only on the top-level `hir` package. if you need
3030
# something from some `hir_xxx` subpackage, reexport the API via `hir`.
3131
hir = { path = "../hir", version = "0.0.0" }
32+
33+
[dev-dependencies]
34+
expect-test = "1.0"

crates/call_info/src/lib.rs renamed to crates/ide_db/src/call_info.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
use base_db::FilePosition;
33
use either::Either;
44
use hir::{HasAttrs, HirDisplay, Semantics, Type};
5-
use ide_db::RootDatabase;
65
use stdx::format_to;
76
use syntax::{
87
ast::{self, ArgListOwner},
98
match_ast, AstNode, SyntaxNode, SyntaxToken, TextRange, TextSize,
109
};
1110
use test_utils::mark;
1211

12+
use crate::RootDatabase;
13+
1314
/// Contains information about a call site. Specifically the
1415
/// `FunctionSignature`and current parameter.
1516
#[derive(Debug)]
@@ -228,9 +229,9 @@ impl FnCallNode {
228229

229230
#[cfg(test)]
230231
mod tests {
232+
use crate::RootDatabase;
231233
use base_db::{fixture::ChangeFixture, FilePosition};
232234
use expect_test::{expect, Expect};
233-
use ide_db::RootDatabase;
234235
use test_utils::{mark, RangeOrOffset};
235236

236237
/// Creates analysis from a multi-file fixture, returns positions marked with <|>.
@@ -249,7 +250,7 @@ mod tests {
249250

250251
fn check(ra_fixture: &str, expect: Expect) {
251252
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);
253254
let actual = match call_info {
254255
Some(call_info) => {
255256
let docs = match &call_info.doc {

0 commit comments

Comments
 (0)