diff --git a/packages/salesforcedx-vscode-apex/src/languageServer.ts b/packages/salesforcedx-vscode-apex/src/languageServer.ts index 02bd7b7bb5..223d07441b 100644 --- a/packages/salesforcedx-vscode-apex/src/languageServer.ts +++ b/packages/salesforcedx-vscode-apex/src/languageServer.ts @@ -22,7 +22,8 @@ import { retrieveAAMethodAccessModifiers, retrieveAAPropDefModifiers, retrieveAAPropAccessModifiers, - retrieveAAAnnotations, + retrieveAAClassAnnotations, + retrieveAAMethodAnnotations, retrieveGeneralClassAccessModifiers, retrieveGeneralMethodAccessModifiers, retrieveGeneralPropAccessModifiers @@ -170,7 +171,8 @@ export const buildClientOptions = (): LanguageClientOptions => { apexActionMethodAccessModifiers: retrieveAAMethodAccessModifiers().join(','), apexActionPropDefModifiers: retrieveAAPropDefModifiers().join(','), apexActionPropAccessModifiers: retrieveAAPropAccessModifiers().join(','), - apexActionAnnotations: retrieveAAAnnotations().join(','), + apexActionClassAnnotations: retrieveAAClassAnnotations().join(','), + apexActionMethodAnnotations: retrieveAAMethodAnnotations().join(','), apexOASClassAccessModifiers: retrieveGeneralClassAccessModifiers().join(','), apexOASMethodAccessModifiers: retrieveGeneralMethodAccessModifiers().join(','), apexOASPropAccessModifiers: retrieveGeneralPropAccessModifiers().join(',') diff --git a/packages/salesforcedx-vscode-apex/src/settings.ts b/packages/salesforcedx-vscode-apex/src/settings.ts index 620b509f8e..487f73a759 100644 --- a/packages/salesforcedx-vscode-apex/src/settings.ts +++ b/packages/salesforcedx-vscode-apex/src/settings.ts @@ -15,7 +15,8 @@ const APEX_ACTION_METHOD_DEF_MODIFIERS = ['static']; const APEX_ACTION_METHOD_ACCESS_MODIFIERS = ['global', 'public']; const APEX_ACTION_PROP_DEF_MODIFIERS = ['static']; const APEX_ACTION_PROP_ACCESS_MODIFIERS = ['global', 'public']; -const APEX_ACTION_ANNOTATIONS = ['AuraEnabled', 'RestResource']; +const APEX_ACTION_CLASS_ANNOTATION = ['AuraEnabled', 'RestResource']; +const APEX_ACTION_METHOD_ANNOTATION = ['AuraEnabled', 'HttpDelete', 'HttpGet', 'HttpPatch', 'HttpPost', 'HttpPut']; // Default eligibility for general OAS generation. Users can changed the setting through VSCode configurations const DEFAULT_CLASS_ACCESS_MODIFIERS = ['global', 'public']; @@ -78,11 +79,18 @@ export const retrieveAAPropAccessModifiers = (): string[] => { return [...new Set([...APEX_ACTION_PROP_ACCESS_MODIFIERS, ...userDefinedModifiers])]; }; -export const retrieveAAAnnotations = (): string[] => { +export const retrieveAAClassAnnotations = (): string[] => { const userDefinedModifiers = vscode.workspace .getConfiguration() - .get('salesforcedx-vscode-apex.apexoas.aa.annotations', []); - return [...new Set([...APEX_ACTION_ANNOTATIONS, ...userDefinedModifiers])]; + .get('salesforcedx-vscode-apex.apexoas.aa.class.annotations', []); + return [...new Set([...APEX_ACTION_CLASS_ANNOTATION, ...userDefinedModifiers])]; +}; + +export const retrieveAAMethodAnnotations = (): string[] => { + const userDefinedModifiers = vscode.workspace + .getConfiguration() + .get('salesforcedx-vscode-apex.apexoas.aa.method.annotations', []); + return [...new Set([...APEX_ACTION_METHOD_ANNOTATION, ...userDefinedModifiers])]; }; export const retrieveGeneralClassAccessModifiers = (): string[] =>