Split out listModelFiles from loadModeledMethods
This commit is contained in:
@@ -43,18 +43,7 @@ export async function loadModeledMethods(
|
||||
cliServer: CodeQLCliServer,
|
||||
logger: NotificationLogger,
|
||||
): Promise<Record<string, ModeledMethod>> {
|
||||
const extensions = await cliServer.resolveExtensions(
|
||||
extensionPack.path,
|
||||
getOnDiskWorkspaceFolders(),
|
||||
);
|
||||
|
||||
const modelFiles = new Set<string>();
|
||||
|
||||
if (extensionPack.path in extensions.data) {
|
||||
for (const extension of extensions.data[extensionPack.path]) {
|
||||
modelFiles.add(extension.file);
|
||||
}
|
||||
}
|
||||
const modelFiles = await listModelFiles(extensionPack.path, cliServer);
|
||||
|
||||
const existingModeledMethods: Record<string, ModeledMethod> = {};
|
||||
|
||||
@@ -81,3 +70,21 @@ export async function loadModeledMethods(
|
||||
|
||||
return existingModeledMethods;
|
||||
}
|
||||
|
||||
export async function listModelFiles(
|
||||
extensionPackPath: string,
|
||||
cliServer: CodeQLCliServer,
|
||||
): Promise<Set<string>> {
|
||||
const extensions = await cliServer.resolveExtensions(
|
||||
extensionPackPath,
|
||||
getOnDiskWorkspaceFolders(),
|
||||
);
|
||||
|
||||
const modelFiles = new Set<string>();
|
||||
if (extensionPackPath in extensions.data) {
|
||||
for (const extension of extensions.data[extensionPackPath]) {
|
||||
modelFiles.add(extension.file);
|
||||
}
|
||||
}
|
||||
return modelFiles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user