mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Don't parse source files to generate macro completion details
This commit is contained in:
parent
b1ab5770c9
commit
6c8c02f625
15 changed files with 157 additions and 204 deletions
|
@ -18,8 +18,8 @@ use syntax::SmolStr;
|
|||
|
||||
use crate::{
|
||||
Adt, Const, ConstParam, Enum, Field, Function, GenericParam, HasCrate, HasVisibility,
|
||||
LifetimeParam, Module, Static, Struct, Trait, TyBuilder, Type, TypeAlias, TypeOrConstParam,
|
||||
TypeParam, Union, Variant,
|
||||
LifetimeParam, Macro, Module, Static, Struct, Trait, TyBuilder, Type, TypeAlias,
|
||||
TypeOrConstParam, TypeParam, Union, Variant,
|
||||
};
|
||||
|
||||
impl HirDisplay for Function {
|
||||
|
@ -509,3 +509,14 @@ impl HirDisplay for Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HirDisplay for Macro {
|
||||
fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
|
||||
match self.id {
|
||||
hir_def::MacroId::Macro2Id(_) => write!(f, "macro"),
|
||||
hir_def::MacroId::MacroRulesId(_) => write!(f, "macro_rules!"),
|
||||
hir_def::MacroId::ProcMacroId(_) => write!(f, "proc_macro"),
|
||||
}?;
|
||||
write!(f, " {}", self.name(f.db))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue