Move version check next to existing check

This commit is contained in:
Robert
2023-07-14 14:20:58 +01:00
parent 12511922ad
commit 1dcd048268

View File

@@ -54,16 +54,6 @@ export class DataExtensionsEditorModule {
public getCommands(): DataExtensionsEditorCommands {
return {
"codeQL.openDataExtensionsEditor": async () => {
if (
!(await this.cliServer.cliConstraints.supportsResolveExtensions())
) {
void showAndLogErrorMessage(
this.app.logger,
"CodeQL CLI version v2.10.2 or later is required to use the data extensions editor.",
);
return;
}
const db = this.databaseManager.currentDatabaseItem;
if (!db) {
void showAndLogErrorMessage(this.app.logger, "No database selected");
@@ -88,6 +78,16 @@ export class DataExtensionsEditorModule {
return;
}
if (
!(await this.cliServer.cliConstraints.supportsResolveExtensions())
) {
void showAndLogErrorMessage(
this.app.logger,
`This feature requires CodeQL CLI version ${CliVersionConstraint.CLI_VERSION_WITH_RESOLVE_EXTENSIONS.format()} or later.`,
);
return;
}
const modelFile = await pickExtensionPack(
this.cliServer,
db,