Skip to content

Commit b7a97d3

Browse files
Apply suggestions from code review
Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
1 parent 18a9e27 commit b7a97d3

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

extensions/ql-vscode/src/distribution.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,7 @@ export class DistributionManager implements DistributionProvider {
117117

118118
public async getCodeQlPathWithoutVersionCheck(): Promise<string | undefined> {
119119
const distribution = await this.getDistributionWithoutVersionCheck();
120-
if (distribution === undefined) {
121-
return undefined;
122-
}
123-
return distribution.codeQlPath;
120+
return distribution?.codeQlPath;
124121
}
125122

126123
/**
@@ -184,7 +181,7 @@ export class DistributionManager implements DistributionProvider {
184181
minSecondsSinceLastUpdateCheck: number): Promise<DistributionUpdateCheckResult> {
185182
const distribution = await this.getDistributionWithoutVersionCheck();
186183
const extensionManagedCodeQlPath = await this._extensionSpecificDistributionManager.getCodeQlPathWithoutVersionCheck();
187-
if (distribution !== undefined && distribution.codeQlPath !== extensionManagedCodeQlPath) {
184+
if (distribution?.codeQlPath !== extensionManagedCodeQlPath) {
188185
// A distribution is present but it isn't managed by the extension.
189186
return createInvalidLocationResult();
190187
}

extensions/ql-vscode/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ export async function activate(ctx: ExtensionContext): Promise<void> {
202202
case DistributionKind.CustomPathConfig:
203203
return `Please update the \"CodeQL CLI Executable Path\" setting to point to a CLI in the version range ${codeQlVersionRange}.`;
204204
case DistributionKind.PathEnvironmentVariable:
205-
return `Please update the CodeQL CLI on your PATH to a version in the range ${codeQlVersionRange}, or ` +
206-
`set the \"CodeQL CLI Executable Path\" setting to the path of a CLI in the version range ${codeQlVersionRange}.`;
205+
return `Please update the CodeQL CLI on your PATH to a version compatible with ${codeQlVersionRange}, or ` +
206+
`set the \"CodeQL CLI Executable Path\" setting to the path of a CLI version compatible with ${codeQlVersionRange}.`;
207207
}
208208
})();
209209

0 commit comments

Comments
 (0)