Remove query aliases

This commit is contained in:
Kirill Bulatov 2020-11-16 21:24:54 +02:00
parent d776c67226
commit 4109968934
3 changed files with 10 additions and 10 deletions

View file

@ -72,7 +72,7 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T
} }
fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> { fn fuzzy_completion(acc: &mut Completions, ctx: &CompletionContext) -> Option<()> {
let _p = profile::span("fuzzy_completion®"); let _p = profile::span("fuzzy_completion");
let current_module = ctx.scope.module()?; let current_module = ctx.scope.module()?;
let anchor = ctx.name_ref_syntax.as_ref()?; let anchor = ctx.name_ref_syntax.as_ref()?;
let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?; let import_scope = ImportScope::find_insert_use_container(anchor.syntax(), &ctx.sema)?;

View file

@ -49,7 +49,7 @@ pub use hir_def::{
builtin_type::BuiltinType, builtin_type::BuiltinType,
docs::Documentation, docs::Documentation,
find_path::PrefixKind, find_path::PrefixKind,
import_map::Query as ExternalImportablesQuery, import_map,
item_scope::ItemInNs, item_scope::ItemInNs,
nameres::ModuleSource, nameres::ModuleSource,
path::{ModPath, PathKind}, path::{ModPath, PathKind},

View file

@ -1,12 +1,12 @@
//! This module contains an import search funcionality that is provided to the assists module. //! This module contains an import search funcionality that is provided to the assists module.
//! Later, this should be moved away to a separate crate that is accessible from the assists module. //! Later, this should be moved away to a separate crate that is accessible from the assists module.
use hir::{Crate, ExternalImportablesQuery, MacroDef, ModuleDef, Semantics}; use hir::{import_map, Crate, MacroDef, ModuleDef, Semantics};
use syntax::{ast, AstNode, SyntaxKind::NAME}; use syntax::{ast, AstNode, SyntaxKind::NAME};
use crate::{ use crate::{
defs::{Definition, NameClass}, defs::{Definition, NameClass},
symbol_index::{self, FileSymbol, Query as LocalImportablesQuery}, symbol_index::{self, FileSymbol},
RootDatabase, RootDatabase,
}; };
use either::Either; use either::Either;
@ -22,12 +22,12 @@ pub fn find_exact_imports<'a>(
sema, sema,
krate, krate,
{ {
let mut local_query = LocalImportablesQuery::new(name_to_import.to_string()); let mut local_query = symbol_index::Query::new(name_to_import.to_string());
local_query.exact(); local_query.exact();
local_query.limit(40); local_query.limit(40);
local_query local_query
}, },
ExternalImportablesQuery::new(name_to_import).anchor_end().case_sensitive().limit(40), import_map::Query::new(name_to_import).anchor_end().case_sensitive().limit(40),
) )
} }
@ -42,19 +42,19 @@ pub fn find_similar_imports<'a>(
sema, sema,
krate, krate,
{ {
let mut local_query = LocalImportablesQuery::new(name_to_import.to_string()); let mut local_query = symbol_index::Query::new(name_to_import.to_string());
local_query.limit(limit); local_query.limit(limit);
local_query local_query
}, },
ExternalImportablesQuery::new(name_to_import).limit(limit), import_map::Query::new(name_to_import).limit(limit),
) )
} }
fn find_imports<'a>( fn find_imports<'a>(
sema: &Semantics<'a, RootDatabase>, sema: &Semantics<'a, RootDatabase>,
krate: Crate, krate: Crate,
local_query: LocalImportablesQuery, local_query: symbol_index::Query,
external_query: ExternalImportablesQuery, external_query: import_map::Query,
) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { ) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
let _p = profile::span("find_similar_imports"); let _p = profile::span("find_similar_imports");
let db = sema.db; let db = sema.db;