-
Notifications
You must be signed in to change notification settings - Fork 183
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
Add indentation handling method in Java ApiView tool #8113
Add indentation handling method in Java ApiView tool #8113
Conversation
...ava-processor/src/main/java/com/azure/tools/apiview/processor/analysers/JavaASTAnalyser.java
Outdated
Show resolved
Hide resolved
// allowed dependencies (in maven-enforcer) | ||
// if (!mavenPom.getAllowedDependencies().isEmpty()) { | ||
// addToken(INDENT, new Token(KEYWORD, "allowed-dependencies"), SPACE); | ||
// addToken(new Token(PUNCTUATION, "{"), NEWLINE); | ||
// indent(); | ||
// mavenPom.getAllowedDependencies().stream().forEach(value -> { | ||
// addToken(INDENT, new Token(TEXT, value, value), NEWLINE); | ||
// }); | ||
// unindent(); | ||
// addToken(INDENT, new Token(PUNCTUATION, "}"), NEWLINE); | ||
// } | ||
|
||
// close maven |
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.
Do we need to retain this? Seems like this has been commented out from a long time.
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'm not really sure, this has been commented out for a while and I'm guessing this is something we just haven't implemented but want to? @JonathanGiles
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.
yeah, it might as well go for now.
Adds
indentedBlock
to handle indenting and unindenting a section of tokens rather than relying on the methods indent and unindent to be called before and after. Also changes indentation handling to be based on the indentation level in case we want to offer different indentation size (right now it's always 4 whitespaces). Lastly, added a cache for common indentation levels so they can be reused.