You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SOSL: WITH SPELL_CORRECTION clause missing from soslClauses — parse failure on valid Apex #145
Syntax error at L:C: no viable alternative at input 'WITH SPELL_CORRECTION'
Syntax error at L:C: extraneous input ']' expecting ';'
WITH SPELL_CORRECTION = { true | false } is a documented SOSL clause (see the SOSL reference, "WITH SPELL_CORRECTION"): it toggles spell-corrected search for the query and is accepted by the platform compiler.
Current soslClauses enumerates WITH DIVISION, WITH DATA CATEGORY, WITH SNIPPET, WITH NETWORK, WITH PRICEBOOKID, and WITH METADATA, but not SPELL_CORRECTION (and, from the same family, WITH HIGHLIGHT appears absent as well — I have only reproduced SPELL_CORRECTION).
Downstream impact: PMD 7.x's Apex module (via Summit AST, which builds on this grammar) reports the whole file as a processing error, so classes using this clause silently contribute zero findings to static analysis. Reproduced with PMD 7.25.0 and 7.26.0; two production classes in our org (3,900+ and 4,300+ lines) are entirely invisible to PMD because of a handful of these clauses. Prior art for the same class of gap: pmd/pmd#5055 (WITH USER_MODE / WITH SYSTEM_MODE in SOSL), pmd/pmd#5163 (toLabel in SOSL).
Happy to provide additional repro detail if useful.
Activity
feat: support SOSL WITH SPELL_CORRECTION and WITH HIGHLIGHT