fix: resolve dependency matching bug in add command #3572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes: #3026
Enhances the error message in pixi add when no package candidates are found for a specified dependency (e.g., pixi add bla). Instead of a generic "No candidates were found" error, it now suggests up to 3 similar package names using the strsim::jaro similarity algorithm (threshold 0.6), reused from pixi/crates/pixi_manifest/src/error.rs (lines 286–304), and adds a tip: "Tip: Run pixi search to explore available packages." The solution modifies pixi/src/cli/add.rs to fetch repodata, compute suggestions, and print the improved message, while adding a CLI test in pixi/tests/cli/add.rs to verify the output. Dependencies (strsim, itertools) are ensured in pixi/Cargo.toml. Changes are kept minimal per mentor guidance, avoiding version inclusion (e.g., blaz (1.2.3)) and new modules.