mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Basic hover for builtin-attr and tool modules
This commit is contained in:
parent
db559e5049
commit
70b8331fd5
2 changed files with 13 additions and 2 deletions
|
@ -2031,6 +2031,11 @@ impl BuiltinAttr {
|
|||
// FIXME: def maps registered attrs?
|
||||
hir_def::builtin_attr::find_builtin_attr_idx(name).map(Self)
|
||||
}
|
||||
|
||||
pub fn name(&self, _: &dyn HirDatabase) -> &str {
|
||||
// FIXME: Return a `Name` here
|
||||
hir_def::builtin_attr::INERT_ATTRIBUTES[self.0].name
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
|
@ -2041,6 +2046,11 @@ impl Tool {
|
|||
// FIXME: def maps registered tools
|
||||
hir_def::builtin_attr::TOOL_MODULES.iter().position(|&tool| tool == name).map(Self)
|
||||
}
|
||||
|
||||
pub fn name(&self, _: &dyn HirDatabase) -> &str {
|
||||
// FIXME: Return a `Name` here
|
||||
hir_def::builtin_attr::TOOL_MODULES[self.0]
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue