mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Cleanup query fn naming
This commit is contained in:
parent
01bd1e1296
commit
dce31efdde
2 changed files with 5 additions and 3 deletions
|
@ -112,7 +112,7 @@ pub trait DefDatabase: InternDatabase + AstDatabase + Upcast<dyn AstDatabase> {
|
|||
#[salsa::invoke(Documentation::documentation_query)]
|
||||
fn documentation(&self, def: AttrDefId) -> Option<Documentation>;
|
||||
|
||||
#[salsa::invoke(find_path::importable_locations_in_crate)]
|
||||
#[salsa::invoke(find_path::importable_locations_of_query)]
|
||||
fn importable_locations_of(
|
||||
&self,
|
||||
item: ItemInNs,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use hir_expand::name::{known, AsName, Name};
|
||||
use ra_prof::profile;
|
||||
use test_utils::tested_by;
|
||||
|
||||
use crate::{
|
||||
|
@ -18,7 +19,7 @@ use crate::{
|
|||
/// Find a path that can be used to refer to a certain item. This can depend on
|
||||
/// *from where* you're referring to the item, hence the `from` parameter.
|
||||
pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option<ModPath> {
|
||||
let _p = ra_prof::profile("find_path");
|
||||
let _p = profile("find_path");
|
||||
find_path_inner(db, item, from, MAX_PATH_LEN)
|
||||
}
|
||||
|
||||
|
@ -213,11 +214,12 @@ fn find_importable_locations(
|
|||
///
|
||||
/// Note that the crate doesn't need to be the one in which the item is defined;
|
||||
/// it might be re-exported in other crates.
|
||||
pub(crate) fn importable_locations_in_crate(
|
||||
pub(crate) fn importable_locations_of_query(
|
||||
db: &dyn DefDatabase,
|
||||
item: ItemInNs,
|
||||
krate: CrateId,
|
||||
) -> Arc<[(ModuleId, Name, Visibility)]> {
|
||||
let _p = profile("importable_locations_of_query");
|
||||
let def_map = db.crate_def_map(krate);
|
||||
let mut result = Vec::new();
|
||||
for (local_id, data) in def_map.modules.iter() {
|
||||
|
|
Loading…
Reference in a new issue