Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

tests: Fix doctests in crates/component (#37716)

Martin Poolabac87c2f891
diff --git a/Cargo.lock b/Cargo.lock
index dbcea05ea9b..5ca8375fef2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3515,6 +3515,7 @@ name = "component"
version = "0.1.0"
dependencies = [
"collections",
+ "documented",
"gpui",
"inventory",
"parking_lot",
diff --git a/crates/component/Cargo.toml b/crates/component/Cargo.toml
index 92249de454d..74481834f1c 100644
--- a/crates/component/Cargo.toml
+++ b/crates/component/Cargo.toml
@@ -20,5 +20,8 @@ strum.workspace = true
theme.workspace = true
workspace-hack.workspace = true
+[dev-dependencies]
+documented.workspace = true
+
[features]
default = []
diff --git a/crates/component/src/component.rs b/crates/component/src/component.rs
index 0c05ba4a97f..8c7b7ea4d73 100644
--- a/crates/component/src/component.rs
+++ b/crates/component/src/component.rs
@@ -227,6 +227,8 @@ pub trait Component {
/// Example:
///
/// ```
+ /// use documented::Documented;
+ ///
/// /// This is a doc comment.
/// #[derive(Documented)]
/// struct MyComponent;