salesforcedx-vscode
salesforcedx-vscode copied to clipboard
Syntax highlight on Code Initializer is incorrect
Summary
The code inside of an initializer (more info at "Using Initialization Code") does not match method code blocks.
Steps To Reproduce:
- Create a class like this:
public with sharing class TestDataBuilder {
public class NoneDAGException extends Exception {
// Initializer
{
this.setMessage('Object graph should be a Directed Acyclic Graph.');
}
// Sample method for comparison
public void anotherMethod() {
this.setMessage('Object graph should be a Directed Acyclic Graph.');
}
}
}
- Save the cls file.
Expected result
The same result of anotherMethod
.
Actual result
The string
inside this.setMessage
is not highlighted as the other code.
Additional information
Interestingly enough that changing it to auto-detect on a new file (it detects Anonymous Apex), does highlight correctly:
However, picking Anonymous Apex provides the incorrect highlight again.
Salesforce Extension Version in VS Code:
SFDX CLI Version: @salesforce/cli/2.0.0-beta.51 darwin-arm64 node-v18.15.0 (Salesforce CLI Beta v2 - https://github.com/forcedotcom/cli/issues/2132).
OS and version: macOS Ventura 13.4 (22F66)