Skip to content

FUTURE: Combine checkNamesForContextStrategyByTokenOrParentSet and checkNamesForContextStrategyByTokenOrAncestorSet properties #337

Open
@baratali

Description

@baratali

checkNamesForContextStrategyByTokenOrParentSet and checkNamesForContextStrategyByTokenOrAncestorSet do similar thing - they say patch-filter to change AST node to an upper level node for a certain Check, while detecting changed lines in a file.

The second property, checkNamesForContextStrategyByTokenOrAncestorSet, should accept a mapping between a check and AST token type. But instead it uses a hardcoded mapping for certain checks in JavaPatchFilterElement class for now.

Investigate how we can combine these two properties into one and be able to set a mapping between a check and AST ancestor token type.
I think it can work this way - if check is defined with no AST token type, then we just take its parent node; if check is defined with AST token type, then we try to find the first ancestor node with this token type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions