Skip to main content

complete_package_names_generic

Function complete_package_names_generic 

Source
pub async fn complete_package_names_generic(
    registry: &dyn Registry,
    prefix: &str,
    limit: usize,
    insert_range: Range,
) -> Vec<CompletionItem>
Expand description

Generic package name completion using any Registry implementation.

Searches the registry for packages matching prefix and returns up to limit completion items, each with its textEdit set to replace insert_range. Returns empty vec if prefix is shorter than 2 characters or longer than 200 characters. A result whose name fails build_package_completion’s crate::is_safe_package_name gate is silently dropped rather than surfaced as an error, matching the fallback-search completion builder’s convention (create_package_completion_item in deps-lsp).