zed_todo_tree/
lib.rs

1use zed_extension_api::{self as zed};
2
3/// The main extension struct for Todo Tree.
4///
5/// This extension provides syntax highlighting for TODO-style comments
6/// and grants capabilities for the todo-tree CLI to be used in tasks.
7struct TodoTreeExtension;
8
9impl zed::Extension for TodoTreeExtension {
10    /// Called when the extension is first loaded.
11    fn new() -> Self
12    where
13        Self: Sized,
14    {
15        TodoTreeExtension
16    }
17}
18
19// Register the extension with Zed
20zed::register_extension!(TodoTreeExtension);
21
22#[cfg(test)]
23mod tests {
24    use super::*;
25    use zed_extension_api::Extension;
26
27    #[test]
28    fn test_extension_struct_is_send_sync() {
29        fn assert_send_sync<T: Send + Sync>() {}
30        assert_send_sync::<TodoTreeExtension>();
31    }
32
33    #[test]
34    fn test_extension_new_creates_instance() {
35        let _extension = TodoTreeExtension::new();
36    }
37}