diff --git a/helix-term/src/handlers/completion/resolve.rs b/helix-term/src/handlers/completion/resolve.rs index 6b70e52cd87a9..a2d9c13e8164d 100644 --- a/helix-term/src/handlers/completion/resolve.rs +++ b/helix-term/src/handlers/completion/resolve.rs @@ -42,9 +42,17 @@ impl ResolveHandler { if item.resolved { return; } + // We resolve items when docs or details are missing or when the additional text edits + // are either `None` or `Some([])`. The spec is not totally explicit on the conditions + // for this and needing to resolve when the additional text edits are `Some([])` is + // probably a consequence of how null works in the JavaScript world. let needs_resolve = item.item.documentation.is_none() || item.item.detail.is_none() - || item.item.additional_text_edits.is_none(); + || !item + .item + .additional_text_edits + .as_ref() + .is_some_and(|edits| !edits.is_empty()); if !needs_resolve { item.resolved = true; return;