Syntax Highlighting - webService in Inner Class

Issue #201 resolved
Tyler Mowbrey created an issue

I have a global class with many webService methods. I also have an inner class with webService variables (so callers can use a wrapper class to submit to my services). The inner class webService keywords are incorrectly highlighted as errors (no problems when compiling though).

Example:

global class AnAwesomeService
{
    global class Submission
    {
         webService String answer1;
         webService String answer2;
    }

    webService static ReturnResult createSubmission(List<Submission> submissions)
    {
         // DO WORK
    }
}

In this example, answer1 and answer2 have webService highlighted with the error "FINAL, GLOBAL, PRIVATE, PROTECTED, PUBLIC, STATIC, or TRANSIENTexpected, got 'webService'" even though this is valid sytax. the createSubmission method with the webService keyword does not have an error.

Here is the Salesforce guide outlining that webService member variables should not be marked as static: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_web_services_methods_considerations.htm

Let me know if you need anything further.

Comments (3)

  1. Scott Wells repo owner

    Tyler, thanks for the example code. The issue is that my Apex parser doesn't currently recognize webService as a field modifier, though the link you provided says clearly that it should. This is very easy to address, so look for it in the next release or two.

  2. Log in to comment