roslyn-sdk
roslyn-sdk copied to clipboard
Roslyn-SDK templates and Syntax Visualizer
XUnit. When a source generator runs into an uncaught exception and Roslyn excludes its output from compilation, a diagnostic is raised, but test results check generated outputs before diagnostics so...
XUnit. When the generated source code from a generator and the expected source code has the exact same structure and filenames but the contents are different, the test fails with...
Example test: https://github.com/dotnet/roslyn/blob/6acaa7b7c0efea8ea292ca26888c0346fbf8b0c1/src/EditorFeatures/CSharpTest/MakeLocalFunctionStatic/PassInCapturedVariablesAsArgumentsCodeFixProviderTests.cs#L355-L383 List of all supported annotations by the legacy test framework: https://github.com/dotnet/roslyn/blob/6acaa7b7c0efea8ea292ca26888c0346fbf8b0c1/src/EditorFeatures/DiagnosticsTestUtilities/CodeActions/AbstractCodeActionOrUserDiagnosticTest.cs#L620-L623 I expect some kind of markup for specifying these annotations in code action test. If these...

See https://github.com/dotnet/roslyn/issues/65304#issuecomment-1309882140 Both C# and VB samples need to be updated: https://github.com/dotnet/roslyn-sdk/blob/ba5f8a6bf7b477b44a43ea943d3e831d6301afb7/samples/CSharp/Analyzers/Analyzers.Implementation/StatefulAnalyzers/CompilationStartedAnalyzerWithCompilationWideAnalysis.cs#L37-L45 https://github.com/dotnet/roslyn-sdk/blob/ba5f8a6bf7b477b44a43ea943d3e831d6301afb7/samples/VisualBasic/Analyzers/Analyzers.Implementation/StatefulAnalyzers/CompilationStartedAnalyzerWithCompilationWideAnalysis.vb#L36
I think the analyzer should skip top-level type.
I have to create an analyzer for our solution, which relies on Visual Studio 2022. For this I tried to follow the steps in https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix and use the "Analyzer with...
There is no current way to alter the message produced by the Analyzer and Code Fix on failure. Analyzer and Code Fix testing from the templates has a fixed message...
Turns out if you implement both, the ISourceGenerator is not called and therefore using the methods from the ISourceGenerator interface cannot be used to produce diagnostics which can be rather...
Currently, project templates use 2.9.8 which is quite old. It should use either 3.3.3 (latest stable) or a 3.3.4 beta.