diff --git a/src/backend/asset_matcher.rs b/src/backend/asset_matcher.rs index fab411e431..1c7e99ac20 100644 --- a/src/backend/asset_matcher.rs +++ b/src/backend/asset_matcher.rs @@ -353,6 +353,11 @@ impl AssetPicker { penalty -= 50; } + // Penalize .vsix files + if asset.ends_with(".vsix") { + penalty -= 100; + } + // Penalize metadata/checksum/signature files if asset.ends_with(".asc") || asset.ends_with(".sig") @@ -1368,4 +1373,16 @@ abc123def456abc123def456abc123def456abc123def456abc123def456abcd tool-darwin.ta "Should return the only provenance file available" ); } + + #[test] + fn test_vsix_vs_gz() { + let picker = AssetPicker::with_libc("macos".to_string(), "x86_64".to_string(), None); + let assets = vec![ + "rust-analyzer-x86_64-apple-darwin.gz".to_string(), + "rust-analyzer-x86_64-apple-darwin.vsix".to_string(), + ]; + + let picked = picker.pick_best_asset(&assets).unwrap(); + assert_eq!(picked, "rust-analyzer-x86_64-apple-darwin.gz"); + } }