diff --git a/package-lock.json b/package-lock.json index 72c0892925..81fb07f77d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32885,7 +32885,7 @@ "@salesforce/core-bundle": "8.6.1", "@salesforce/source-deploy-retrieve-bundle": "12.7.4", "@salesforce/source-tracking-bundle": "7.1.17", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "applicationinsights": "1.0.7", "cross-spawn": "7.0.6", "rxjs": "^5.4.1", @@ -33028,7 +33028,7 @@ "@salesforce/apex-tmlanguage": "1.8.0", "@salesforce/core-bundle": "8.6.1", "@salesforce/salesforcedx-utils-vscode": "62.8.0", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "expand-home-dir": "0.0.3", "find-java-home": "0.2.0", "shelljs": "0.8.5", @@ -33425,7 +33425,7 @@ "@salesforce/source-deploy-retrieve-bundle": "12.7.4", "@salesforce/templates": "62.0.1", "@salesforce/ts-types": "2.0.12", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "adm-zip": "0.5.10", "applicationinsights": "1.0.7", "glob": "^7.1.2", diff --git a/packages/salesforcedx-utils-vscode/package.json b/packages/salesforcedx-utils-vscode/package.json index 413e89b3d3..4ab484e582 100644 --- a/packages/salesforcedx-utils-vscode/package.json +++ b/packages/salesforcedx-utils-vscode/package.json @@ -13,7 +13,7 @@ "@salesforce/core-bundle": "8.6.1", "@salesforce/source-deploy-retrieve-bundle": "12.7.4", "@salesforce/source-tracking-bundle": "7.1.17", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "applicationinsights": "1.0.7", "cross-spawn": "7.0.6", "rxjs": "^5.4.1", diff --git a/packages/salesforcedx-vscode-apex/package.json b/packages/salesforcedx-vscode-apex/package.json index 247c7c84e3..c70b634be5 100644 --- a/packages/salesforcedx-vscode-apex/package.json +++ b/packages/salesforcedx-vscode-apex/package.json @@ -28,7 +28,7 @@ "@salesforce/apex-tmlanguage": "1.8.0", "@salesforce/core-bundle": "8.6.1", "@salesforce/salesforcedx-utils-vscode": "62.8.0", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "expand-home-dir": "0.0.3", "find-java-home": "0.2.0", "shelljs": "0.8.5", diff --git a/packages/salesforcedx-vscode-apex/src/languageServer.ts b/packages/salesforcedx-vscode-apex/src/languageServer.ts index 02bd7b7bb5..f5a9348dff 100644 --- a/packages/salesforcedx-vscode-apex/src/languageServer.ts +++ b/packages/salesforcedx-vscode-apex/src/languageServer.ts @@ -22,7 +22,9 @@ import { retrieveAAMethodAccessModifiers, retrieveAAPropDefModifiers, retrieveAAPropAccessModifiers, - retrieveAAAnnotations, + retrieveAAClassRestAnnotations, + retrieveAAMethodRestAnnotations, + retrieveAAMethodAnnotations, retrieveGeneralClassAccessModifiers, retrieveGeneralMethodAccessModifiers, retrieveGeneralPropAccessModifiers @@ -170,7 +172,9 @@ export const buildClientOptions = (): LanguageClientOptions => { apexActionMethodAccessModifiers: retrieveAAMethodAccessModifiers().join(','), apexActionPropDefModifiers: retrieveAAPropDefModifiers().join(','), apexActionPropAccessModifiers: retrieveAAPropAccessModifiers().join(','), - apexActionAnnotations: retrieveAAAnnotations().join(','), + apexActionClassRestAnnotations: retrieveAAClassRestAnnotations().join(','), + apexActionMethodRestAnnotations: retrieveAAMethodRestAnnotations().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..d87890fa7e 100644 --- a/packages/salesforcedx-vscode-apex/src/settings.ts +++ b/packages/salesforcedx-vscode-apex/src/settings.ts @@ -15,7 +15,9 @@ 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_REST_ANNOTATION = ['RestResource']; +const APEX_ACTION_METHOD_REST_ANNOTATION = ['HttpDelete', 'HttpGet', 'HttpPatch', 'HttpPost', 'HttpPut']; +const APEX_ACTION_METHOD_ANNOTATION = ['AuraEnabled']; // Default eligibility for general OAS generation. Users can changed the setting through VSCode configurations const DEFAULT_CLASS_ACCESS_MODIFIERS = ['global', 'public']; @@ -78,11 +80,20 @@ export const retrieveAAPropAccessModifiers = (): string[] => { return [...new Set([...APEX_ACTION_PROP_ACCESS_MODIFIERS, ...userDefinedModifiers])]; }; -export const retrieveAAAnnotations = (): string[] => { +export const retrieveAAMethodAnnotations = (): 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.method.annotations', []); + return [...new Set([...APEX_ACTION_METHOD_ANNOTATION, ...userDefinedModifiers])]; +}; + +// The REST-related annotations should not be edited by users +export const retrieveAAClassRestAnnotations = (): string[] => { + return [...new Set([...APEX_ACTION_CLASS_REST_ANNOTATION])]; +}; + +export const retrieveAAMethodRestAnnotations = (): string[] => { + return [...new Set([...APEX_ACTION_METHOD_REST_ANNOTATION])]; }; export const retrieveGeneralClassAccessModifiers = (): string[] => diff --git a/packages/salesforcedx-vscode-core/package.json b/packages/salesforcedx-vscode-core/package.json index ddf5b7ff6c..2ac3d3b6fa 100644 --- a/packages/salesforcedx-vscode-core/package.json +++ b/packages/salesforcedx-vscode-core/package.json @@ -32,7 +32,7 @@ "@salesforce/source-deploy-retrieve-bundle": "12.7.4", "@salesforce/templates": "62.0.1", "@salesforce/ts-types": "2.0.12", - "@salesforce/vscode-service-provider": "^1.3.0-rc.1", + "@salesforce/vscode-service-provider": "1.3.0-rc.3", "adm-zip": "0.5.10", "applicationinsights": "1.0.7", "glob": "^7.1.2",