@@ -17,7 +17,7 @@ import { ErrorCodes, ResponseError } from 'vscode-languageclient';
1717import * as cli from './cli' ;
1818import * as config from './config' ;
1919import { DatabaseItem } from './databases' ;
20- import { getOnDiskWorkspaceFolders , showAndLogErrorMessage } from './helpers' ;
20+ import { getOnDiskWorkspaceFolders , showAndLogErrorMessage , tryGetQueryMetadata } from './helpers' ;
2121import { ProgressCallback , UserCancellationException } from './commandRunner' ;
2222import { DatabaseInfo , QueryMetadata , ResultsPaths } from './pure/interface-types' ;
2323import { logger } from './logging' ;
@@ -612,7 +612,7 @@ export async function compileAndRunQueryAgainstDatabase(
612612 } ;
613613
614614 // Read the query metadata if possible, to use in the UI.
615- const metadata = await getQueryMetadata ( cliServer , qlProgram . queryPath ) ;
615+ const metadata = await tryGetQueryMetadata ( cliServer , qlProgram . queryPath ) ;
616616
617617 let availableMlModels : cli . MlModelInfo [ ] = [ ] ;
618618 // The `capabilities.untrustedWorkspaces.restrictedConfigurations` entry in package.json doesn't
@@ -712,22 +712,6 @@ const compilationFailedErrorTail = ' compilation failed. Please make sure there
712712 ' and the query and database use the same target language. For more details on the error, go to View > Output,' +
713713 ' and choose CodeQL Query Server from the dropdown.' ;
714714
715- /**
716- * Gets metadata for a query, if it exists.
717- * @param cliServer The CLI server.
718- * @param queryPath The path to the query.
719- * @returns A promise that resolves to the query metadata, if available.
720- */
721- export async function getQueryMetadata ( cliServer : cli . CodeQLCliServer , queryPath : string ) : Promise < QueryMetadata | undefined > {
722- try {
723- return await cliServer . resolveMetadata ( queryPath ) ;
724- } catch ( e ) {
725- // Ignore errors and provide no metadata.
726- void logger . log ( `Couldn't resolve metadata for ${ queryPath } : ${ e } ` ) ;
727- return ;
728- }
729- }
730-
731715function createSyntheticResult (
732716 query : QueryInfo ,
733717 db : DatabaseItem ,
0 commit comments