Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: exclude auraenabled as valid annotation #6005

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/salesforcedx-vscode-apex/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const APEX_ACTION_PROP_DEF_MODIFIERS = ['static'];
const APEX_ACTION_PROP_ACCESS_MODIFIERS = ['global', 'public'];
const APEX_ACTION_CLASS_REST_ANNOTATION = ['RestResource'];
const APEX_ACTION_METHOD_REST_ANNOTATION = ['HttpDelete', 'HttpGet', 'HttpPatch', 'HttpPost', 'HttpPut'];
const APEX_ACTION_METHOD_ANNOTATION = ['AuraEnabled'];
// 'AuraEnabled' was removed for W-17550288 and should be added back with W-17579102
const APEX_ACTION_METHOD_ANNOTATION: string[] = [];

// Default eligibility for general OAS generation. Users can changed the setting through VSCode configurations
const DEFAULT_CLASS_ACCESS_MODIFIERS = ['global', 'public'];
Expand Down
13 changes: 12 additions & 1 deletion packages/salesforcedx-vscode-apex/test/jest/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import { SFDX_CORE_CONFIGURATION_NAME } from '@salesforce/salesforcedx-utils-vscode';
import * as vscode from 'vscode';
import { retrieveEnableSyncInitJobs, retrieveTestCodeCoverage } from '../../src/settings';
import { retrieveAAMethodAnnotations, retrieveEnableSyncInitJobs, retrieveTestCodeCoverage } from '../../src/settings';

describe('settings Unit Tests.', () => {
const vscodeMocked = jest.mocked(vscode);
Expand Down Expand Up @@ -40,4 +40,15 @@ describe('settings Unit Tests.', () => {
expect(getConfigurationMock).toHaveBeenCalledWith();
expect(getFn).toHaveBeenCalledWith('salesforcedx-vscode-apex.wait-init-jobs', true);
});

it('Should be able to get retrieveAAMethodAnnotations setting.', () => {
getConfigurationMock.mockReturnValue({
get: getFn.mockReturnValue(['UserDefinedModifier'])
} as any);

const result = retrieveAAMethodAnnotations();
expect(result).toEqual(['UserDefinedModifier']);
expect(getConfigurationMock).toHaveBeenCalledWith();
expect(getFn).toHaveBeenCalledWith('salesforcedx-vscode-apex.apexoas.aa.method.annotations', []);
});
});
Loading