diff --git a/helix-core/src/completion.rs b/helix-core/src/completion.rs index c13b440c0c84..29c86b7380a2 100644 --- a/helix-core/src/completion.rs +++ b/helix-core/src/completion.rs @@ -8,7 +8,7 @@ pub struct CompletionItem { pub label: Cow<'static, str>, pub kind: Cow<'static, str>, /// Containing Markdown - pub documentation: String, + pub documentation: Option, pub provider: CompletionProvider, } diff --git a/helix-term/src/handlers/completion/path.rs b/helix-term/src/handlers/completion/path.rs index 21dc9c31f5b9..c2ffa5efa44e 100644 --- a/helix-term/src/handlers/completion/path.rs +++ b/helix-term/src/handlers/completion/path.rs @@ -113,7 +113,7 @@ pub(crate) fn path_completion( kind: Cow::Borrowed(kind), label: file_name.into(), transaction, - documentation, + documentation: Some(documentation), provider: CompletionProvider::Path, })) }) diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index be78dd083218..e17762bfc5ef 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -523,7 +523,10 @@ impl Component for Completion { None => return, }, CompletionItem::Other(option) => { - markdowned(language, None, Some(&option.documentation)) + let Some(doc) = option.documentation.as_deref() else { + return; + }; + markdowned(language, None, Some(doc)) } };