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
Parser options for now are just implemented for decoration. There's no API for PMD to configure them, and they can only be used if you use the parser directly.
It will likely be never supported to have a rule choose special parser options. This is because, if several rules need different sets of options, we'd have to parse files several time.
There would also be several ways to parse trees, meaning it's harder to get a hand on the API and start writing rules.
Nontrivial ParserOptions are implemented in the following modules only:
"Specifies whether XML parser will attempt to lookup the DTD.", Boolean.FALSE, 10.0f);
The ASTs PMD produces should be "low-level" enough that code style issues can be detected. Coalescing CDATA nodes, or expanding entity references, defeats this purpose.
PMD should probably not be attempting to validate schemas in the parser. If anything schema validation should maybe be a rule.
Namespace awareness is kind of like symbol resolution in other languages and should be kept enabled by default
I think parser options can go away completely, and language properties (#2518) may be used to replace its only functionality (the comment marker). This would also allow suppress markers to be set per-language, as a happy consequence.
On master we need to
Deprecate ParserOptions and its language-specific subclasses (Apex, Ecmascript, XML)
It's still ok to use ParserOptions on master (though not the language-specific subclasses), because LanguageVersionHandler::getParser takes a ParserOptions parameter for the suppress marker. In 7.0 we should however introduce an overload that takes no parameter.
Parser options for now are just implemented for decoration. There's no API for PMD to configure them, and they can only be used if you use the parser directly.
pmd/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/EcmascriptParserOptions.java
Lines 60 to 68 in 11c2b20
pmd/pmd-xml/src/main/java/net/sourceforge/pmd/lang/xml/XmlParserOptions.java
Lines 23 to 43 in 11c2b20
I think parser options can go away completely, and language properties (#2518) may be used to replace its only functionality (the comment marker). This would also allow suppress markers to be set per-language, as a happy consequence.
On master we need to
Both done with [core] Deprecate parser options #2675
It's still ok to use ParserOptions on master (though not the language-specific subclasses), because LanguageVersionHandler::getParser takes a ParserOptions parameter for the suppress marker. In 7.0 we should however introduce an overload that takes no parameter.