File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
src/Cli/dotnet/Commands/Run Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -982,8 +982,23 @@ private Package() { }
982
982
983
983
internal sealed class SimpleDiagnostic
984
984
{
985
- public required FileLinePositionSpan Location { get ; init ; }
985
+ public required Position Location { get ; init ; }
986
986
public required string Message { get ; init ; }
987
+
988
+ /// <summary>
989
+ /// An adapter of <see cref="FileLinePositionSpan"/> that ensures we JSON-serialize only the necessary fields.
990
+ /// </summary>
991
+ public readonly struct Position
992
+ {
993
+ public string Path { get ; init ; }
994
+ public LinePositionSpan Span { get ; init ; }
995
+
996
+ public static implicit operator Position ( FileLinePositionSpan fileLinePositionSpan ) => new ( )
997
+ {
998
+ Path = fileLinePositionSpan . Path ,
999
+ Span = fileLinePositionSpan . Span ,
1000
+ } ;
1001
+ }
987
1002
}
988
1003
989
1004
internal sealed class RunFileBuildCacheEntry
You can’t perform that action at this time.
0 commit comments