Skip to content

Commit

Permalink
Fix shortened FunctionBody and comment formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zyebytevt committed Dec 29, 2023
1 parent 63556f0 commit d8fcb11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dparse/formatter.d
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,7 @@ class Formatter(Sink)
if (member.comment.length)
{
space();
put(member.comment);
putComment(member.comment);

Check warning on line 1181 in src/dparse/formatter.d

View check run for this annotation

Codecov / codecov/patch

src/dparse/formatter.d#L1181

Added line #L1181 was not covered by tests
}
}
endBlock();
Expand Down Expand Up @@ -1497,6 +1497,7 @@ class Formatter(Sink)
with(functionBody)
{
if (specifiedFunctionBody) format(specifiedFunctionBody);
if (shortenedFunctionBody) format(shortenedFunctionBody);
if (missingFunctionBody) format(missingFunctionBody);
}
}
Expand Down Expand Up @@ -4000,7 +4001,7 @@ protected:
{
import std.string : splitLines;
if (!c.length) return;
put(c.splitLines().join("\n" ~ getIndent()));
put(c.splitLines().map!((x) => "/// " ~ x).join("\n" ~ getIndent()));

Check warning on line 4004 in src/dparse/formatter.d

View check run for this annotation

Codecov / codecov/patch

src/dparse/formatter.d#L4004

Added line #L4004 was not covered by tests
newlineIndent();
}

Expand Down

0 comments on commit d8fcb11

Please sign in to comment.