Skip to content

Commit

Permalink
fix: forceTaskStop and forceOpenDocumentation to sf (#5297)
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiCanizales authored Jan 8, 2024
1 parent 0d37e5d commit 2d79485
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 33 deletions.
16 changes: 8 additions & 8 deletions packages/salesforcedx-vscode-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"views": {
"explorer": [
{
"id": "sfdx.force.tasks.view",
"id": "sfdx.tasks.view",
"name": "%running_tasks_title_text%"
}
],
Expand Down Expand Up @@ -182,8 +182,8 @@
],
"view/item/context": [
{
"command": "sfdx.force.task.stop",
"when": "view == sfdx.force.tasks.view"
"command": "sfdx.task.stop",
"when": "view == sfdx.tasks.view"
},
{
"command": "sfdx.force.metadata.view.component.refresh",
Expand Down Expand Up @@ -364,7 +364,7 @@
"when": "sfdx:project_opened && sfdx:has_default_username"
},
{
"command": "sfdx.force.open.documentation",
"command": "sfdx.open.documentation",
"when": "sfdx:project_opened"
},
{
Expand Down Expand Up @@ -404,7 +404,7 @@
"when": "sfdx:project_opened && !sfdx:isv_debug_project && sfdx:default_username_has_change_tracking"
},
{
"command": "sfdx.force.task.stop",
"command": "sfdx.task.stop",
"when": "sfdx:project_opened"
},
{
Expand Down Expand Up @@ -643,8 +643,8 @@
"title": "%org_logout_default_text%"
},
{
"command": "sfdx.force.open.documentation",
"title": "%force_open_documentation_text%"
"command": "sfdx.open.documentation",
"title": "%open_documentation_text%"
},
{
"command": "sfdx.org.create",
Expand Down Expand Up @@ -683,7 +683,7 @@
"title": "%force_source_status_remote_text%"
},
{
"command": "sfdx.force.task.stop",
"command": "sfdx.task.stop",
"title": "%cancel_sfdx_command_text%"
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/salesforcedx-vscode-core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"force_lightning_lwc_test_create_text": "SFDX: Create Lightning Web Component Test",
"force_lightning_rename_component_text": "SFDX: Rename Component",
"force_manifest_editor_show_text": "SFDX: Show Package Manifest Editor",
"force_open_documentation_text": "SFDX: Open Documentation",
"force_package_install_text": "SFDX: Install Package",
"force_sobjects_refresh": "SFDX: Refresh SObject Definitions",
"force_source_deploy_in_manifest_text": "SFDX: Deploy Source in Manifest to Org",
Expand All @@ -51,6 +50,7 @@
"lightning_generate_interface_text": "SFDX: Create Aura Interface",
"lightning_generate_lwc_text": "SFDX: Create Lightning Web Component",
"node_extra_ca_certs_description": "NODE_EXTRA_CA_CERTS CLI environment variable value",
"open_documentation_text": "SFDX: Open Documentation",
"org_create_default_scratch_org_text": "SFDX: Create a Default Scratch Org...",
"org_delete_default_text": "SFDX: Delete Default Org",
"org_delete_username_text": "SFDX: Delete Org...",
Expand Down
4 changes: 2 additions & 2 deletions packages/salesforcedx-vscode-core/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export {
ForceListMetadataExecutor,
forceListMetadata
} from './forceListMetadata';
export { forceOpenDocumentation } from './forceOpenDocumentation';
export {
ForcePackageInstallExecutor,
SelectInstallationKey,
Expand Down Expand Up @@ -97,7 +96,7 @@ export {
SourceStatusFlags,
forceSourceStatus
} from './forceSourceStatus';
export { forceTaskStop } from './forceTaskStop';
export { openDocumentation } from './openDocumentation';
export { AliasGatherer, OrgCreateExecutor, orgCreate } from './orgCreate';
export { orgDelete } from './orgDelete';
export { OrgDisplay, orgDisplay } from './orgDisplay';
Expand Down Expand Up @@ -139,6 +138,7 @@ export {
stopApexDebugLogging,
turnOffLogging
} from './stopApexDebugLogging';
export { taskStop } from './taskStop';
export {
analyticsGenerateTemplate,
apexGenerateClass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../constants';
import { nls } from '../messages';

export async function forceOpenDocumentation() {
export async function openDocumentation() {
let docUrl = '';
const editor = vscode.window.activeTextEditor;
if (editor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { Task, taskViewService } from '../statuses';

export function forceTaskStop(task: Task) {
export function taskStop(task: Task) {
if (task instanceof Task) {
// See https://github.com/Microsoft/vscode-docs/blob/master/docs/extensionAPI/extension-points.md#contributesmenus
// For best case inference efforts on what to pass in
Expand Down
22 changes: 11 additions & 11 deletions packages/salesforcedx-vscode-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
forceAuthAccessToken,
forceCreateManifest,
forceLightningLwcTestCreate,
forceOpenDocumentation,
forcePackageInstall,
forceRefreshSObjects,
forceRenameLightningComponent,
Expand All @@ -45,7 +44,6 @@ import {
forceSourceRetrieveCmp,
forceSourceRetrieveManifest,
forceSourceRetrieveSourcePaths,
forceTaskStop,
initSObjectDefinitions,
internalLightningGenerateApp,
internalLightningGenerateAuraComponent,
Expand All @@ -57,6 +55,7 @@ import {
lightningGenerateEvent,
lightningGenerateInterface,
lightningGenerateLwc,
openDocumentation,
orgCreate,
orgDelete,
orgDisplay,
Expand All @@ -70,6 +69,7 @@ import {
sfProjectGenerate,
startApexDebugLogging,
stopApexDebugLogging,
taskStop,
turnOffLogging,
viewAllChanges,
viewLocalChanges,
Expand Down Expand Up @@ -155,9 +155,9 @@ function registerCommands(
'sfdx.org.logout.default',
orgLogoutDefault
);
const forceOpenDocumentationCmd = vscode.commands.registerCommand(
'sfdx.force.open.documentation',
forceOpenDocumentation
const openDocumentationCmd = vscode.commands.registerCommand(
'sfdx.open.documentation',
openDocumentation
);
const orgCreateCmd = vscode.commands.registerCommand(
'sfdx.org.create',
Expand Down Expand Up @@ -231,9 +231,9 @@ function registerCommands(
'sfdx.force.source.status.remote',
viewRemoteChanges
);
const forceTaskStopCmd = vscode.commands.registerCommand(
'sfdx.force.task.stop',
forceTaskStop
const taskStopCmd = vscode.commands.registerCommand(
'sfdx.task.stop',
taskStop
);
const apexGenerateClassCmd = vscode.commands.registerCommand(
'sfdx.apex.generate.class',
Expand Down Expand Up @@ -396,7 +396,7 @@ function registerCommands(
dataQueryInputCmd,
dataQuerySelectionCmd,
forceDiffFile,
forceOpenDocumentationCmd,
openDocumentationCmd,
orgCreateCmd,
orgDeleteDefaultCmd,
orgDeleteUsernameCmd,
Expand All @@ -417,7 +417,7 @@ function registerCommands(
forceSourceStatusCmd,
forceSourceStatusLocalCmd,
forceSourceStatusRemoteCmd,
forceTaskStopCmd,
taskStopCmd,
apexGenerateClassCmd,
apexGenerateUnitTestClassCmd,
analyticsGenerateTemplateCmd,
Expand Down Expand Up @@ -556,7 +556,7 @@ export async function activate(extensionContext: vscode.ExtensionContext) {

// Task View
const treeDataProvider = vscode.window.registerTreeDataProvider(
'sfdx.force.tasks.view',
'sfdx.tasks.view',
taskViewService
);
extensionContext.subscriptions.push(treeDataProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import { expect } from 'chai';
import { createSandbox, SinonStub } from 'sinon';
import * as vscode from 'vscode';
import { forceOpenDocumentation } from '../../../src/commands';
import { openDocumentation } from '../../../src/commands';
import { nls } from '../../../src/messages';

const sb = createSandbox();

describe('forceOpenDocumentation', () => {
describe('openDocumentation', () => {
let activeTextEditorStub: SinonStub;
let openExternalStub: SinonStub;

Expand All @@ -36,7 +36,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(auraDocUrl);
});
Expand All @@ -50,7 +50,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(apexDocUrl);
});
Expand All @@ -64,7 +64,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(apexDocUrl);
});
Expand All @@ -78,7 +78,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(soqlDocUrl);
});
Expand All @@ -93,7 +93,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(lwcDocUrl);
});
Expand All @@ -107,7 +107,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(
functionsDocUrl
Expand All @@ -123,7 +123,7 @@ describe('forceOpenDocumentation', () => {
}
}));

await forceOpenDocumentation();
await openDocumentation();

expect(openExternalStub.getCall(0).args[0].toString()).to.equal(
defaultDocUrl
Expand Down

0 comments on commit 2d79485

Please sign in to comment.