From ca45782e3217d24a8ae7d88b6f6c2847b4960be5 Mon Sep 17 00:00:00 2001 From: Risu <79110363+risu729@users.noreply.github.com> Date: Sat, 14 Feb 2026 22:09:36 +1100 Subject: [PATCH 1/2] fix(asset_matcher): penalize vsix files --- src/backend/asset_matcher.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/backend/asset_matcher.rs b/src/backend/asset_matcher.rs index fab411e431..cac3cf0155 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,15 @@ 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()]; + + let picked = picker.pick_best_asset(&assets).unwrap(); + // This fails currently because .vsix is not penalized and .gz is not an archive + // We want .gz to be picked + assert_eq!(picked, "rust-analyzer-x86_64-apple-darwin.gz"); + } } From d3dda28b51fc043b9b65f19ec5c00d0f7446bb13 Mon Sep 17 00:00:00 2001 From: Risu <79110363+risu729@users.noreply.github.com> Date: Sat, 14 Feb 2026 22:37:02 +1100 Subject: [PATCH 2/2] test: update vsix test --- src/backend/asset_matcher.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/asset_matcher.rs b/src/backend/asset_matcher.rs index cac3cf0155..1c7e99ac20 100644 --- a/src/backend/asset_matcher.rs +++ b/src/backend/asset_matcher.rs @@ -1377,11 +1377,12 @@ abc123def456abc123def456abc123def456abc123def456abc123def456abcd tool-darwin.ta #[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()]; + 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(); - // This fails currently because .vsix is not penalized and .gz is not an archive - // We want .gz to be picked assert_eq!(picked, "rust-analyzer-x86_64-apple-darwin.gz"); } }