You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. #6991 introduced ASTApexFile#getApiVersion(), which reads the corresponding -meta.xml file of the current Apex source file.
This information should be wired into PMD's mechanism to select which rules should be executed for each file by using the "minimumLanguageVersion" and "maximumLanguageVersion" rule attributes.
E.g. the new rule ApexUnitTestClassShouldHaveRunRelevantTestsAnnotation should only be run for Apex 66.0+.
Also note, that we don't differ here between API version and language (grammar) version. The parser will probably parse always the latest features.
Describe the solution you'd like
needs tests
needs to handle the absence of -meta.xml files gracefully
node.getRoot().getAstInfo().getTextDocument().getLanguageVersion() should be equal to ASTApexFile#getApiVersion()
Activity