Don't use generic DB where a concrete one will do
This commit is contained in:
parent
4c85e53531
commit
687bec117c
2 changed files with 8 additions and 9 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::iter;
|
||||
|
||||
use hir::{db::HirDatabase, Adt, HasSource, Semantics};
|
||||
use hir::{Adt, HasSource, Semantics};
|
||||
use ra_syntax::ast::{self, edit::IndentLevel, make, AstNode, NameOwner};
|
||||
|
||||
use crate::{Assist, AssistCtx, AssistId};
|
||||
|
@ -88,11 +88,7 @@ fn resolve_enum_def(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<
|
|||
})
|
||||
}
|
||||
|
||||
fn build_pat(
|
||||
db: &impl HirDatabase,
|
||||
module: hir::Module,
|
||||
var: hir::EnumVariant,
|
||||
) -> Option<ast::Pat> {
|
||||
fn build_pat(db: &RootDatabase, module: hir::Module, var: hir::EnumVariant) -> Option<ast::Pat> {
|
||||
let path = crate::ast_transform::path_to_ast(module.find_use_path(db, var.into())?);
|
||||
|
||||
// FIXME: use HIR for this; it doesn't currently expose struct vs. tuple vs. unit variants though
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! This modules takes care of rendering various definitions as completion items.
|
||||
|
||||
use hir::{db::HirDatabase, Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type};
|
||||
use hir::{Docs, HasAttrs, HasSource, HirDisplay, ScopeDef, StructKind, Type};
|
||||
use join_to_string::join;
|
||||
use ra_syntax::ast::NameOwner;
|
||||
use test_utils::tested_by;
|
||||
|
@ -9,7 +9,10 @@ use crate::completion::{
|
|||
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
|
||||
};
|
||||
|
||||
use crate::display::{const_label, macro_label, type_label, FunctionSignature};
|
||||
use crate::{
|
||||
display::{const_label, macro_label, type_label, FunctionSignature},
|
||||
RootDatabase,
|
||||
};
|
||||
|
||||
impl Completions {
|
||||
pub(crate) fn add_field(
|
||||
|
@ -300,7 +303,7 @@ impl Completions {
|
|||
}
|
||||
}
|
||||
|
||||
fn is_deprecated(node: impl HasAttrs, db: &impl HirDatabase) -> bool {
|
||||
fn is_deprecated(node: impl HasAttrs, db: &RootDatabase) -> bool {
|
||||
node.attrs(db).by_key("deprecated").exists()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue