-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.Text.JSon Source Generator Diagnostic in the error list doesnt link me to docs or navigate me to the file where the issue is #60314
Comments
Tagging subscribers to this area: @dotnet/area-system-text-json Issue DetailsDescriptionI 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 StepsI am on Version 17.0.0 Preview 5.0 [31807.358.d17.0] I am using the following code:
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 behaviorI am using the following code:
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 behaviorI am using the following code:
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. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
I've noticed this as well. Not certain why but I suspect it's because we're hardcoding all diagnostics to @layomia @ericstj should we consider addressing this for 6.0? |
I believe these diagnostics did go through API review, but perhaps there is a gap here in the process. cc @terrajobst as well.
It's a good bug to fix, but it's not blocking. My inclination would be to fix in 7.0, but I don't have a great feel for what the tooling bug bar is around this sort of thing. @mikadumont @mavasani @sharwell what we do if this bug were present in an roslyn-analyzers? Would you take a fix in ask-mode or just fix in the next release?
We should be able to fix this. @layomia do we have the right documentation for our added diagnostics? |
For now I'll consider this a 7.0 issue (early fix) - I'll create PRs providing the right location for the diagnostics we emit, and also prioritize providing corresponding documentation. |
I don't think this meets the bar for GA Ask Mode, but we've utilized servicing releases to improve the experience of analyzers shipped through roslyn-analyzers. Generally speaking, changing the diagnostic location of a warning is considered a breaking change though, as existing I would recommend a holistic review of the diagnostics that can be generated from the Json source generator feature, illustrating the IDs, locations, messages, severity levels, and URLs that are rendered. From that, changes could be made into 7.0 and considered for backporting into 6.0.x. |
Agreed. However, I think we can be judicial for the most part. In practice, if we just change the location within a statement it's not likely to affect pragmas as pragmas need to be on their own line and surrounding parts of a statement/expression would render the code fairly unreadable. It can still break some people, but given the probably is low enough I think we could say that this is acceptable after SDK updates. |
Is there a separate issue for actually implementing the ability in the System.Text.Json source generator to deserialize a type which defines init-only properties? As far as I can tell, this limitation makes it impossible to use the source generator with an API that returns record types (either directly or as a nested property), which pretty much makes it completely unusable for my use case (since I am making heavy use of records). I suspect this issue will also render the source generator dead in the water for most other people who are making use of other recent C# features. However, I would be very keen to watch out for developments in this area, as I'm conscious it's still early days for the implementation. I'd be grateful if someone could confirm the position and/or link the related issue if there is one. |
@eiriktsarpalis - Many thanks! |
@terrajobst received customer feedback on this as well. Copying here:
|
Additional customer feedback copying here:
|
Yeah, we need to fix this. This seems like a major speed bump. |
@terrajobst you mean it should be serviced for 6? |
I'd think it would make the bar for SDK servicing, yes. |
Currently working on putting these artifacts together for review (mostly code changes to return the correct locations). |
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:
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:
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:
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.
The text was updated successfully, but these errors were encountered: