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
Issue #11166: remove getFileContents from EmptyLineSeparator #14819
base: master
Are you sure you want to change the base?
Conversation
dealing with comment tokens in the AST was weird to me. why it is under modifiers of the next subtree. is there a reason to build AST like this? int x;
// m
public int m() {
return 0;
}
@romani @nrmancuso @rnveach |
private DetailAST findFirstCommentToken(DetailAST ast) { | ||
final DetailAST modifersAst = ast.findFirstToken(TokenTypes.MODIFIERS); | ||
final DetailAST commentAst; | ||
|
||
if (modifersAst != null) { | ||
commentAst = modifersAst.getFirstChild(); | ||
} | ||
else { | ||
commentAst = ast.getFirstChild(); | ||
} | ||
return commentAst; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will work more on this method. I believe that there are more cases that need to be handled to get the first comment token
Github, generate report |
Issue #11166 :
refactor EmptyLineSeparatorCheck to use AST-based logic not
getFileContents()
Diff Regression config: https://gist.githubusercontent.com/mahfouz72/afd57aa6e51ca161b7927acd959e5211/raw/9384f843297bb2e10c074bcb33ddc46902d6bd52/check.xml
WIP. just wants to get an initial review from CIs and maintainers