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 { public getCommands(): DataExtensionsEditorCommands {
return { return {
"codeQL.openDataExtensionsEditor": async () => { "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; const db = this.databaseManager.currentDatabaseItem;
if (!db) { if (!db) {
void showAndLogErrorMessage(this.app.logger, "No database selected"); void showAndLogErrorMessage(this.app.logger, "No database selected");
@@ -88,6 +78,16 @@ export class DataExtensionsEditorModule {
return; 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( const modelFile = await pickExtensionPack(
this.cliServer, this.cliServer,
db, db,