pub fn build_feature_completion(
feature_name: &str,
package_name: &str,
insert_range: Option<Range>,
) -> CompletionItemExpand description
Builds a completion item for a feature flag.
Creates a properly formatted LSP CompletionItem for feature flag names. Only applicable to ecosystems that support features (e.g., Cargo).
§Arguments
feature_name- Name of the feature flagpackage_name- Name of the package this feature belongs toinsert_range- LSP range where the completion should be inserted, orNoneto omittextEditand let the client insert at cursor position viainsertText
§Returns
A complete CompletionItem for the feature flag.
§Examples
use deps_core::completion::build_feature_completion;
let item = build_feature_completion("derive", "serde", None);
assert_eq!(item.label, "derive");