Skip to content

Commit d52de5e

Browse files
committed
comments pjf specific
1 parent 5439660 commit d52de5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

palantir-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public Void visitLiteral(LiteralTree literalTree, Void aVoid) {
195195
}
196196

197197
private void indentTextBlocks(TreeRangeMap<Integer, String> replacements, List<TreePath> textBlocks) {
198-
// pjf specific - compute textBlock's parents & store info about the indentation\
198+
// pjf specific - compute textBlock's parents & store indentation info for each parent
199199
Map<TreePath, String> textBlockToIndent = computeCustomTextBlocksIndent(textBlocks);
200200

201201
for (TreePath treePath : textBlocks) {
@@ -217,6 +217,8 @@ private void indentTextBlocks(TreeRangeMap<Integer, String> replacements, List<T
217217
.stripIndent();
218218
ImmutableList<String> lines = stripped.lines().collect(ImmutableList.toImmutableList());
219219

220+
// pjf specific: try to indent the text block, unless the text block will be indented more than the
221+
// starting quotes
220222
String prefix = textBlockToIndent.getOrDefault(
221223
treePath,
222224
(lineStartPosition + startColumn + 4 > startPosition ? "" : " ".repeat(4))

0 commit comments

Comments
 (0)