fix: Don't duplicate attribute completions

This commit is contained in:
Lukas Wirth 2021-12-17 15:22:53 +01:00
parent f79f3db7b7
commit d3e538638a
4 changed files with 13 additions and 23 deletions

View file

@ -94,10 +94,11 @@ pub(crate) fn hover(
let sema = &hir::Semantics::new(db);
let file = sema.parse(file_id).syntax().clone();
if !range.is_empty() {
let offset = if !range.is_empty() {
return hover_ranged(&file, range, sema, config);
}
let offset = range.start();
} else {
range.start()
};
let original_token = pick_best_token(file.token_at_offset(offset), |kind| match kind {
IDENT | INT_NUMBER | LIFETIME_IDENT | T![self] | T![super] | T![crate] => 3,