internal: Support registered tools and attributes in ide layer

This commit is contained in:
Lukas Wirth 2022-01-06 14:56:50 +01:00
parent 8887d2016f
commit dc135cc076
4 changed files with 76 additions and 19 deletions

View file

@ -393,7 +393,10 @@ fn render_builtin_attr(db: &RootDatabase, attr: hir::BuiltinAttr) -> Option<Mark
let name = attr.name(db);
let desc = format!("#[{}]", name);
let AttributeTemplate { word, list, name_value_str } = attr.template(db);
let AttributeTemplate { word, list, name_value_str } = match attr.template(db) {
Some(template) => template,
None => return Some(Markup::fenced_block(&attr.name(db))),
};
let mut docs = "Valid forms are:".to_owned();
if word {
format_to!(docs, "\n - #\\[{}]", name);