-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
I am using the System.Text.JSon Source Generator and am getting the following warning in my error list:
This analyzer doesn't follow the analyzer guidelines for it doesnt navigate me to the file where the issue is or link me to docs to understand the issue better. Also should the severity be a warning or a suggestion? Anything that will be a warning or error should go through an analyzer review but let me know your thoughts. @jeffhandley @layomia
Reproduction Steps
I am on Version 17.0.0 Preview 5.0 [31807.358.d17.0]
I am using the following code:
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SolarSystem;
internal record Astronomer(string FirstName, string LastName, string? MiddleName = null);
[JsonSerializable(typeof(Astronomer))]
internal partial class AstronomerJsonContext : JsonSerializerContext
{
}
class Program
{
static void Main(string[] args)
{
var astronomer = new Astronomer(FirstName: "Jane", LastName: "Doe");
string json = JsonSerializer.Serialize(astronomer, AstronomerJsonContext.Default.Astronomer);
}
}
And I get the following warning in my error list but clicking on the warning doesnt navigate me to where the warning is coming from. Also the analyzer ID link doenst link me to docs.
Expected behavior
I am using the following code:
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SolarSystem;
internal record Astronomer(string FirstName, string LastName, string? MiddleName = null);
[JsonSerializable(typeof(Astronomer))]
internal partial class AstronomerJsonContext : JsonSerializerContext
{
}
class Program
{
static void Main(string[] args)
{
var astronomer = new Astronomer(FirstName: "Jane", LastName: "Doe");
string json = JsonSerializer.Serialize(astronomer, AstronomerJsonContext.Default.Astronomer);
}
}
And I get the following warning in my error list but clicking on the warning doesnt navigate me to where the warning is coming from. Also the analyzer ID link doenst link me to docs.
I would expect clicking on the warning in the error list will navigate me to where the warning is and the clicking on the ID link will take me to docs to understand what the warning is.
Actual behavior
I am using the following code:
using System.Text.Json;
using System.Text.Json.Serialization;
namespace SolarSystem;
internal record Astronomer(string FirstName, string LastName, string? MiddleName = null);
[JsonSerializable(typeof(Astronomer))]
internal partial class AstronomerJsonContext : JsonSerializerContext
{
}
class Program
{
static void Main(string[] args)
{
var astronomer = new Astronomer(FirstName: "Jane", LastName: "Doe");
string json = JsonSerializer.Serialize(astronomer, AstronomerJsonContext.Default.Astronomer);
}
}
And I get the following warning in my error list but clicking on the warning doesnt navigate me to where the warning is coming from. Also the analyzer ID link doenst link me to docs.
