Update wording to be more clear

This commit is contained in:
shati-patel
2022-01-19 13:43:20 +00:00
committed by Shati Patel
parent b7bfd9ea85
commit f07d9cff9b
4 changed files with 17 additions and 17 deletions

View File

@@ -375,8 +375,8 @@
"title": "CodeQL: Clear Cache"
},
{
"command": "codeQL.installPacks",
"title": "CodeQL: Install Packs"
"command": "codeQL.installPackDependencies",
"title": "CodeQL: Install Pack Dependencies"
},
{
"command": "codeQL.downloadPacks",

View File

@@ -83,7 +83,7 @@ import { RemoteQuery } from './remote-queries/remote-query';
import { URLSearchParams } from 'url';
import { RemoteQueriesInterfaceManager } from './remote-queries/remote-queries-interface';
import { sampleRemoteQuery, sampleRemoteQueryResult } from './remote-queries/sample-data';
import { handleDownloadPacks, handleInstallPacks } from './packaging';
import { handleDownloadPacks, handleInstallPackDependencies } from './packaging';
/**
* extension.ts
@@ -924,12 +924,12 @@ async function activateWithInstalledDistribution(
}));
ctx.subscriptions.push(
commandRunnerWithProgress('codeQL.installPacks', async (
commandRunnerWithProgress('codeQL.installPackDependencies', async (
progress: ProgressCallback
) =>
await handleInstallPacks(cliServer, progress),
await handleInstallPackDependencies(cliServer, progress),
{
title: 'Installing packs',
title: 'Installing pack dependencies',
}
));

View File

@@ -71,7 +71,7 @@ export async function handleDownloadPacks(
void showAndLogInformationMessage('Finished downloading packs.');
} catch (error) {
void showAndLogErrorMessage(
'Unable to download all packs. See logs for more details.'
'Unable to download all packs. See log for more details.'
);
}
}
@@ -87,7 +87,7 @@ interface QLPackQuickPickItem extends QuickPickItem {
* @param cliServer The CLI server.
* @param progress A progress callback.
*/
export async function handleInstallPacks(
export async function handleInstallPackDependencies(
cliServer: CodeQLCliServer,
progress: ProgressCallback,
): Promise<void> {
@@ -96,7 +96,7 @@ export async function handleInstallPacks(
} or later.`);
}
progress({
message: 'Choose packs to install',
message: 'Choose packs to install dependencies for',
step: 1,
maxStep: 2,
});
@@ -106,13 +106,13 @@ export async function handleInstallPacks(
packRootDir: value,
}));
const packsToInstall = await window.showQuickPick(quickPickItems, {
placeHolder: 'Select packs to install',
placeHolder: 'Select packs to install dependencies for',
canPickMany: true,
ignoreFocusOut: true,
});
if (packsToInstall && packsToInstall.length > 0) {
progress({
message: 'Installing packs. This may take a few minutes.',
message: 'Installing dependencies. This may take a few minutes.',
step: 2,
maxStep: 2,
});
@@ -131,10 +131,10 @@ export async function handleInstallPacks(
if (failedPacks.length > 0) {
void logger.log(`Errors:\n${errors.join('\n')}`);
throw new Error(
`Unable to install packs: ${failedPacks.join(', ')}. See log for more details.`
`Unable to install pack dependencies for: ${failedPacks.join(', ')}. See log for more details.`
);
} else {
void showAndLogInformationMessage('Finished installing packs.');
void showAndLogInformationMessage('Finished installing pack dependencies.');
}
} else {
throw new UserCancellationException('No packs selected.');

View File

@@ -101,9 +101,9 @@ describe('Packaging commands', function() {
},
]);
await mod.handleInstallPacks(cli, progress);
await mod.handleInstallPackDependencies(cli, progress);
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
'Finished installing packs.'
'Finished installing pack dependencies.'
);
});
@@ -118,11 +118,11 @@ describe('Packaging commands', function() {
try {
// expect this to throw an error
await mod.handleInstallPacks(cli, progress);
await mod.handleInstallPackDependencies(cli, progress);
// This line should not be reached
expect(true).to.be.false;
} catch (error) {
expect(error.message).to.contain('Unable to install packs:');
expect(error.message).to.contain('Unable to install pack dependencies');
}
});
});