You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can throw when the diagnostic message has format parameters '{0}', '{1}' etc. This is fine, but maybe the FormatException should be caught and rethrown in a way that's going to make sense/be
more easily actionable to users of the library.
Here's the exception you get:
System.FormatException
HResult=0x80131537
Message=Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
Source=System.Private.CoreLib
StackTrace:
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args) in E:\A\_work\2188\s\src\mscorlib\shared\System\Text\StringBuilder.cs:line 1743
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args) in E:\A\_work\2188\s\src\mscorlib\src\System\String.Manipulation.cs:line 513
at System.String.Format(String format, Object[] args) in E:\A\_work\2188\s\src\mscorlib\src\System\String.Manipulation.cs:line 473
at Microsoft.CodeAnalysis.Testing.DiagnosticResult.get_Message() in /_/src/Tools/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs:line 61
Instead of giving a message like this:
"Index (zero based) must be greater than or equal to zero and less than the size of the argument list"
Let's say something like:
$"{diagnosticResult.ToString()} didn't contain enough arguments for all the format variables in the diagnostic message {diagnosticResult.MessageFormat}."
The text was updated successfully, but these errors were encountered:
roslyn-sdk/src/Microsoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticResult.cs
Line 63 in 8d0b316
This can throw when the diagnostic message has format parameters
'{0}', '{1}'
etc. This is fine, but maybe the FormatException should be caught and rethrown in a way that's going to make sense/bemore easily actionable to users of the library.
Here's the exception you get:
Instead of giving a message like this:
Let's say something like:
The text was updated successfully, but these errors were encountered: