-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent error message during APEX compilation, for missing semicolon, between deploy and run Anonymous Apex #5344
Comments
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support. |
The CLI is just calling the apex-node library, so I'm going to transfer this issue to that repo. However, I suspect it's a difference in the server API being called and completely dependent on whatever that service returns. |
Going to transfer this to the salesforcedx-vscode repo. Seems to be related to the Apex language server. |
@PawelWozniak We will see what details I can find around these inconsistencies. |
This issue has been linked to a new work item: W-14853102 |
@ChuckJonas, do you still see the following behavior? We had a regression in our older extension version where errors were not reported for some commands but we fixed it in the following release. Can you please let us know if you are still seeing this issue? Thank you!
|
Summary
For the same code run as Anonymous Apex or deployed on class save to org, there are different error messages. This one from Anonymous run is misleading.
Steps To Reproduce
Having this apex code:
sf apex run --file xTemp.apex
Expected result
In both cases I expect to get the error: "Unexpected token 'insert'." as the semicolon is missing before insert (in the line above).
Actual result
When code is run in Anonymous Apex I get the error: "Unexpected token 'private'." which refers to the whole block of the code. Then I am confused about what is wrong with this block. Need to do a deeper search.
System Information
Additional information
Side note for error message improvement. It would be useful actually to get an error "Missing semicolon at the end of the line 119". I think it is extremely uncommon in those days to have many statements in one line. Then it is safe to assume that when we have a line break and the line is not ended with a semicolon it is this syntax error.
The text was updated successfully, but these errors were encountered: