Skip to content

Commit e22c65f

Browse files
Adding ToString() methods to [CorrectionExtent] and [DiagnosticRecord] (#1946)
* Adding DiagnosticRecord.ToString() (Fixes #1945) * Adding CorrectionExtent.ToString() (Fixes #1944) --------- Co-authored-by: James Brundage <@github.com>
1 parent 45edb8d commit e22c65f

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Engine/Generic/CorrectionExtent.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,13 @@ public CorrectionExtent(
104104
{
105105

106106
}
107+
108+
/// <summary>
109+
/// Outputs a CorrectionExtent as a string.
110+
/// </summary>
111+
/// <returns>Returns the text in a CorrectionExtent.</returns>
112+
public override string ToString() {
113+
return this.Text;
114+
}
107115
}
108116
}

Engine/Generic/DiagnosticRecord.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@ public DiagnosticRecord(
127127
RuleSuppressionID = ruleId;
128128
this.suggestedCorrections = suggestedCorrections;
129129
}
130+
131+
/// <summary>
132+
/// Outputs a DiagnosticRecord as a string.
133+
/// </summary>
134+
/// <returns>Returns the message in a DiagnosticRecord.</returns>
135+
public override string ToString() {
136+
return this.Message;
137+
}
130138
}
131139

132140

0 commit comments

Comments
 (0)