Closed YairHalberstadt closed 2 years ago
I am also experiencing this issue while trying to create a Source Generator. The highlighted line in this source window corresponds to one of the errors listed below.
My branch is here, if that helps: https://github.com/ReubenBond/orleans/tree/feature/source-generator, and the source generator is here: https://github.com/ReubenBond/orleans/blob/feature/source-generator/src/Orleans.CodeGenerator/OrleansSourceGenerator.cs
Just to confirm and bump up - we experience this issue a lot (VS 2022) when trying to build a Blazor project after indirectly introducing some errors in razor files. By indirectly, I mean making some refactorings inside the model/service layer that are not properly reflected in the razor files (while the erroneous Blazor components remain closed in the editor).
It causes false positives scenario - the error list is empty while the build is failing for no obvious reason. The only fallback solution is to try building the project from CLI and look for the actual errors throughout the console output.
Significantly affects the quality of life, to be honest.
Just adding my own voice here as this is impacting warnings in Razor files (.cshtml and .razor) since the Razor compiler switched to using a source generator in .NET 6. Nullable warnings in Razor files do not show up in the VS Error List unless the file is open in the editor. I often don't see the warning until the CI build fails 😢
Agreed this is a pretty big quality of life issue for razor files. Not being able to trust the error list is disconcerting.
Version Used: visual studio 16.8.2 and 16.9 preview 1
Intellisense shows members created by the source generator, and you can navigate to the generated code. Building displays the diagnostics. However the diagnostics don't appear in the diagnostics tab when set to show "Intellisense only" diagnostics.
Steps to Reproduce:
Create a new project referencing StrongInject
Add a file:
Build, producing this diagnostic:
Navigate to the location of the error.
The diagnostic does not show up in diagnostics tab when set to show "Intellisense only" diagnostics. Neither do red squigglies appear.
Intellisense shows the generated members, e.g. when typing (
|
marks location of caret)public class Container : IContainer<int> { int x => _| }
it will display_disposed
in the completion list.You can navigate to the generated code, e.g. by clicking goto definition of
_disposed
inpublic class Container : IContainer<int> { int x => _disposed; }