-
Notifications
You must be signed in to change notification settings - Fork 802
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
Missing syntax diagnostics in VS #15972
Comments
A current F# extension in VS 17.8 preview 1 works correctly, so it looks like some change in VS or Roslyn caused this issue. @CyrusNajmabadi can you have a look please? It seems like results from |
@mavasani Did you get a chance to have a look at this? |
@0101 thanks for the reminder. Let me look tomorrow. |
@0101 I am unable to repro this on the latest dogfood build |
@mavasani that is most likely the workaround #15982 When I disable the workaround I can still reproduce the issue in VS Main With the workaround, the diagnostics that should be coming from IFSharpDocumentDiagnosticAnalyzer.AnalyzeSyntaxAsync When it's fixed the syntax diagnostics will mostly likely be doubled in the error list. I can make an F# VSIX with the workaround removed if it would help you. |
Thanks @0101 - I was just skimming over your analyzer code and noticed you have below: https://github.com/dotnet/roslyn/blob/1421a4a8e7c48f4d7fda5e053ab95ffb9f4f35f5/src/Tools/ExternalAccess/FSharp/Internal/Diagnostics/FSharpDocumentDiagnosticAnalyzer.cs#L95-L98 public DiagnosticAnalyzerCategory GetAnalyzerCategory()
{
return DiagnosticAnalyzerCategory.SemanticDocumentAnalysis;
} The above category indicates the analyzer only supports semantic diagnostics, and the fact that it worked before might indicate some underlying bug that got fixed. You can read up the doc comments on each of the flags here: https://github.com/dotnet/roslyn/blob/main/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Diagnostics/DiagnosticAnalyzerCategory.cs Are you able to locally make the below Roslyn change + remove the F# workaround and see if things work for you as expected with both these VSIXes installed? If not, I can investigate further. public DiagnosticAnalyzerCategory GetAnalyzerCategory()
{
return DiagnosticAnalyzerCategory.SyntaxTreeWithoutSemanticsAnalysis | DiagnosticAnalyzerCategory.SemanticDocumentAnalysis;
} |
I can try. But when debugging it, I saw that AnalyzeSyntaxAsync was still being called, just the results that we provided weren't shown. If it was looking at capabilities then I'd expect it not to be called at all. |
Indeed, that seems like another bug, filed #16008 to track fixing that on Roslyn side. |
So I made the change in
|
Alright, let me investigate |
@0101 I am still unable to reproduce this issue on
I tried the above scenarios with both the below entire solution analysis checkbox being checked and unchecked and see the same behavior: @0101 I am not sure how to proceed here, as everything seems to work fine for me on the above build without the F# workaround |
Ok I'll try to get that exact version and see what I see. Though I doubt it was fixed and then broken again by |
Hmm, when I installed INT preview I got Can you maybe try to update? But still there is probably something external that made it work for you but not for us. |
@0101 I upgraded to the latest build, no local changes or VSIXes and still can't reproduce the issue. I see duplicate syntax errors:
I believe this is the case. I also tried toggling the entire solution analysis checkbox, but that made no difference. |
…lDiagnosticHandler Fixes dotnet/fsharp#15972
Fixed with dotnet/roslyn#70068 |
Fixed with the roslyn fix above. |
Should we revert #15982 now? |
IMO yes. |
Probably. No rush though since p1 is m2 already. |
Does this still need to happen? |
I guess it's not urgent, but probably need to revert it and test it. Might look at it once in the office. Let me make issue out of it. |
Repro steps
Create new Console App project with the following code:
Expected behavior
We see errors in Error List in VS when we open the file.
Actual behavior
No errors shown when we open the file. But the errors do appear if the file is closed and project is built.
bugerrorpane.mp4
Related information
Appeared somewhere between 17.8 preview 1 and preview 3
The text was updated successfully, but these errors were encountered: