mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Sourcify classify_name_ref
This commit is contained in:
parent
d9d99369b2
commit
272af56a5c
5 changed files with 22 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
//! FIXME: write short doc here
|
||||
|
||||
use hir::{Adt, HasSource, HirDisplay};
|
||||
use hir::{Adt, HasSource, HirDisplay, Source};
|
||||
use ra_db::SourceDatabase;
|
||||
use ra_syntax::{
|
||||
algo::{ancestors_at_offset, find_covering_element, find_node_at_offset},
|
||||
|
@ -171,7 +171,8 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
|
|||
find_node_at_offset::<ast::NameRef>(file.syntax(), position.offset)
|
||||
{
|
||||
let mut no_fallback = false;
|
||||
if let Some(name_kind) = classify_name_ref(db, position.file_id, &name_ref).map(|d| d.kind)
|
||||
if let Some(name_kind) =
|
||||
classify_name_ref(db, Source::new(position.file_id.into(), &name_ref)).map(|d| d.kind)
|
||||
{
|
||||
res.extend(hover_text_from_name_kind(db, name_kind, &mut no_fallback))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue