• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MeltyPlayer / MeltyTool / 21090212907

17 Jan 2026 06:47AM UTC coverage: 41.207% (+0.02%) from 41.187%
21090212907

push

github

MeltyPlayer
Added support for appending formattable strings directly to shader source string builders, preventing a lot of needless GC pressure.

6767 of 18495 branches covered (36.59%)

Branch coverage included in aggregate %.

21 of 27 new or added lines in 2 files covered. (77.78%)

28708 of 67594 relevant lines covered (42.47%)

64034.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/FinModelUtility/Fin/Fin/src/util/strings/IndentedInterpolatedStringHandler.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Runtime.CompilerServices;
4

5
namespace fin.util.strings;
6

7
/// <summary>
8
///   Shamelessly stolen from:
9
///   https://github.com/pstlnce/indent-writer/blob/1d4743bab04b1f547f06c4625b58448c2ae46b93/IndentWriter/IndentedInterpolatedStringHandler.cs
10
/// </summary>
11
[InterpolatedStringHandler]
12
public readonly struct IndentedInterpolatedStringHandler {
13
  private readonly IndentedStringBuilder sb_;
14

15
  public IndentedInterpolatedStringHandler(int literalLength,
16
                                           int formattedCount,
17
                                           IndentedStringBuilder sb)
18
    => this.sb_ = sb;
28,896✔
19

20
  public void AppendLiteral(ReadOnlySpan<char> literal)
21
    => this.sb_.Append(literal);
62,243✔
22

23
  public void AppendFormatted<T>(T value) {
50,261✔
24
    // It has already added data to targeted StringBuilder
25
    // just used for visualization
26
    if (typeof(IndentedInterpolatedStringHandler) == typeof(T)) {
50,261!
NEW
27
      return;
×
28
    }
29

30
    if (value is string str) {
79,577✔
31
      this.sb_.Append(str);
29,316✔
32
      return;
29,316✔
33
    }
34

35
    if (value is not IEnumerable<string> strings) {
41,890!
36
      if (value is not null) {
41,890✔
37
        this.sb_.Append(value.ToString()!);
20,945✔
38
      }
20,945✔
39

40
      return;
20,945✔
41
    }
42

NEW
43
    foreach (var item in strings) {
×
NEW
44
      this.sb_.Append(item);
×
NEW
45
    }
×
46
  }
50,261✔
47

48
  public void AppendFormatted<T>(T value, string format)
49
      where T : IFormattable {
3,865✔
50
    this.sb_.Append(value.ToString(format, null));
3,865✔
51
  }
3,865✔
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc