Skip to content

Commit

Permalink
Add WriteNoIndent and WriteLineNoIndent to CodeWriter.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball committed Jun 13, 2024
1 parent 346a441 commit ef401bb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>

<PropertyGroup>
<VersionPrefix>2.12.1</VersionPrefix>
<PackageValidationBaselineVersion>2.12.0</PackageValidationBaselineVersion>
<VersionPrefix>2.13.0</VersionPrefix>
<PackageValidationBaselineVersion>2.12.1</PackageValidationBaselineVersion>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 2.13.0

* Add `WriteNoIndent` and `WriteLineNoIndent` to `CodeWriter`.

## 2.12.1

* Add .NET 8 targets.
Expand Down
17 changes: 17 additions & 0 deletions src/Facility.Definition/CodeGen/CodeWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ public void Write(string text)
TextWriter.Write(text);
}

/// <summary>
/// Writes the specified text.
/// </summary>
public void WriteNoIndent(string text)
{
TextWriter.Write(text);
}

/// <summary>
/// Writes a new line.
/// </summary>
Expand All @@ -107,6 +115,15 @@ public void WriteLine(string text)
WriteLine();
}

/// <summary>
/// Writes the specified text followed by a new line.
/// </summary>
public void WriteLineNoIndent(string text)
{
WriteNoIndent(text);
WriteLine();
}

/// <summary>
/// Writes a new line if it has already been called once in this indent scope.
/// </summary>
Expand Down

0 comments on commit ef401bb

Please sign in to comment.