mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
fix: Don't duplicate attribute completions
This commit is contained in:
parent
f79f3db7b7
commit
d3e538638a
4 changed files with 13 additions and 23 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue