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.

assistant: Fix loading local crate docs (#13147)

Marshall Bowers2e87e1d26e86
diff --git a/crates/assistant/src/slash_command/rustdoc_command.rs b/crates/assistant/src/slash_command/rustdoc_command.rs
index 4eabc2821e1..ecb6cee660f 100644
--- a/crates/assistant/src/slash_command/rustdoc_command.rs
+++ b/crates/assistant/src/slash_command/rustdoc_command.rs
@@ -180,7 +180,14 @@ impl SlashCommand for RustdocSlashCommand {
let item_path = item_path.clone();
async move {
let item_docs = rustdoc_store
- .load(crate_name.clone(), Some(item_path.join("::")))
+ .load(
+ crate_name.clone(),
+ if item_path.is_empty() {
+ None
+ } else {
+ Some(item_path.join("::"))
+ },
+ )
.await;
if let Ok(item_docs) = item_docs {