forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
953 stars 406 forks source link

Switch statements do not support dashes in the conditions #5031

Open axmav opened 1 year ago

axmav commented 1 year ago

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:

  1. Write apex class with this statements
  2. 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

Screenshot 2023-08-15 at 13 54 43

Salesforce Extension Version in VS Code: Apex v58.9.1

SFDX CLI Version:

OS and version: MacOS

daphne-sfdc commented 1 year ago

Hi @axmav, Thank you for your feedback. We will let you know if we provide a fix for this issue.

git2gus[bot] commented 2 months ago

This issue has been linked to a new work item: W-16795524