-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Analyzers not being recognized in Dev17 Preview 6 #57293
Comments
…assets Fixes dotnet#57293 With recent changes to move OOP to .NET Core, we seem to require specifying analyzer dependencies as analyzer assets. dotnet@6c7f97b added MS.CA.Workspaces as an asset, this change extends it to add the C# and VB Workspaces assemblies as analyzer assets.
Fixed with #57294 |
Actually, I am going to re-activate this issue to track why we did not report any warning diagnostics for analyzer load failure in IDE, we should have ideally called this method to report diagnostics:
|
Investigated a bit about failure to report analyzer load diagnostics. This is not a regression, we have never had support to report analyzer load failure diagnostics in OOP. Analyzers are loaded/instantiated in both devenv.exe and OOP process, and we do have code to report load failure diagnostics if analyzer fails to load in devenv.exe. For all third party analyzers, any analyzer that fails to load, say due to missing dependency accessed in its ctor, it will fail in both devenv.exe and OOP and we will report those failures as diagnostics in devenv.exe. IDE CodeStyle analyzers are special in the sense that they are defined in Roslyn assemblies (Features with dependencies to Workspaces and Compiler), so the analyzer load is slightly different in both processes. Also, if any analyzer throws an exception during analyzer callbacks while executing in OOP, we do report these as AD0001 diagnostics in error list, we also have tests for it. In short, I don't think we need to any more work here. This is just a very special case where we don't report load failure diagnostics, and it doesn't affect any other analyzer packages. |
@mavasani I'm hitting this bug (or at least one with the same symptoms in preview 7 still, even with your change. This does not repro in p5. To repro, download \\mlangfs1\public\v-irjain\RealWorldSoln\MaterialSkin-master.zip , open the sln, open ColorScheme.cs and change Was found via https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1393716 |
I have tried to repro this in a bunch of ways, but unable to repro it:
I always get the red squiggle and lightbulb for NOTE: I installed Dev17.0 Preview7 from https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#17.0.0-pre.7.0 and tried, but still unable to repro. |
@jinujoseph @dibarbet @vatsalyaagrawal I have tried to repro this issue on Dev17.0 Preview7 build installed from https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview#17.0.0-pre.7.0 and can confirm that I can only repro it under liveshare session. Squiggles work fine in regular mode, seem to just be missing in liveshare mode. See the below gif confirming the same: |
@mavasani I just figured out the repro - it only happens when you re-open the solution with the file already open. When I open VS without the file already open, it does not reproduce. See the gif below. |
Closing this issue based on the offline discussion with @dibarbet |
Version Used:
Version 17.0.0 Preview 6.0 [31815.197.d17.0]
Steps to Reproduce:
Insert:
Expected Behavior:
Actual Behavior:
No diagnostic is shown.
The text was updated successfully, but these errors were encountered: