Code Completion in SWITCH statement doesn't work properly

Issue #2206 resolved
Olek Tymchenko created an issue

Hello,
I have a class with constants (public final string) and I would like to use these values in the SWITCH statement, but unfortunately, code-completion doesn’t work.
For example:

switch on expression {
  when Constants.CONSTANT_NAME {
    somefunction();
}

After I type Constants. nothing happens.

Comments (4)

  1. Scott Wells repo owner

    Is that a legitimate usage of the switch statement? When I try that and deploy, it fails as follows:

    Apologies if I’m missing something obvious here.

  2. Scott Wells repo owner

    Okay, thanks for confirming. I keep an eye on all enhancements delivered in each Salesforce seasonal release and update IC2 as appropriate for those enhancements. If/when that idea is delivered, I'll update IC2's parser, code completion, etc., to provide full first-class support for it. Thanks again!

  3. Log in to comment