Is your feature request related to a problem? Please describe.
Most language modules support only one language version. Among those, some declare a version with an empty name:
|
addVersion("", new ModelicaHandler(), true); |
Others declare a version with a name
|
addVersion(String.valueOf((int) Version.CURRENT.getExternal()), new ApexHandler(), true); |
I don't think it's useful to name the version when there is a single one. OTOH having an empty name prevents depending on it by accident. The names are unstable, for instance for Apex, the name comes from Jorje. Also, it's not a breaking change to introduce named versions later, when they're needed.
With #3919, all CPD languages need to be fitted to the PMD language interface. CPD has no concept of language version, so all these languages would have a single version. I think recognizing the "unnamed" language version as an idiom for languages which have only one language version would be useful in this case.
Describe the solution you'd like
- Rename the versions used by all language modules that have a single version to the empty string
- Adopt the convention that languages with a single version use an empty string as the name. Maybe add some convenience API in BaseLanguageModule. Add some checks there at least.
Describe alternatives you've considered
Require that all versions have actual names? There is no use for it and the names may change with a library update...
Additional context
Add any other context about the feature request here.
Is your feature request related to a problem? Please describe.
Most language modules support only one language version. Among those, some declare a version with an empty name:
pmd/pmd-modelica/src/main/java/net/sourceforge/pmd/lang/modelica/ModelicaLanguageModule.java
Line 15 in a42913f
Others declare a version with a name
pmd/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ApexLanguageModule.java
Line 22 in a42913f
I don't think it's useful to name the version when there is a single one. OTOH having an empty name prevents depending on it by accident. The names are unstable, for instance for Apex, the name comes from Jorje. Also, it's not a breaking change to introduce named versions later, when they're needed.
With #3919, all CPD languages need to be fitted to the PMD language interface. CPD has no concept of language version, so all these languages would have a single version. I think recognizing the "unnamed" language version as an idiom for languages which have only one language version would be useful in this case.
Describe the solution you'd like
Describe alternatives you've considered
Require that all versions have actual names? There is no use for it and the names may change with a library update...
Additional context
Add any other context about the feature request here.