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

Add indentation handling method in Java ApiView tool #8113

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

alzimmermsft
Copy link
Member

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.

@alzimmermsft alzimmermsft requested a review from a team as a code owner April 17, 2024 16:55
Comment on lines 387 to 399
// 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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@JonathanGiles JonathanGiles Apr 17, 2024

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.

@alzimmermsft alzimmermsft merged commit e7fb87c into Azure:main Apr 17, 2024
5 checks passed
@alzimmermsft alzimmermsft deleted the JavaApiViewCleanupIndentations branch April 17, 2024 19:11
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

Successfully merging this pull request may close these issues.

3 participants