Skip to content

Commit d0106ba

Browse files
committed
Produce nicer signatures for trait documentation
This ensures the signatures are more consistent with those produced for types. Changelog: changed
1 parent c4a93ee commit d0106ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/docs.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,16 @@ impl<'a> GenerateDocumentation<'a> {
519519
let name = id.name(self.db()).clone();
520520
let docs = id.documentation(self.db()).clone();
521521
let mut obj = Object::new();
522+
let typ = format!(
523+
"trait{} {}",
524+
if public { " pub" } else { "" },
525+
format_type(self.db(), id)
526+
);
522527

523528
obj.add("name", Json::String(name));
524529
obj.add("location", location_to_json(id.location(self.db())));
525530
obj.add("public", Json::Bool(public));
526-
obj.add("type", Json::String(format_type(self.db(), id)));
531+
obj.add("type", Json::String(typ));
527532
obj.add("documentation", Json::String(docs));
528533
obj.add(
529534
"required_methods",

0 commit comments

Comments
 (0)