mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-17 18:57:04 +00:00
feat: support navigation on primitives
This commit is contained in:
parent
a53b44412d
commit
67a39886c3
3 changed files with 27 additions and 17 deletions
|
|
@ -10,7 +10,7 @@ use hir::{
|
|||
};
|
||||
use ide_db::{
|
||||
RootDatabase,
|
||||
defs::Definition,
|
||||
defs::{Definition, find_std_module},
|
||||
documentation::{DocsRangeMap, HasDocs},
|
||||
famous_defs::FamousDefs,
|
||||
generated::lints::{CLIPPY_LINTS, DEFAULT_LINTS, FEATURES},
|
||||
|
|
@ -1160,19 +1160,6 @@ fn markup(
|
|||
}
|
||||
}
|
||||
|
||||
fn find_std_module(
|
||||
famous_defs: &FamousDefs<'_, '_>,
|
||||
name: &str,
|
||||
edition: Edition,
|
||||
) -> Option<hir::Module> {
|
||||
let db = famous_defs.0.db;
|
||||
let std_crate = famous_defs.std()?;
|
||||
let std_root_module = std_crate.root_module();
|
||||
std_root_module.children(db).find(|module| {
|
||||
module.name(db).is_some_and(|module| module.display(db, edition).to_string() == name)
|
||||
})
|
||||
}
|
||||
|
||||
fn render_memory_layout(
|
||||
config: Option<MemoryLayoutHoverConfig>,
|
||||
layout: impl FnOnce() -> Result<Layout, LayoutError>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue