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

Fail to parses SOSL with WITH USER_MODE or WITH SYSTEM_MODE #53

Closed
nwcm opened this issue Apr 10, 2024 · 0 comments · Fixed by #54
Closed

Fail to parses SOSL with WITH USER_MODE or WITH SYSTEM_MODE #53

nwcm opened this issue Apr 10, 2024 · 0 comments · Fixed by #54

Comments

@nwcm
Copy link

nwcm commented Apr 10, 2024

Expected Behavior

Correctly parse SOSL using USER_MODE

It does seem Salesforce SOSL documentation doesn't list this... https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_sosl_syntax.htm

Actual Behavior

Warning: PMD failed to evaluate against file 'C:\Users\xx\repos\xx\force-app\main\default\classes\class.cls'. Message: ParseException: Parse exception: com.google.summit.SummitAST$ParseException: Failed to parse C:\Users\xx\repos\xx\force-app\main\default\classes\xx.cls: Syntax error at 29:13: no viable alternative at input 'WITH USER_MODE'
Syntax error at 30:6: extraneous input ']' expecting ';'

Steps to Reproduce the Problem

  1. Attempt to parse the below class
public inherited sharing class soqlExample {

  public static String example(){
    String SecondarySearchList = 'test';

    List<List<SObject>> accountList = [
      FIND :SecondarySearchList
      IN NAME FIELDS
      RETURNING Account(Id, Account.Name WHERE ID = '' LIMIT 100)
      WITH USER_MODE
    ];
  }

}

Specifications

  • Version: 2.2.0
  • Platform: Linux / Windows -- Salesforce Code Analyser -> PMD -> Summit AST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant