Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUTURE: Combine checkNamesForContextStrategyByTokenOrParentSet and checkNamesForContextStrategyByTokenOrAncestorSet properties #337

Open
baratali opened this issue Aug 31, 2020 · 0 comments

Comments

@baratali
Copy link
Contributor

baratali commented Aug 31, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant