fix: Do not complete Drop::drop, complete std::mem::drop instead

This commit is contained in:
Lukas Wirth 2021-12-22 02:25:38 +01:00
parent 276687a6ee
commit 5360c9bd22
8 changed files with 88 additions and 10 deletions

View file

@ -5,6 +5,7 @@ use hir::{Local, Name, ScopeDef, Semantics, SemanticsScope, Type, TypeInfo};
use ide_db::{
active_parameter::ActiveParameter,
base_db::{FilePosition, SourceDatabase},
helpers::FamousDefs,
RootDatabase,
};
use syntax::{
@ -150,6 +151,10 @@ impl<'a> CompletionContext<'a> {
self.previous_token.as_ref().map_or(false, |tok| tok.kind() == kind)
}
pub(crate) fn famous_defs(&self) -> FamousDefs {
FamousDefs(&self.sema, self.krate)
}
pub(crate) fn dot_receiver(&self) -> Option<&ast::Expr> {
match &self.completion_location {
Some(