Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/backend/asset_matcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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");
}
}
Loading