Skip to content

[core] Merge CPD and PMD language #3919

@oowekyala

Description

@oowekyala

Is your feature request related to a problem? Please describe.
CPD and PMD both publish a Language interface which is redundant. Using a single interface would allow sharing more infrastructure between the two programs, eg TextDocument logic (#3784).

Describe the solution you'd like
Initially described in #3782:

Another key concern of mine is to merge PMD's language and CPD's language. That is, all languages, regardless of whether cpd.Language or pmd.Language should be registered the same way. In PMD 6 we sort of have that: CPD-only languages are registered also as PMD languages but are useless. They caused problems as they needed to be filtered out manually in some places.

In PMD 7 I think we can do better than that. LanguageRegistry could be made non-static and contain a list of languages. Then you can have a LanguageRegistry instance that contains all languages that support PMD, and another that contains the CPD languages.

This needs #3918: we could have a LanguageRegistry for languages that support PMD, and another for languages that only support CPD.

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rulesin:cpdAffects the copy-paste detector

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions