Skip to content

Commit

Permalink
Fix docs path for derive macros
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Nov 4, 2023
1 parent 11a263d commit 19bf0da
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/ide/src/doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,17 @@ fn filename_and_frag_for_def(
}
Definition::Const(c) => format!("const.{}.html", c.name(db)?.display(db.upcast())),
Definition::Static(s) => format!("static.{}.html", s.name(db).display(db.upcast())),
Definition::Macro(mac) => format!("macro.{}.html", mac.name(db).display(db.upcast())),
Definition::Macro(mac) => match mac.kind(db) {
hir::MacroKind::Declarative
| hir::MacroKind::BuiltIn
| hir::MacroKind::Attr
| hir::MacroKind::ProcMacro => {
format!("macro.{}.html", mac.name(db).display(db.upcast()))
}
hir::MacroKind::Derive => {
format!("derive.{}.html", mac.name(db).display(db.upcast()))
}
},
Definition::Field(field) => {
let def = match field.parent_def(db) {
hir::VariantDef::Struct(it) => Definition::Adt(it.into()),
Expand Down

0 comments on commit 19bf0da

Please sign in to comment.