Skip to content

Commit eba67f8

Browse files
committed
Apply suggestions from review
1 parent b7a97d3 commit eba67f8

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

extensions/ql-vscode/src/distribution.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,13 @@ class ExtensionSpecificDistributionManager {
362362
// FIXME: Look for platform-specific codeql distribution if available
363363
// https://github.com/github/vscode-codeql/issues/417
364364
const matchingAssets = release.assets.filter(asset => asset.name === 'codeql.zip');
365-
if (matchingAssets.length !== 1) {
366-
if (matchingAssets.length > 1) {
367-
logger.log("WARNING: Ignoring a release with more than one asset named codeql.zip");
368-
}
365+
if (matchingAssets.length === 0) {
366+
// For example, this could be a release with only platform-specific assets.
367+
logger.log("INFO: Ignoring a release with no assets named codeql.zip");
368+
return false;
369+
}
370+
if (matchingAssets.length > 1) {
371+
logger.log("WARNING: Ignoring a release with more than one asset named codeql.zip");
369372
return false;
370373
}
371374
return true;
@@ -591,19 +594,25 @@ export type FindDistributionResult =
591594
| IncompatibleDistributionResult
592595
| NoDistributionResult;
593596

594-
interface CompatibleDistributionResult {
597+
/**
598+
* A result representing a distribution of the CodeQL CLI that may or may not be compatible with
599+
* the extension.
600+
*/
601+
interface DistributionResult {
595602
distribution: Distribution;
603+
kind: FindDistributionResultKind;
604+
}
605+
606+
interface CompatibleDistributionResult extends DistributionResult {
596607
kind: FindDistributionResultKind.CompatibleDistribution;
597608
version: semver.SemVer;
598609
}
599610

600-
interface UnknownCompatibilityDistributionResult {
601-
distribution: Distribution;
611+
interface UnknownCompatibilityDistributionResult extends DistributionResult {
602612
kind: FindDistributionResultKind.UnknownCompatibilityDistribution;
603613
}
604614

605-
interface IncompatibleDistributionResult {
606-
distribution: Distribution;
615+
interface IncompatibleDistributionResult extends DistributionResult {
607616
kind: FindDistributionResultKind.IncompatibleDistribution;
608617
version: semver.SemVer;
609618
}

0 commit comments

Comments
 (0)