salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Switch statements do not support dashes in the conditions
Summary
Switch statement is not highlighted properly in VSCode due to the dashes in the 'when' conditions. See example below.
switch on languageRFC {
when 'de-CH' {
language = 'German';
}
when 'fr-CH' {
language = 'French';
}
when else {
language = 'English';
}
}
Steps To Reproduce:
- Write apex class with this statements
- See red highlights on a correct statement.
Expected result
Not highlighted in red.
Actual result
Highlighted in red. VSCode think this is an error. Replacing dashes with underscores help.
Additional information
Salesforce Extension Version in VS Code: Apex v58.9.1
SFDX CLI Version:
OS and version: MacOS
Hi @axmav, Thank you for your feedback. We will let you know if we provide a fix for this issue.