Skip to content

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
@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