6 types derived from Diagnostic
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
18private sealed class SuppressionDiagnostic : Diagnostic
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
16private sealed class DiagnosticWithProgrammaticSuppression : Diagnostic
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
19internal sealed class SimpleDiagnostic : Diagnostic
Diagnostic\DiagnosticWithInfo.cs (1)
18internal class DiagnosticWithInfo : Diagnostic
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
76private sealed class CompilerDiagnostic : Diagnostic
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EvaluationContextBase.cs (1)
102protected sealed class SimpleMessageDiagnostic : Diagnostic
7367 references to Diagnostic
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (1)
200private static void WriteDiagnosticResults(ImmutableArray<Tuple<ProjectId, Diagnostic>> diagnostics, string fileName)
Program.cs (1)
151foreach (var diagnostic in compilation.GetDiagnostics(cancellationToken))
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.DetectInvalidModelNames.cs (1)
32context.ReportDiagnostic(Diagnostic.Create(Diagnostics.s_modelNameMustBeValid, token.GetLocation(), validationMessage));
BuildActionTelemetryTable (1)
src\Workspaces\Core\Portable\Shared\Extensions\TelemetryExtensions.cs (1)
53public static string GetTelemetryDiagnosticID(this Diagnostic diagnostic)
BuildValidator (6)
CompilationDiff.cs (6)
48private readonly ImmutableArray<Diagnostic> _diagnostics; 63public ImmutableArray<Diagnostic> Diagnostics 85ImmutableArray<Diagnostic> diagnostics = default, 145foreach (var diag in emitResult.Diagnostics) 225void writeDiagnostics(ImmutableArray<Diagnostic> diagnostics) 228foreach (var diagnostic in diagnostics)
ConfigurationSchemaGenerator (2)
RuntimeSource\SourceGenerators\DiagnosticInfo.cs (2)
37public Diagnostic CreateDiagnostic() 38=> Diagnostic.Create(Descriptor, Location, MessageArgs);
CSharpSyntaxGenerator (3)
SourceGenerator.cs (3)
60context.ReportDiagnostic(Diagnostic.Create(s_MissingSyntaxXml, location: null)); 67context.ReportDiagnostic(Diagnostic.Create(s_UnableToReadSyntaxXml, location: null)); 90Diagnostic.Create(
ILLink.CodeFixProvider (8)
BaseAttributeCodeFixProvider.cs (3)
36 var diagnostic = context.Diagnostics.First (); 55 Diagnostic diagnostic, 132 Diagnostic diagnostic);
DynamicallyAccessedMembersCodeFixProvider.cs (1)
96 var diagnostic = context.Diagnostics[0];
RequiresAssemblyFilesCodeFixProvider.cs (1)
35 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresDynamicCodeCodeFixProvider.cs (1)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
RequiresUnreferencedCodeCodeFixProvider.cs (1)
32 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic) =>
UnconditionalSuppressMessageCodeFixProvider.cs (1)
40 protected override SyntaxNode[] GetAttributeArguments (ISymbol? attributableSymbol, ISymbol targetSymbol, SyntaxGenerator syntaxGenerator, Diagnostic diagnostic)
ILLink.RoslynAnalyzer (39)
COMAnalyzer.cs (1)
54 operationContext.ReportDiagnostic (Diagnostic.Create (s_correctnessOfCOMCannotBeGuaranteed,
DynamicallyAccessedMembersAnalyzer.cs (10)
154 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnFieldCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 157 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnMethodReturnValueCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 159 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersIsNotAllowedOnMethods), location)); 162 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnMethodParameterCanOnlyApplyToTypesOrStrings), location, parameter.GetDisplayName (), member.GetDisplayName ())); 165 context.ReportDiagnostic (Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (DiagnosticId.DynamicallyAccessedMembersOnPropertyCanOnlyApplyToTypesOrStrings), location, member.GetDisplayName ())); 195 context.ReportDiagnostic (Diagnostic.Create ( 217 context.ReportDiagnostic (Diagnostic.Create ( 241 context.ReportDiagnostic (Diagnostic.Create ( 254 context.ReportDiagnostic (Diagnostic.Create ( 293 context.ReportDiagnostic (Diagnostic.Create (
DynamicallyAccessedMembersTypeHierarchy.cs (1)
15 public static void ApplyDynamicallyAccessedMembersToTypeHierarchy (Location typeLocation, INamedTypeSymbol type, Action<Diagnostic> reportDiagnostic)
RequiresAnalyzerBase.cs (3)
100 syntaxNodeAnalysisContext.ReportDiagnostic (Diagnostic.Create (RequiresDiagnosticRule, 235 symbolAnalysisContext.ReportDiagnostic (Diagnostic.Create ( 245 symbolAnalysisContext.ReportDiagnostic (Diagnostic.Create (
RequiresUnreferencedCodeAnalyzer.cs (2)
35 var diag = Diagnostic.Create (s_typeDerivesFromRucClassRule,
TrimAnalysis\DiagnosticContext.cs (6)
17 readonly Action<Diagnostic>? _reportDiagnostic; 19 public DiagnosticContext (Location location, Action<Diagnostic>? reportDiagnostic) 25 private Diagnostic CreateDiagnostic (DiagnosticId id, params string[] args) 27 return Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (id), Location, args); 46 private Diagnostic CreateDiagnostic (DiagnosticId id, ValueWithDynamicallyAccessedMembers actualValue, ValueWithDynamicallyAccessedMembers expectedAnnotationsValue, params string[] args) 81 return Diagnostic.Create (DiagnosticDescriptors.GetDiagnosticDescriptor (id), Location, sourceLocation, DAMArgument?.ToImmutableDictionary (), args);
TrimAnalysis\FeatureCheckReturnValuePattern.cs (1)
33 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\GenericArgumentDataFlow.cs (4)
15 public static void ProcessGenericArgumentDataFlow (Location location, INamedTypeSymbol type, Action<Diagnostic> reportDiagnostic) 23 public static void ProcessGenericArgumentDataFlow (Location location, IMethodSymbol method, Action<Diagnostic> reportDiagnostic) 30 public static void ProcessGenericArgumentDataFlow (Location location, IFieldSymbol field, Action<Diagnostic> reportDiagnostic) 39 Action<Diagnostic> reportDiagnostic)
TrimAnalysis\HandleCallAction.cs (1)
35 Action<Diagnostic>? reportDiagnostic)
TrimAnalysis\ReflectionAccessAnalyzer.cs (2)
17 readonly Action<Diagnostic>? _reportDiagnostic; 20 public ReflectionAccessAnalyzer (Action<Diagnostic>? reportDiagnostic, INamedTypeSymbol? typeHierarchyType)
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (1)
56 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (1)
47 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (1)
46 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (1)
72 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisPatternStore.cs (1)
106 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (1)
46 public void ReportDiagnostics (DataFlowAnalyzerContext context, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\TrimAnalysisVisitor.cs (1)
324 Action<Diagnostic>? reportDiagnostic,
TrimAnalysis\TrimDataFlowAnalysis.cs (1)
55 public void ReportDiagnostics (Action<Diagnostic> reportDiagnostic)
Microsoft.Analyzers.Extra (33)
AsyncCallInsideUsingBlockAnalyzer.cs (2)
122var diagnostic = 123Diagnostic.Create(DiagDescriptors.AsyncCallInsideUsingBlock, invocation.Syntax.GetLocation());
AsyncMethodWithoutCancellation.cs (2)
109var diagnostic = 110Diagnostic.Create(DiagDescriptors.AsyncMethodWithoutCancellation, analysisContext.Node.GetLocation());
CallAnalysis\Arrays.cs (2)
128var diagnostic = Diagnostic.Create(DiagDescriptors.Arrays, loc, valueType.ToDisplayString(), type.ToDisplayString());
CallAnalysis\LegacyCollection.cs (2)
33var diagnostic = Diagnostic.Create(DiagDescriptors.LegacyCollection, op.Syntax.GetLocation());
CallAnalysis\LegacyLogging.cs (2)
38var diagnostic = Diagnostic.Create(DiagDescriptors.LegacyLogging, op.Syntax.GetLocation());
CallAnalysis\Split.cs (2)
28var diagnostic = Diagnostic.Create(DiagDescriptors.Split, op.Syntax.GetLocation());
CallAnalysis\StartsEndsWith.cs (2)
59var diagnostic = Diagnostic.Create(DiagDescriptors.StartsEndsWith, op.Syntax.GetLocation(), op.TargetMethod.Name);
CallAnalysis\StaticTime.cs (4)
52var diagnostic = Diagnostic.Create(DiagDescriptors.StaticTime, op.Syntax.GetLocation()); 58var diagnostic = Diagnostic.Create(DiagDescriptors.StaticTime, op.Syntax.GetLocation());
CallAnalysis\ValueTuple.cs (4)
42var diagnostic = Diagnostic.Create(DiagDescriptors.ValueTuple, op.Syntax.GetLocation()); 48var diagnostic = Diagnostic.Create(DiagDescriptors.ValueTuple, op.Syntax.GetLocation());
CoalesceAnalyzer.cs (4)
52var diagnostic = Diagnostic.Create(DiagDescriptors.CoalesceAssignment, op.Syntax.GetLocation()); 79var diagnostic = Diagnostic.Create(DiagDescriptors.Coalesce, op.Syntax.GetLocation());
ConditionalAccessAnalyzer.cs (2)
111var diagnostic = Diagnostic.Create(DiagDescriptors.ConditionalAccess, op.Syntax.GetLocation());
MakeExeTypesInternalAnalyzer.cs (2)
134var diagnostic = Diagnostic.Create(DiagDescriptors.MakeExeTypesInternal, type.Locations[0], type.Name);
UsingToStringInLoggersAnalyzer.cs (3)
43foreach (var diagnostic in AnalyzeLogger(invocation)) 62private static IEnumerable<Diagnostic> AnalyzeLogger(IInvocationOperation invocation) 69yield return Diagnostic.Create(DiagDescriptors.UsingToStringInLoggers, arg.Syntax.GetLocation());
Microsoft.Analyzers.Extra.Tests (14)
Resources\RoslynTestUtils.cs (14)
137public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 153public static IList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 155var filtered = new List<Diagnostic>(); 156foreach (Diagnostic diagnostic in diagnostics) 174public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 203public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 234public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 265private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 343foreach (var d in diags) 522public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 527public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 533public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Microsoft.Analyzers.Local (19)
ApiLifecycle\ApiLifecycleAnalyzer.cs (11)
76context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.NewSymbolsMustBeMarkedExperimental, symbol.Locations.FirstOrDefault(), symbol)); 84context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeDeleted, null, type.ModifiersAndName)); 89context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeDeleted, null, method.Member)); 94context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeDeleted, null, prop.Member)); 99context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeDeleted, null, field.Member)); 113context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.ExperimentalSymbolsCantBeMarkedObsolete, symbol.Locations.FirstOrDefault(), symbol)); 120context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantBeMarkedExperimental, symbol.Locations.FirstOrDefault(), symbol)); 127context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantChange, symbol.Locations.FirstOrDefault(), symbol)); 135context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.PublishedSymbolsCantChange, symbol.Locations.FirstOrDefault(), symbol)); 156context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.NewSymbolsMustBeMarkedExperimental, type.Locations.FirstOrDefault(), type)); 160context.ReportDiagnostic(Diagnostic.Create(DiagDescriptors.ExperimentalSymbolsCantBeMarkedObsolete, type.Locations.FirstOrDefault(), type));
CallAnalysis\Throws.cs (4)
37var diagnostic = Diagnostic.Create( 51var diagnostic = Diagnostic.Create(
CallAnalysis\ToInvariantString.cs (2)
51var diagnostic = Diagnostic.Create(DiagDescriptors.ToInvariantString, op.Syntax.GetLocation());
InternalReferencedInPublicDocAnalyzer.cs (2)
154var diagnostic = Diagnostic.Create(DiagDescriptors.InternalReferencedInPublicDoc, crefNode.Cref.GetLocation(), referencedName);
Microsoft.Analyzers.Local.Tests (20)
ApiLifecycle\ApiLifecycleAnalyzerTest.cs (1)
74var actual = diagnostics[i];
InternalReferencedInPublicDocAnalyzerTests.cs (5)
454private static void AssertDetected(IReadOnlyList<Diagnostic> result, string source, int lineNumber, string detectedText) => 457private static void AssertDetected(IReadOnlyList<Diagnostic> result, string source, int[] lineNumbers, string[] detectedTexts) 476private static bool IsInternalReferencedInPublicDocDiagnostic(Diagnostic d) => ReferenceEquals(d.Descriptor, DiagDescriptors.InternalReferencedInPublicDoc); 478private static void AssertNotDetected(IReadOnlyList<Diagnostic> result) 484private static async Task<IReadOnlyList<Diagnostic>> Analyze(string source)
Resources\RoslynTestUtils.cs (14)
137public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 153public static IList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 155var filtered = new List<Diagnostic>(); 156foreach (Diagnostic diagnostic in diagnostics) 174public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 203public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 234public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 266private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 344foreach (var d in diags) 523public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 528public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 534public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Microsoft.AspNetCore.Analyzer.Testing (10)
CodeFixRunner.cs (1)
25Diagnostic analyzerDiagnostic,
DiagnosticAnalyzerRunner.cs (4)
31protected Task<Diagnostic[]> GetDiagnosticsAsync( 53protected async Task<Diagnostic[]> GetDiagnosticsAsync( 59var diagnostics = new List<Diagnostic>(); 88foreach (var diag in diags)
DiagnosticVerifier.cs (5)
58protected Task<Diagnostic[]> GetDiagnosticsAsync(string[] sources, DiagnosticAnalyzer analyzer, string[] additionalEnabledDiagnostics) 71protected async Task<Diagnostic[]> GetDiagnosticsAsync(Document[] documents, DiagnosticAnalyzer analyzer, string[] additionalEnabledDiagnostics) 79var diagnostics = new List<Diagnostic>(); 99foreach (var diag in diags) 111foreach (var diag in diags)
Microsoft.AspNetCore.Analyzers (4)
BuildServiceProviderAnalyzer.cs (1)
31context.ReportDiagnostic(Diagnostic.Create(
UseAuthorizationAnalyzer.cs (2)
49context.ReportDiagnostic(Diagnostic.Create( 69context.ReportDiagnostic(Diagnostic.Create(
UseMvcAnalyzer.cs (1)
43context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.App.Analyzers (23)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
230context.ReportDiagnostic(Diagnostic.Create(
Http\HeaderDictionaryAddAnalyzer.cs (1)
74context.ReportDiagnostic(Diagnostic.Create(
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
175context.ReportDiagnostic(Diagnostic.Create(
Http\RequestDelegateReturnTypeAnalyzer.cs (1)
78context.ReportDiagnostic(Diagnostic.Create(
Kestrel\ListenOnIPv6AnyAnalyzer.cs (2)
69context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny, ipAddressArgumentSyntax.GetLocation())); 94context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.KestrelShouldListenOnIPv6AnyInsteadOfIpAny, ipAddressArgumentSyntax.GetLocation()));
Mvc\DetectAmbiguousActionRoutes.cs (1)
42context.ReportDiagnostic(Diagnostic.Create(
Mvc\DetectOverriddenAuthorizeAttribute.cs (1)
216context.ReportDiagnostic(Diagnostic.Create(
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
45context.ReportDiagnostic(Diagnostic.Create(
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (2)
60context.ReportDiagnostic(Diagnostic.Create( 103context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
54context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DetectAmbiguousRoutes.cs (1)
40context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
36context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
47context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
38context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (2)
74context.ReportDiagnostic(Diagnostic.Create( 103context.ReportDiagnostic(Diagnostic.Create(
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (2)
47context.ReportDiagnostic(Diagnostic.Create( 81context.ReportDiagnostic(Diagnostic.Create(
WebApplicationBuilder\PublicPartialProgramClassAnalyzer.cs (1)
27context.ReportDiagnostic(Diagnostic.Create(
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (2)
255static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, IInvocationOperation operation) 304return Diagnostic.Create(descriptor, location, methodName);
Microsoft.AspNetCore.App.Analyzers.Test (52)
Components\DisallowNonLiteralSequenceNumbersTest.cs (3)
45var diagnostic = Assert.Single(diagnostics); 66var diagnostic = Assert.Single(diagnostics); 87var diagnostic = Assert.Single(diagnostics);
Infrastructure\WellKnownTypesTests.cs (1)
121context.ReportDiagnostic(Diagnostic.Create(
RouteEmbeddedLanguage\RoutePatternAnalyzerTests.cs (6)
44var diagnostic = Assert.Single(diagnostics); 76var diagnostic = Assert.Single(diagnostics); 109var diagnostic = Assert.Single(diagnostics); 137var diagnostic = Assert.Single(diagnostics); 165var diagnostic = Assert.Single(diagnostics); 194var diagnostic = Assert.Single(diagnostics);
RouteHandlers\DetectMisplacedLambdaAttributeTest.cs (4)
47var diagnostic = Assert.Single(diagnostics); 69var diagnostic = Assert.Single(diagnostics); 169var diagnostic = Assert.Single(diagnostics); 217var diagnostic = Assert.Single(diagnostics);
RouteHandlers\DisallowMvcBindArgumentsOnParametersTest.cs (2)
60var diagnostic = Assert.Single(diagnostics); 82var diagnostic = Assert.Single(diagnostics);
RouteHandlers\DisallowReturningActionResultsFromMapMethodsTest.cs (6)
129var diagnostic = Assert.Single(diagnostics); 152var diagnostic = Assert.Single(diagnostics); 180var diagnostic = Assert.Single(diagnostics); 212var diagnostic = Assert.Single(diagnostics); 250var diagnostic = Assert.Single(diagnostics); 288var diagnostic = Assert.Single(diagnostics);
TestDiagnosticAnalyzer.cs (2)
107public Task<Diagnostic[]> GetDiagnosticsAsync(params string[] sources) 166public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
WebApplicationBuilder\DisallowConfigureHostBuilderConfigureWebHostTest.cs (7)
44var diagnostic = Assert.Single(diagnostics); 65var diagnostic = Assert.Single(diagnostics); 87var diagnostic = Assert.Single(diagnostics); 127var diagnostic = Assert.Single(diagnostics); 155var diagnostic = Assert.Single(diagnostics); 184var diagnostic = Assert.Single(diagnostics); 218var diagnostic = Assert.Single(diagnostics);
WebApplicationBuilder\DisallowConfigureHostLoggingTest.cs (1)
272var diagnostic = Assert.Single(diagnostics);
WebApplicationBuilder\DisallowConfigureServicesTest.cs (1)
283var diagnostic = Assert.Single(diagnostics);
WebApplicationBuilder\DisallowConfigureWebHostBuilderConfigureTest.cs (4)
46var diagnostic = Assert.Single(diagnostics); 67var diagnostic = Assert.Single(diagnostics); 94var diagnostic = Assert.Single(diagnostics); 122var diagnostic = Assert.Single(diagnostics);
WebApplicationBuilder\DisallowConfigureWebHostBuilderUseStartupTest.cs (6)
45var diagnostic = Assert.Single(diagnostics); 66var diagnostic = Assert.Single(diagnostics); 86var diagnostic = Assert.Single(diagnostics); 107var diagnostic = Assert.Single(diagnostics); 134var diagnostic = Assert.Single(diagnostics); 162var diagnostic = Assert.Single(diagnostics);
WebApplicationBuilder\UseTopLevelRouteRegistrationInsteadOfUseEndpointsTest.cs (9)
121var diagnostic = Assert.Single(diagnostics); 158var diagnostic1 = diagnostics[0]; 159var diagnostic2 = diagnostics[1]; 160var diagnostic3 = diagnostics[2]; 161var diagnostic4 = diagnostics[3]; 206var diagnostic = Assert.Single(diagnostics); 232var diagnostic = Assert.Single(diagnostics); 260var diagnostic1 = diagnostics[0]; 261var diagnostic2 = diagnostics[1];
Microsoft.AspNetCore.App.CodeFixes (21)
Authorization\AddAuthorizationBuilderFixer.cs (3)
41foreach (var diagnostic in context.Diagnostics) 55private static bool CanReplaceWithAddAuthorizationBuilder(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocation) 134private static Task<Document> ReplaceWithAddAuthorizationBuilder(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation)
Dependencies\AddPackageFixer.cs (1)
47foreach (var diagnostic in context.Diagnostics)
DetectMismatchedParameterOptionalityFixer.cs (2)
25foreach (var diagnostic in context.Diagnostics) 37private static async Task<Document> FixMismatchedParameterOptionalityAsync(Diagnostic diagnostic, Document document, CancellationToken cancellationToken)
Http\HeaderDictionaryAddFixer.cs (5)
44foreach (var diagnostic in context.Diagnostics) 68private static Task<Document> ReplaceWithAppend(Diagnostic diagnostic, WellKnownTypes wellKnownTypes, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 78private static bool CanReplaceWithAppend(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocation) 99private static Task<Document> ReplaceWithIndexer(Diagnostic diagnostic, SyntaxNode root, Document document, AssignmentExpressionSyntax assignment) 106private static bool CanReplaceWithIndexer(Diagnostic diagnostic, SyntaxNode root, [NotNullWhen(true)] out AssignmentExpressionSyntax? assignment)
Http\HeaderDictionaryIndexerFixer.cs (2)
25foreach (var diagnostic in context.Diagnostics) 42private static async Task<Document> FixHeaderDictionaryIndexer(Diagnostic diagnostic, Document document, string resolvedPropertyName, CancellationToken cancellationToken)
Kestrel\ListenOnIPv6AnyFixer.cs (1)
26foreach (var diagnostic in context.Diagnostics)
PublicPartialProgramClassFixer.cs (1)
25foreach (var diagnostic in context.Diagnostics)
RouteParameterUnusedParameterFixer.cs (3)
45foreach (var diagnostic in context.Diagnostics) 58private static Task<Document> AddRouteParameterAsync(Diagnostic diagnostic, SyntaxNode root, RouteUsageCache routeUsageCache, Document document, CancellationToken cancellationToken) 74private static Document UpdateDocument(Diagnostic diagnostic, SyntaxNode root, Document document, SyntaxNode methodSyntax)
WebApplicationBuilderFixer.cs (3)
37foreach (var diagnostic in context.Diagnostics) 77private static Task<Document> FixWebApplicationBuilderAsync(Diagnostic diagnostic, SyntaxNode root, Document document, InvocationExpressionSyntax invocation) 84private static bool CanFixWebApplicationBuilder(Diagnostic diagnostic, IdentifierNameSyntax identifierMethod, SyntaxNode root, [NotNullWhen(true)] out InvocationExpressionSyntax? invocationName)
Microsoft.AspNetCore.Components.Analyzers (11)
ComponentParameterAnalyzer.cs (5)
84context.ReportDiagnostic(Diagnostic.Create( 91context.ReportDiagnostic(Diagnostic.Create( 105context.ReportDiagnostic(Diagnostic.Create( 115context.ReportDiagnostic(Diagnostic.Create( 126context.ReportDiagnostic(Diagnostic.Create(
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
ComponentParameterUsageAnalyzer.cs (1)
105context.ReportDiagnostic(Diagnostic.Create(
InternalUsageAnalyzer.cs (4)
137context.ReportDiagnostic(Diagnostic.Create( 147context.ReportDiagnostic(Diagnostic.Create( 166context.ReportDiagnostic(Diagnostic.Create( 176context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Components.Analyzers.Tests (16)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
19public Task<Diagnostic[]> GetDiagnosticsAsync(string source) 24public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Helpers\CodeFixVerifier.Helper.cs (4)
41private static IEnumerable<Diagnostic> GetNewDiagnostics(IEnumerable<Diagnostic> diagnostics, IEnumerable<Diagnostic> newDiagnostics) 68private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document)
Helpers\DiagnosticVerifier.Helper.cs (6)
39private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer) 51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) 59var diagnostics = new List<Diagnostic>(); 64foreach (var diag in diags) 95private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics)
Verifiers\DiagnosticVerifier.cs (4)
106private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) 121var actual = actualResults.ElementAt(i); 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 237private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
Microsoft.AspNetCore.Components.SdkAnalyzers (10)
ComponentParameterAnalyzer.cs (4)
78context.ReportDiagnostic(Diagnostic.Create( 85context.ReportDiagnostic(Diagnostic.Create( 99context.ReportDiagnostic(Diagnostic.Create( 113context.ReportDiagnostic(Diagnostic.Create(
ComponentParametersShouldBePublicCodeFixProvider.cs (1)
34var diagnostic = context.Diagnostics.First();
ComponentParameterUsageAnalyzer.cs (1)
105context.ReportDiagnostic(Diagnostic.Create(
InternalUsageAnalyzer.cs (4)
137context.ReportDiagnostic(Diagnostic.Create( 147context.ReportDiagnostic(Diagnostic.Create( 166context.ReportDiagnostic(Diagnostic.Create( 176context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (16)
ComponentAnalyzerDiagnosticAnalyzerRunner.cs (2)
19public Task<Diagnostic[]> GetDiagnosticsAsync(string source) 24public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Helpers\CodeFixVerifier.Helper.cs (4)
41private static IEnumerable<Diagnostic> GetNewDiagnostics(IEnumerable<Diagnostic> diagnostics, IEnumerable<Diagnostic> newDiagnostics) 68private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document)
Helpers\DiagnosticVerifier.Helper.cs (6)
39private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer) 51protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) 59var diagnostics = new List<Diagnostic>(); 64foreach (var diag in diags) 95private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics)
Verifiers\DiagnosticVerifier.cs (4)
106private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) 121var actual = actualResults.ElementAt(i); 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 237private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
Microsoft.AspNetCore.Http.Extensions.Tests (4)
RequestDelegateGenerator\CompileTimeCreationTests.AsParameters.cs (3)
32var diagnostic = Assert.Single(result.Diagnostics); 83var diagnostic = Assert.Single(result.Diagnostics); 102var diagnostic = Assert.Single(result.Diagnostics);
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
200var diagnostic = Assert.Single(result.Diagnostics);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (21)
RequestDelegateGenerator.cs (1)
44foreach (var diagnostic in endpoint.Diagnostics)
RequestDelegateGeneratorSuppressor.cs (1)
38foreach (var diagnostic in context.ReportedDiagnostics)
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (7)
12public static void EmitRequiredDiagnostics(this EndpointResponse response, List<Diagnostic> diagnostics, Location location) 16diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.TypeParametersNotSupported, location)); 21diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InaccessibleTypesNotSupported, location)); 26diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.UnableToResolveAnonymousReturnType, location)); 30public static void EmitRequiredDiagnostics(this IParameterSymbol parameterSymbol, List<Diagnostic> diagnostics, Location location) 37diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.TypeParametersNotSupported, location)); 45diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InaccessibleTypesNotSupported, location, typeSymbol.Name));
StaticRouteHandlerModel\Endpoint.cs (4)
31Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.UnableToResolveMethod, Operation.Syntax.GetLocation())); 77Diagnostics.Add(Diagnostic.Create( 102public List<Diagnostic> Diagnostics { get; } = new List<Diagnostic>();
StaticRouteHandlerModel\EndpointParameter.cs (8)
116endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.UnableToResolveParameterDescriptor, location, symbol.Name)); 152endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.KeyedAndNotKeyedServiceAttributesNotSupported, location)); 167endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersNullable, location, Type.ToDisplayString(SymbolDisplayFormat.CSharpShortErrorMessageFormat))); 175endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersNested, location)); 465endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersAbstractType, location, parameterTypeString)); 504endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersSignature, location, parameterTypeString)); 523endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersSingleConstructorOnly, location, parameterTypeString)); 527endpoint.Diagnostics.Add(Diagnostic.Create(DiagnosticDescriptors.InvalidAsParametersNoConstructorFound, location, parameterTypeString));
Microsoft.AspNetCore.Mvc.Analyzers (7)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (3)
89context.ReportDiagnostic(Diagnostic.Create( 103context.ReportDiagnostic(Diagnostic.Create( 117context.ReportDiagnostic(Diagnostic.Create(
AvoidHtmlPartialAnalyzer.cs (2)
31context.ReportDiagnostic(Diagnostic.Create( 38context.ReportDiagnostic(Diagnostic.Create(
TagHelpersInCodeBlocksAnalyzer.cs (1)
97Diagnostic.Create(DiagnosticDescriptors.MVC1006_FunctionsContainingTagHelpersMustBeAsyncAndReturnTask, location));
TopLevelParameterNameAnalyzer.cs (1)
74Diagnostic.Create(
Microsoft.AspNetCore.Mvc.Api.Analyzers (8)
AddResponseTypeAttributeCodeFixAction.cs (2)
33private readonly Diagnostic _diagnostic; 35public AddResponseTypeAttributeCodeFixAction(Document document, Diagnostic diagnostic)
AddResponseTypeAttributeCodeFixProvider.cs (1)
24var diagnostic = context.Diagnostics[0];
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (1)
122Diagnostic.Create(
ApiActionsDoNotRequireExplicitModelValidationCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics[0];
ApiConventionAnalyzer.cs (3)
60context.ReportDiagnostic(Diagnostic.Create( 66context.ReportDiagnostic(Diagnostic.Create( 86context.ReportDiagnostic(Diagnostic.Create(
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (3)
CompilationFailedExceptionFactory.cs (3)
51IEnumerable<Diagnostic> diagnostics) 117private static DiagnosticMessage GetDiagnosticMessage(Diagnostic diagnostic) 146private static string GetFilePath(RazorCodeDocument codeDocument, Diagnostic diagnostic)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
CompilerFailedExceptionFactoryTest.cs (3)
238Diagnostic.Create( 244Diagnostic.Create( 250Diagnostic.Create(
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (20)
HubClientProxyGenerator.Parser.cs (10)
55context.ReportDiagnostic(Diagnostic.Create( 64context.ReportDiagnostic(Diagnostic.Create( 73context.ReportDiagnostic(Diagnostic.Create( 82context.ReportDiagnostic(Diagnostic.Create( 91context.ReportDiagnostic(Diagnostic.Create( 100context.ReportDiagnostic(Diagnostic.Create( 109context.ReportDiagnostic(Diagnostic.Create( 197Diagnostic.Create( 228_context.ReportDiagnostic(Diagnostic.Create( 303_context.ReportDiagnostic(Diagnostic.Create(
HubServerProxyGenerator.Parser.cs (10)
55context.ReportDiagnostic(Diagnostic.Create( 64context.ReportDiagnostic(Diagnostic.Create( 73context.ReportDiagnostic(Diagnostic.Create( 82context.ReportDiagnostic(Diagnostic.Create( 91context.ReportDiagnostic(Diagnostic.Create( 99context.ReportDiagnostic(Diagnostic.Create( 187Diagnostic.Create(DiagnosticDescriptors.TooManyHubServerProxyAttributedMethods, 217_context.ReportDiagnostic(Diagnostic.Create( 240_context.ReportDiagnostic(Diagnostic.Create( 325_context.ReportDiagnostic(Diagnostic.Create(
Microsoft.CodeAnalysis (701)
Binding\BindingDiagnosticBag.cs (7)
31internal void AddRange<T>(ImmutableArray<T> diagnostics) where T : Diagnostic 36internal void AddRange(IEnumerable<Diagnostic> diagnostics) 53internal void Add(Diagnostic diag) 314private readonly ImmutableArray<Diagnostic> _diagnostics; 317public ImmutableArray<Diagnostic> Diagnostics => _diagnostics.NullToEmpty(); 322public ReadOnlyBindingDiagnostic(ImmutableArray<Diagnostic> diagnostics, ImmutableArray<TAssemblySymbol> dependencies) 359foreach (var diagnostic in Diagnostics)
CommandLine\AnalyzerConfigOptionsResult.cs (2)
30public ImmutableArray<Diagnostic> Diagnostics { get; } 35ImmutableArray<Diagnostic> diagnostics)
CommandLine\AnalyzerConfigSet.cs (8)
126public static AnalyzerConfigSet Create<TList>(TList analyzerConfigs, out ImmutableArray<Diagnostic> diagnostics) where TList : IReadOnlyCollection<AnalyzerConfig> 245var diagnosticBuilder = ArrayBuilder<Diagnostic>.GetInstance(); 373var diagnosticBuilder = ArrayBuilder<Diagnostic>.GetInstance(); 395private static void ParseSectionOptions(Section section, TreeOptions.Builder treeBuilder, AnalyzerOptions.Builder analyzerBuilder, ArrayBuilder<Diagnostic> diagnosticBuilder, string analyzerConfigPath, ConcurrentDictionary<ReadOnlyMemory<char>, string> diagIdCache) 432diagnosticBuilder.Add(Diagnostic.Create( 453internal static GlobalAnalyzerConfig MergeGlobalConfigs(ArrayBuilder<AnalyzerConfig> analyzerConfigs, out ImmutableArray<Diagnostic> diagnostics) 503diagnostics.Add(Diagnostic.Create( 526diagnostics.Add(Diagnostic.Create(
CommandLine\CommandLineArguments.cs (2)
151public ImmutableArray<Diagnostic> Errors { get; internal set; } 437var diagnostic = PortableExecutableReference.ExceptionToDiagnostic(e, messageProviderOpt!, Location.None, cmdReference.Reference, cmdReference.Properties.Kind);
CommandLine\CommandLineParser.cs (27)
206IList<Diagnostic> diagnostics, 338protected ImmutableArray<KeyValuePair<string, string>> ParsePathMap(string pathMap, IList<Diagnostic> errors) 357errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.ERR_InvalidPathMap)); 366errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.ERR_InvalidPathMap)); 424IList<Diagnostic> errors, 434errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, invalidPath)); 442IList<Diagnostic> errors, 452errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, invalidPath)); 466IList<Diagnostic> errors, 477errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, invalidPath)); 491IList<Diagnostic> diagnostics, 559diagnostics.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, path)); 569diagnostics.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, path)); 641diagnostics.Add(Diagnostic.Create(_messageProvider, _messageProvider.ERR_OpenResponseFile, fullPath)); 663diagnostics.Add(Diagnostic.Create(_messageProvider, _messageProvider.WRN_NoConfigNotOnCommandLine)); 1087internal IEnumerable<string> ResolveRelativePaths(IEnumerable<string> paths, string baseDirectory, IList<Diagnostic> errors) 1094errors.Add(Diagnostic.Create(_messageProvider, _messageProvider.FTL_InvalidInputFileName, path)); 1121internal void ParseFileArgument(ReadOnlyMemory<char> arg, string? baseDirectory, ArrayBuilder<string> filePathBuilder, IList<Diagnostic> errors) 1144errors.Add(Diagnostic.Create(MessageProvider, (int)MessageProvider.FTL_InvalidInputFileName, path)); 1153private protected void ParseSeparatedFileArgument(ReadOnlyMemory<char> value, string? baseDirectory, ArrayBuilder<string> filePathBuilder, IList<Diagnostic> errors) 1169private protected IEnumerable<string> ParseSeparatedFileArgument(string value, string? baseDirectory, IList<Diagnostic> errors) 1180internal IEnumerable<CommandLineSourceFile> ParseRecurseArgument(string arg, string? baseDirectory, IList<Diagnostic> errors) 1228IList<Diagnostic> errors) 1280errors.Add(Diagnostic.Create(MessageProvider, (int)MessageProvider.FTL_InvalidInputFileName, path)); 1300errors.Add(Diagnostic.Create(MessageProvider, (int)MessageProvider.ERR_FileNotFound, path)); 1313internal abstract void GenerateErrorForNoFilesFoundInRecurse(string path, IList<Diagnostic> errors); 1315internal ReportDiagnostic GetDiagnosticOptionsFromRulesetFile(string? fullPath, out Dictionary<string, ReportDiagnostic> diagnosticOptions, IList<Diagnostic> diagnostics)
CommandLine\CommonCompiler.cs (14)
93private readonly HashSet<Diagnostic> _reportedDiagnostics = new HashSet<Diagnostic>(); 325diagnostics.Add(Diagnostic.Create( 379diagnostics.Add(Diagnostic.Create(ToFileReadDiagnostics(MessageProvider, e, filePath))); 526internal bool ReportDiagnostics(IEnumerable<Diagnostic> diagnostics, TextWriter consoleOutput, ErrorLogger? errorLoggerOpt, Compilation? compilation) 529foreach (var diag in diagnostics) 537void reportDiagnostic(Diagnostic diag, SuppressionInfo? suppressionInfo) 602=> ReportDiagnostics(diagnostics.Select(info => Diagnostic.Create(info)), consoleOutput, errorLoggerOpt, compilation); 607private void ReportIVTInfos(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics) 664private protected abstract void DiagnoseBadAccesses(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics); 674foreach (var diag in diagnostics.AsEnumerable()) 686foreach (var diag in diagnostics.AsEnumerable()) 702foreach (Diagnostic diagnostic in diagnostics.AsEnumerable()) 713protected virtual void PrintError(Diagnostic diagnostic, TextWriter consoleOutput)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (6)
28private readonly Diagnostic _originalDiagnostic; 33Diagnostic originalDiagnostic, 70public override bool Equals(Diagnostic? obj) 94internal override Diagnostic WithLocation(Location location) 99internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 104internal override Diagnostic WithIsSuppressed(bool isSuppressed)
CommandLine\ErrorLogger.cs (1)
15public abstract void LogDiagnostic(Diagnostic diagnostic, SuppressionInfo? suppressionInfo);
CommandLine\SarifErrorLogger.cs (1)
83protected void WriteResultProperties(Diagnostic diagnostic)
CommandLine\SarifV1ErrorLogger.cs (1)
59public override void LogDiagnostic(Diagnostic diagnostic, SuppressionInfo? suppressionInfo)
CommandLine\SarifV2ErrorLogger.cs (1)
56public override void LogDiagnostic(Diagnostic diagnostic, SuppressionInfo? suppressionInfo)
Compilation\Compilation.cs (11)
1770public abstract ImmutableArray<Diagnostic> GetParseDiagnostics(CancellationToken cancellationToken = default(CancellationToken)); 1775public abstract ImmutableArray<Diagnostic> GetDeclarationDiagnostics(CancellationToken cancellationToken = default(CancellationToken)); 1780public abstract ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(CancellationToken cancellationToken = default(CancellationToken)); 1787public abstract ImmutableArray<Diagnostic> GetDiagnostics(CancellationToken cancellationToken = default(CancellationToken)); 1881internal bool FilterAndAppendDiagnostics(DiagnosticBag accumulator, IEnumerable<Diagnostic> incoming, HashSet<int>? exclude, CancellationToken cancellationToken) 1886foreach (Diagnostic d in incoming) 1893var filtered = Options.FilterDiagnostic(d, cancellationToken); 3764/// Given a <see cref="Diagnostic"/> reporting unreferenced <see cref="AssemblyIdentity"/>s, returns 3767public ImmutableArray<AssemblyIdentity> GetUnreferencedAssemblyIdentities(Diagnostic diagnostic) 3794/// Returns the required language version found in a <see cref="Diagnostic"/>, if any is found. 3797public static string? GetRequiredLanguageVersion(Diagnostic diagnostic)
Compilation\CompilationOptions.cs (9)
190internal abstract Diagnostic? FilterDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken); 203/// Whether diagnostics suppressed in source, i.e. <see cref="Diagnostic.IsSuppressed"/> is true, should be reported. 262private readonly Lazy<ImmutableArray<Diagnostic>> _lazyErrors; 326_lazyErrors = new Lazy<ImmutableArray<Diagnostic>>(() => 328var builder = ArrayBuilder<Diagnostic>.GetInstance(); 562internal abstract void ValidateOptions(ArrayBuilder<Diagnostic> builder); 564internal void ValidateOptions(ArrayBuilder<Diagnostic> builder, CommonMessageProvider messageProvider) 606public ImmutableArray<Diagnostic> Errors
Compilation\EmitResult.cs (2)
27public ImmutableArray<Diagnostic> Diagnostics { get; } 29internal EmitResult(bool success, ImmutableArray<Diagnostic> diagnostics)
Compilation\LoadDirective.cs (2)
16public readonly ImmutableArray<Diagnostic> Diagnostics; 18public LoadDirective(string? resolvedPath, ImmutableArray<Diagnostic> diagnostics)
Compilation\ParseOptions.cs (6)
21private readonly Lazy<ImmutableArray<Diagnostic>> _lazyErrors; 45_lazyErrors = new Lazy<ImmutableArray<Diagnostic>>(() => 47var builder = ArrayBuilder<Diagnostic>.GetInstance(); 61public ImmutableArray<Diagnostic> Errors 77internal abstract void ValidateOptions(ArrayBuilder<Diagnostic> builder); 79internal void ValidateOptions(ArrayBuilder<Diagnostic> builder, CommonMessageProvider messageProvider)
Compilation\SemanticModel.cs (4)
331public abstract ImmutableArray<Diagnostic> GetSyntaxDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)); 345public abstract ImmutableArray<Diagnostic> GetDeclarationDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)); 359public abstract ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)); 376public abstract ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken));
Diagnostic\CommonDiagnosticComparer.cs (4)
10internal sealed class CommonDiagnosticComparer : IEqualityComparer<Diagnostic> 18public bool Equals(Diagnostic? x, Diagnostic? y) 33public int GetHashCode(Diagnostic obj)
Diagnostic\CommonMessageProvider.cs (4)
57/// Default category is <see cref="Diagnostic.CompilerDiagnosticCategory"/>. 80public Diagnostic CreateDiagnostic(int code, Location location) 88public abstract Diagnostic CreateDiagnostic(DiagnosticInfo info); 93public abstract Diagnostic CreateDiagnostic(int code, Location location, params object[] args);
Diagnostic\Diagnostic.cs (33)
20public abstract partial class Diagnostic : IEquatable<Diagnostic?>, IFormattable 40/// Creates a <see cref="Diagnostic"/> instance. 45/// <returns>The <see cref="Diagnostic"/> instance.</returns> 46public static Diagnostic Create( 55/// Creates a <see cref="Diagnostic"/> instance. 65/// <returns>The <see cref="Diagnostic"/> instance.</returns> 66public static Diagnostic Create( 76/// Creates a <see cref="Diagnostic"/> instance. 86/// <returns>The <see cref="Diagnostic"/> instance.</returns> 87public static Diagnostic Create( 97/// Creates a <see cref="Diagnostic"/> instance. 112/// <returns>The <see cref="Diagnostic"/> instance.</returns> 113public static Diagnostic Create( 124/// Creates a <see cref="Diagnostic"/> instance. 140/// <returns>The <see cref="Diagnostic"/> instance.</returns> 141public static Diagnostic Create( 166/// Creates a <see cref="Diagnostic"/> instance which is localizable. 193/// <returns>The <see cref="Diagnostic"/> instance.</returns> 194public static Diagnostic Create( 215/// Creates a <see cref="Diagnostic"/> instance which is localizable. 243/// <returns>The <see cref="Diagnostic"/> instance.</returns> 244public static Diagnostic Create( 280internal static Diagnostic Create(CommonMessageProvider messageProvider, int errorCode) 285internal static Diagnostic Create(CommonMessageProvider messageProvider, int errorCode, params object[] arguments) 290internal static Diagnostic Create(DiagnosticInfo info) 296/// Gets the diagnostic descriptor, which provides a description about a <see cref="Diagnostic"/>. 424=> obj is Diagnostic diagnostic && Equals(diagnostic); 428public abstract bool Equals(Diagnostic? obj); 453internal abstract Diagnostic WithLocation(Location location); 458internal abstract Diagnostic WithSeverity(DiagnosticSeverity severity); 463internal abstract Diagnostic WithIsSuppressed(bool isSuppressed); 468internal Diagnostic WithProgrammaticSuppression(ProgrammaticSuppressionInfo programmaticSuppressionInfo) 527internal Diagnostic? WithReportDiagnostic(ReportDiagnostic reportAction)
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (6)
18private readonly Diagnostic _originalUnsuppressedDiagnostic; 22Diagnostic originalUnsuppressedDiagnostic, 86public override bool Equals(Diagnostic? obj) 108internal override Diagnostic WithLocation(Location location) 123internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 133internal override Diagnostic WithIsSuppressed(bool isSuppressed)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (4)
145public override bool Equals(Diagnostic? obj) 179internal override Diagnostic WithLocation(Location location) 194internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 205internal override Diagnostic WithIsSuppressed(bool isSuppressed)
Diagnostic\DiagnosticArrayExtensions.cs (1)
11internal static bool HasAnyErrors<T>(this ImmutableArray<T> diagnostics) where T : Diagnostic
Diagnostic\DiagnosticBag.cs (34)
33private ConcurrentQueue<Diagnostic>? _lazyBag; 50ConcurrentQueue<Diagnostic>? bag = _lazyBag; 72foreach (Diagnostic diagnostic in Bag) 100foreach (Diagnostic diagnostic in Bag) 114public void Add(Diagnostic diag) 116ConcurrentQueue<Diagnostic> bag = this.Bag; 123public void AddRange<T>(ImmutableArray<T> diagnostics) where T : Diagnostic 127ConcurrentQueue<Diagnostic> bag = this.Bag; 138public void AddRange(IEnumerable<Diagnostic> diagnostics) 140foreach (Diagnostic diagnostic in diagnostics) 170public ImmutableArray<TDiagnostic> ToReadOnlyAndFree<TDiagnostic>(bool forceResolution = true) where TDiagnostic : Diagnostic 172ConcurrentQueue<Diagnostic>? oldBag = _lazyBag; 178public ImmutableArray<Diagnostic> ToReadOnlyAndFree(bool forceResolution = true) 180return ToReadOnlyAndFree<Diagnostic>(forceResolution); 183public ImmutableArray<TDiagnostic> ToReadOnly<TDiagnostic>(bool forceResolution = true) where TDiagnostic : Diagnostic 185ConcurrentQueue<Diagnostic>? oldBag = _lazyBag; 189public ImmutableArray<Diagnostic> ToReadOnly(bool forceResolution = true) 191return ToReadOnly<Diagnostic>(forceResolution); 194private static ImmutableArray<TDiagnostic> ToReadOnlyCore<TDiagnostic>(ConcurrentQueue<Diagnostic>? oldBag, bool forceResolution) where TDiagnostic : Diagnostic 226public IEnumerable<Diagnostic> AsEnumerable() 228ConcurrentQueue<Diagnostic> bag = this.Bag; 232foreach (Diagnostic diagnostic in bag) 250private IEnumerable<Diagnostic> AsEnumerableFiltered() 252foreach (Diagnostic diagnostic in this.Bag) 262internal IEnumerable<Diagnostic> AsEnumerableWithoutResolution() 265return _lazyBag ?? SpecializedCollections.EmptyEnumerable<Diagnostic>(); 280foreach (Diagnostic diag in Bag) // NOTE: don't force resolution 294private ConcurrentQueue<Diagnostic> Bag 298ConcurrentQueue<Diagnostic>? bag = _lazyBag; 304ConcurrentQueue<Diagnostic> newBag = new ConcurrentQueue<Diagnostic>(); 315ConcurrentQueue<Diagnostic>? bag = _lazyBag; 360ConcurrentQueue<Diagnostic>? lazyBag = _bag._lazyBag;
Diagnostic\DiagnosticDescriptor.cs (5)
16/// Provides a description about a <see cref="Diagnostic"/> 79/// Create a DiagnosticDescriptor, which provides description about a <see cref="Diagnostic"/>. 111/// Create a DiagnosticDescriptor, which provides description about a <see cref="Diagnostic"/>. 244var effectiveDiagnostic = compilationOptions.FilterDiagnostic(Diagnostic.Create(this, Location.None), CancellationToken.None);
Diagnostic\DiagnosticFormatter.cs (6)
13/// Formats <see cref="Diagnostic"/> messages. 18/// Formats the <see cref="Diagnostic"/> message using the optional <see cref="IFormatProvider"/>. 23public virtual string Format(Diagnostic diagnostic, IFormatProvider? formatter = null) 82internal string GetMessagePrefix(Diagnostic diagnostic) 106private string FormatHelpLinkUri(Diagnostic diagnostic) 118internal virtual bool HasDefaultHelpLinkUri(Diagnostic diagnostic) => true;
Diagnostic\DiagnosticInfo.cs (2)
229return Diagnostic.GetDefaultWarningLevel(_effectiveSeverity); 254/// Default category is <see cref="Diagnostic.CompilerDiagnosticCategory"/>.
Diagnostic\DiagnosticWithInfo.cs (4)
155public override bool Equals(Diagnostic? obj) 195internal override Diagnostic WithLocation(Location location) 210internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 220internal override Diagnostic WithIsSuppressed(bool isSuppressed)
Diagnostic\SuppressionDescriptor.cs (6)
12/// Provides a description about a programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>. 22/// Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. 32/// Create a SuppressionDescriptor, which provides a justification about a programmatic suppression of a <see cref="Diagnostic"/>. 37/// <param name="suppressedDiagnosticId">Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. For example, compiler warning Id "CS0649".</param> 48/// Create a SuppressionDescriptor, which provides a localizable justification about a programmatic suppression of a <see cref="Diagnostic"/>. 51/// <param name="suppressedDiagnosticId">Identifier of the suppressed diagnostic, i.e. <see cref="Diagnostic.Id"/>. For example, compiler warning Id "CS0649".</param>
Diagnostic\SuppressionInfo.cs (1)
17/// <see cref="Diagnostic.Id"/> of the suppressed diagnostic.
DiagnosticAnalyzer\AnalysisResult.cs (18)
23ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics, 24ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics, 25ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics, 26ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 45public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SyntaxDiagnostics { get; } 50public ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> SemanticDiagnostics { get; } 55public ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> AdditionalFileDiagnostics { get; } 60public ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> CompilationDiagnostics { get; } 70public ImmutableArray<Diagnostic> GetAllDiagnostics(DiagnosticAnalyzer analyzer) 83public ImmutableArray<Diagnostic> GetAllDiagnostics() 88private ImmutableArray<Diagnostic> GetDiagnostics(IEnumerable<DiagnosticAnalyzer> analyzers) 95private ImmutableArray<Diagnostic> GetDiagnostics(ImmutableHashSet<DiagnosticAnalyzer> excludedAnalyzers) 99var builder = ImmutableArray.CreateBuilder<Diagnostic>(); 108return ImmutableArray<Diagnostic>.Empty; 112ImmutableDictionary<T, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localDiagnostics, 114ImmutableArray<Diagnostic>.Builder builder) 132ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics, 134ImmutableArray<Diagnostic>.Builder builder)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (51)
36private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSemanticDiagnosticsOpt = null; 37private Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localSyntaxDiagnosticsOpt = null; 38private Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? _localAdditionalFileDiagnosticsOpt = null; 39private Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? _nonLocalDiagnosticsOpt = null; 302static SyntaxTree? getSourceTree(Diagnostic diagnostic) 305AdditionalText? getAdditionalTextKey(Diagnostic diagnostic) 328ImmutableArray<Diagnostic> diagnostics, 330Func<Diagnostic, TKey?> getKeyFunc, 331ref Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics) 339lazyLocalDiagnostics = lazyLocalDiagnostics ?? new Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>(); 349Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? allDiagnostics; 352allDiagnostics = new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 356ImmutableArray<Diagnostic>.Builder? analyzerDiagnostics; 359analyzerDiagnostics = ImmutableArray.CreateBuilder<Diagnostic>(); 367private void UpdateNonLocalDiagnostics_NoLock(DiagnosticAnalyzer analyzer, ImmutableArray<Diagnostic> diagnostics, bool overwrite) 374_nonLocalDiagnosticsOpt = _nonLocalDiagnosticsOpt ?? new Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>(); 376ImmutableArray<Diagnostic>.Builder? currentDiagnostics; 379currentDiagnostics = ImmutableArray.CreateBuilder<Diagnostic>(); 386private static void UpdateDiagnosticsCore_NoLock(ImmutableArray<Diagnostic>.Builder currentDiagnostics, IEnumerable<Diagnostic> diagnostics, bool overwrite) 401internal ImmutableArray<Diagnostic> GetDiagnostics(AnalysisScope analysisScope, bool getLocalDiagnostics, bool getNonLocalDiagnostics) 409private ImmutableArray<Diagnostic> GetDiagnostics_NoLock(AnalysisScope analysisScope, bool getLocalDiagnostics, bool getNonLocalDiagnostics) 413var builder = ImmutableArray.CreateBuilder<Diagnostic>(); 442Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? lazyLocalDiagnostics, 444ImmutableArray<Diagnostic>.Builder builder) 457Dictionary<SyntaxTree, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 459ImmutableArray<Diagnostic>.Builder builder) 463Dictionary<AdditionalText, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 465ImmutableArray<Diagnostic>.Builder builder) 469Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnostics, 472ImmutableArray<Diagnostic>.Builder builder) 475Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? diagnosticsForTree; 483Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder> diagnostics, 485ImmutableArray<Diagnostic>.Builder builder) 491ImmutableArray<Diagnostic>.Builder? diagnosticsByAnalyzer; 503ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSyntaxDiagnostics; 504ImmutableDictionary<SyntaxTree, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localSemanticDiagnostics; 505ImmutableDictionary<AdditionalText, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> localAdditionalFileDiagnostics; 506ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> nonLocalDiagnostics; 509Func<Diagnostic, bool> shouldInclude = analysisScope.ShouldInclude; 523private static ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>> GetImmutable<TKey>( 525Func<Diagnostic, bool> shouldInclude, 526Dictionary<TKey, Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>>? localDiagnosticsOpt) 531return ImmutableDictionary<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>.Empty; 534var builder = ImmutableDictionary.CreateBuilder<TKey, ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>>(); 535var perTreeBuilder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>(); 559private static ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> GetImmutable( 561Func<Diagnostic, bool> shouldInclude, 562Dictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>.Builder>? nonLocalDiagnosticsOpt) 566return ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 569var builder = ImmutableDictionary.CreateBuilder<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>();
DiagnosticAnalyzer\AnalysisScope.cs (1)
292public bool ShouldInclude(Diagnostic diagnostic)
DiagnosticAnalyzer\AnalyzerDriver.cs (55)
50private readonly ConcurrentSet<Diagnostic>? _diagnosticsProcessedForProgrammaticSuppressions; 382_diagnosticsProcessedForProgrammaticSuppressions = HasDiagnosticSuppressors ? new ConcurrentSet<Diagnostic>(ReferenceEqualityComparer.Instance) : null; 476Action<Diagnostic, CancellationToken>? addNotCategorizedDiagnostic = null; 477Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null; 478Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null; 490Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> newOnAnalyzerException = (ex, analyzer, diagnostic, cancellationToken) => 492var filteredDiagnostic = GetFilteredDiagnostic(diagnostic, compilation, analysisOptions.Options, _severityFilter, suppressedDiagnosticIds, cancellationToken); 616private bool ShouldSuppressGeneratedCodeDiagnostic(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 726var diagnostic = AnalyzerExecutor.CreateDriverExceptionDiagnostic(innerException); 817Action<Diagnostic> addExceptionDiagnostic, 824Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = 837Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 864public async Task<ImmutableArray<Diagnostic>> GetDiagnosticsAsync(Compilation compilation, CancellationToken cancellationToken) 879while (DiagnosticQueue.TryDequeue(out var diagnostic)) 1025public ImmutableArray<Diagnostic> ApplyProgrammaticSuppressions(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1036private ImmutableArray<Diagnostic> ApplyProgrammaticSuppressionsCore(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1065var builder = ArrayBuilder<Diagnostic>.GetInstance(reportedDiagnostics.Length); 1066ImmutableDictionary<Diagnostic, ProgrammaticSuppressionInfo> programmaticSuppressionsByDiagnostic = createProgrammaticSuppressionsByDiagnosticMap(_programmaticSuppressions); 1067foreach (var diagnostic in reportedDiagnostics) 1073var suppressedDiagnostic = diagnostic.WithProgrammaticSuppression(programmaticSuppressionInfo); 1091void executeSuppressionActions(IEnumerable<Diagnostic> reportedDiagnostics, bool concurrent) 1131ImmutableArray<Diagnostic> getSuppressableDiagnostics(DiagnosticSuppressor suppressor) 1136return ImmutableArray<Diagnostic>.Empty; 1139using var builder = TemporaryArray<Diagnostic>.Empty; 1140foreach (var diagnostic in reportedDiagnostics) 1152static ImmutableDictionary<Diagnostic, ProgrammaticSuppressionInfo> createProgrammaticSuppressionsByDiagnosticMap(ConcurrentSet<Suppression> programmaticSuppressions) 1154var programmaticSuppressionsBuilder = PooledDictionary<Diagnostic, ArrayBuilder<Suppression>>.GetInstance(); 1168var mapBuilder = ImmutableDictionary.CreateBuilder<Diagnostic, ProgrammaticSuppressionInfo>(); 1179public ImmutableArray<Diagnostic> DequeueLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, bool syntax, Compilation compilation, CancellationToken cancellationToken) 1185public ImmutableArray<Diagnostic> DequeueNonLocalDiagnosticsAndApplySuppressions(DiagnosticAnalyzer analyzer, Compilation compilation, CancellationToken cancellationToken) 1191private ImmutableArray<Diagnostic> FilterDiagnosticsSuppressedInSourceOrByAnalyzers(ImmutableArray<Diagnostic> diagnostics, Compilation compilation, CancellationToken cancellationToken) 1197private static ImmutableArray<Diagnostic> FilterDiagnosticsSuppressedInSource( 1198ImmutableArray<Diagnostic> diagnostics, 1208var builder = ImmutableArray.CreateBuilder<Diagnostic>(); 1216var diagnostic = suppressMessageState.ApplySourceSuppressions(diagnostics[i]); 1229internal ImmutableArray<Diagnostic> ApplyProgrammaticSuppressionsAndFilterDiagnostics(ImmutableArray<Diagnostic> reportedDiagnostics, Compilation compilation, CancellationToken cancellationToken) 1957internal static Action<Diagnostic, CancellationToken> GetDiagnosticSink(Action<Diagnostic> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1961var filteredDiagnostic = GetFilteredDiagnostic(diagnostic, compilation, analyzerOptions, severityFilter, suppressedDiagnosticIds, cancellationToken); 1969internal static Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer, bool> addLocalDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1973var filteredDiagnostic = GetFilteredDiagnostic(diagnostic, compilation, analyzerOptions, severityFilter, suppressedDiagnosticIds, cancellationToken); 1981internal static Action<Diagnostic, DiagnosticAnalyzer, CancellationToken> GetDiagnosticSink(Action<Diagnostic, DiagnosticAnalyzer> addDiagnosticCore, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds) 1985var filteredDiagnostic = GetFilteredDiagnostic(diagnostic, compilation, analyzerOptions, severityFilter, suppressedDiagnosticIds, cancellationToken); 1993private static Diagnostic? GetFilteredDiagnostic(Diagnostic diagnostic, Compilation compilation, AnalyzerOptions? analyzerOptions, SeverityFilter severityFilter, ConcurrentSet<string>? suppressedDiagnosticIds, CancellationToken cancellationToken) 1995var filteredDiagnostic = compilation.Options.FilterDiagnostic(diagnostic, cancellationToken); 2004Diagnostic? applyFurtherFiltering(Diagnostic? diagnostic) 2724var diagnostic = AnalyzerExecutor.CreateDriverExceptionDiagnostic(ex);
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (11)
22public readonly Action<Diagnostic> AddDiagnosticAction; 33Action<Diagnostic, CancellationToken>? addNonCategorizedDiagnostic, 34Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 35Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 36Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 72private Action<Diagnostic, CancellationToken>? _addNonCategorizedDiagnostic; 73private Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 74private Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? _addCategorizedNonLocalDiagnostic; 75private Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; 95private void AddDiagnostic(Diagnostic diagnostic) 124bool isLocalDiagnostic(Diagnostic diagnostic)
DiagnosticAnalyzer\AnalyzerExecutor.cs (50)
34private readonly Action<Diagnostic, CancellationToken>? _addNonCategorizedDiagnostic; 35private readonly Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? _addCategorizedLocalDiagnostic; 36private readonly Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? _addCategorizedNonLocalDiagnostic; 44private readonly Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> _shouldSuppressGeneratedCodeDiagnostic; 101Action<Diagnostic, CancellationToken>? addNonCategorizedDiagnostic, 102Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 107Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 114Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic = null, 115Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic = null, 133Action<Diagnostic, CancellationToken>? addNonCategorizedDiagnosticOpt, 134Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 139Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 146Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 147Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 178internal Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> OnAnalyzerException { get; } 283public void ExecuteSuppressionAction(DiagnosticSuppressor suppressor, ImmutableArray<Diagnostic> reportedDiagnostics, CancellationToken cancellationToken) 325using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 375using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 480using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 527using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 576using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 616using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 640Action<Diagnostic> addDiagnostic, 641Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 666Action<Diagnostic> addDiagnostic, 667Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 842using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 878Action<Diagnostic> addDiagnostic, 879Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 975using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 988Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1076using var _ = PooledDelegates.GetPooledFunction((d, ct, arg) => arg.self.IsSupportedDiagnostic(arg.analyzer, d, ct), (self: this, analyzer), out Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic); 1088Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1206Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException, 1216var diagnostic = CreateAnalyzerExceptionDiagnostic(analyzer, exception, info); 1244internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e, AnalysisContextInfo? info = null) 1252return Diagnostic.Create(descriptor, Location.None, messageArguments); 1293internal static Diagnostic CreateDriverExceptionDiagnostic(Exception e) 1299return Diagnostic.Create(descriptor, Location.None, messageArguments); 1322internal static bool IsAnalyzerExceptionDiagnostic(Diagnostic diagnostic) 1338internal static bool AreEquivalentAnalyzerExceptionDiagnostics(Diagnostic exceptionDiagnostic, Diagnostic other) 1358private bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, CancellationToken cancellationToken) 1369private Action<Diagnostic> GetAddDiagnostic(ISymbol contextSymbol, ImmutableArray<SyntaxReference> cachedDeclaringReferences, DiagnosticAnalyzer analyzer, Func<ISymbol, SyntaxReference, Compilation, CancellationToken, SyntaxNode> getTopMostNodeForAnalysis, CancellationToken cancellationToken) 1375private static Action<Diagnostic> GetAddDiagnostic( 1380Action<Diagnostic, CancellationToken>? addNonCategorizedDiagnostic, 1381Action<Diagnostic, DiagnosticAnalyzer, bool, CancellationToken>? addCategorizedLocalDiagnostic, 1382Action<Diagnostic, DiagnosticAnalyzer, CancellationToken>? addCategorizedNonLocalDiagnostic, 1384Func<Diagnostic, DiagnosticAnalyzer, Compilation, CancellationToken, bool> shouldSuppressGeneratedCodeDiagnostic, 1424private Action<Diagnostic> GetAddCompilationDiagnostic(DiagnosticAnalyzer analyzer, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (1)
339var diagnostic = AnalyzerExecutor.CreateAnalyzerExceptionDiagnostic(analyzer, exception);
DiagnosticAnalyzer\AnalyzerManager.cs (1)
273internal bool IsSupportedDiagnostic(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Func<DiagnosticAnalyzer, bool> isCompilerAnalyzer, AnalyzerExecutor analyzerExecutor, CancellationToken cancellationToken)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (30)
42private readonly ConcurrentSet<Diagnostic> _exceptionDiagnostics = new ConcurrentSet<Diagnostic>(); 233public Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync() 242public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(CancellationToken cancellationToken = default) 253public async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 284public Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync() 292public async Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync(CancellationToken cancellationToken = default) 302async Task<ImmutableArray<Diagnostic>> getAllDiagnosticsWithoutStateTrackingAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 324public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(CancellationToken cancellationToken) 335public async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 342private async Task<ImmutableArray<Diagnostic>> GetAnalyzerCompilationDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 356private async Task<ImmutableArray<Diagnostic>> GetAnalyzerDiagnosticsCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 395public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, CancellationToken cancellationToken) 411public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 427public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 445public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 584private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSyntaxDiagnosticsCoreAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 598public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken) 613public async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 658private async Task<ImmutableArray<Diagnostic>> GetAnalyzerSemanticDiagnosticsCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 1157public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(IEnumerable<Diagnostic> diagnostics, Compilation compilation) 1167public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(ImmutableArray<Diagnostic> diagnostics, Compilation compilation) 1182private static IEnumerable<Diagnostic> GetEffectiveDiagnosticsImpl(ImmutableArray<Diagnostic> diagnostics, Compilation compilation) 1195foreach (var diagnostic in diagnostics) 1199var effectiveDiagnostic = compilation.Options.FilterDiagnostic(diagnostic, CancellationToken.None); 1221Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException = null) 1232Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> wrappedOnAnalyzerException =
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (8)
15private readonly Action<Exception, DiagnosticAnalyzer, Diagnostic>? _onAnalyzerException; 29public Action<Exception, DiagnosticAnalyzer, Diagnostic>? OnAnalyzerException => _onAnalyzerException; 47/// Flag indicating whether analyzer diagnostics with <see cref="Diagnostic.IsSuppressed"/> should be reported. 60Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 74/// <param name="reportSuppressedDiagnostics">Flag indicating whether analyzer diagnostics with <see cref="Diagnostic.IsSuppressed"/> should be reported.</param> 77Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException, 93/// <param name="reportSuppressedDiagnostics">Flag indicating whether analyzer diagnostics with <see cref="Diagnostic.IsSuppressed"/> should be reported.</param> 96Action<Exception, DiagnosticAnalyzer, Diagnostic>? onAnalyzerException,
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (10)
60ImmutableArray<Diagnostic> diagnostics, 61Action<Diagnostic> reportDiagnostic, 65foreach (var diagnostic in diagnostics) 70var current = properties == null ? diagnostic : new CompilerDiagnostic(diagnostic, properties); 78private readonly Diagnostic _original; 81public CompilerDiagnostic(Diagnostic original, ImmutableDictionary<string, string?> properties) 112public override bool Equals(Diagnostic? obj) 122internal override Diagnostic WithLocation(Location location) 127internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 132internal override Diagnostic WithIsSuppressed(bool isSuppressed)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (137)
50/// but cannot itself report any <see cref="Diagnostic"/>s. 57/// A compilation action reports <see cref="Diagnostic"/>s about the <see cref="Compilation"/>. 65/// reports <see cref="Diagnostic"/>s about the model. 72/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 83/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 102/// but cannot itself report any <see cref="Diagnostic"/>s. 110/// A code block action reports <see cref="Diagnostic"/>s about code blocks. 117/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 124/// An additional file action reports <see cref="Diagnostic"/>s about the <see cref="AdditionalText"/> of a document. 134/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 147/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 158/// but cannot itself report any <see cref="Diagnostic"/>s. 168/// An operation block action reports <see cref="Diagnostic"/>s about operation blocks. 178/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 190/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 352/// A compilation end action reports <see cref="Diagnostic"/>s about the <see cref="CodeAnalysis.Compilation"/>. 360/// reports <see cref="Diagnostic"/>s about the model. 367/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 378/// A symbol action reports <see cref="Diagnostic"/>s about <see cref="ISymbol"/>s. 397/// but cannot itself report any <see cref="Diagnostic"/>s. 405/// A code block action reports <see cref="Diagnostic"/>s about code blocks. 413/// but cannot itself report any <see cref="Diagnostic"/>s. 423/// An operation block action reports <see cref="Diagnostic"/>s about operation blocks. 433/// A syntax tree action reports <see cref="Diagnostic"/>s about the <see cref="SyntaxTree"/> of a document. 440/// An additional file action reports <see cref="Diagnostic"/>s about the <see cref="AdditionalText"/> of a document. 450/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 463/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 473/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 485/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 556/// A compilation action or compilation end action can use a <see cref="CompilationAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="CodeAnalysis.Compilation"/>. 562private readonly Action<Diagnostic> _reportDiagnostic; 563private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 583public CompilationAnalysisContext(Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 591Action<Diagnostic> reportDiagnostic, 592Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 605/// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.Compilation"/>. 607/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 608public void ReportDiagnostic(Diagnostic diagnostic) 679/// A semantic model action operates on the <see cref="CodeAnalysis.SemanticModel"/> of a code document, and can use a <see cref="SemanticModelAnalysisContext"/> to report <see cref="Diagnostic"/>s about the model. 685private readonly Action<Diagnostic> _reportDiagnostic; 686private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 722public SemanticModelAnalysisContext(SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 730Action<Diagnostic> reportDiagnostic, 731Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 747/// Report a <see cref="Diagnostic"/> about a <see cref="CodeAnalysis.SemanticModel"/>. 749/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 750public void ReportDiagnostic(Diagnostic diagnostic) 762/// A symbol action can use a <see cref="SymbolAnalysisContext"/> to report <see cref="Diagnostic"/>s about an <see cref="ISymbol"/>. 769private readonly Action<Diagnostic> _reportDiagnostic; 770private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 807internal Func<Diagnostic, CancellationToken, bool> IsSupportedDiagnostic => _isSupportedDiagnostic; 815public SymbolAnalysisContext(ISymbol symbol, Compilation compilation, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 824Action<Diagnostic> reportDiagnostic, 825Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 845/// Report a <see cref="Diagnostic"/> about an <see cref="ISymbol"/>. 847/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 848public void ReportDiagnostic(Diagnostic diagnostic) 860/// A symbol start/end action can use a <see cref="SymbolStartAnalysisContext"/> to report <see cref="Diagnostic"/>s about code within a <see cref="ISymbol"/> and its members. 924/// A symbol end action reports <see cref="Diagnostic"/>s about the code within a <see cref="Symbol"/> and its members. 932/// but cannot itself report any <see cref="Diagnostic"/>s. 940/// A code block action reports <see cref="Diagnostic"/>s about code blocks. 947/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 960/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 971/// but cannot itself report any <see cref="Diagnostic"/>s. 978/// An operation block action reports <see cref="Diagnostic"/>s about operation blocks. 985/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 997/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 1095/// A code block end action reports <see cref="Diagnostic"/>s about code blocks. 1102/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 1114/// A syntax node action can report <see cref="Diagnostic"/>s about <see cref="SyntaxNode"/>s, and can also collect 1124/// A code block action or code block end action can use a <see cref="CodeBlockAnalysisContext"/> to report <see cref="Diagnostic"/>s about a code block. 1132private readonly Action<Diagnostic> _reportDiagnostic; 1133private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1179public CodeBlockAnalysisContext(SyntaxNode codeBlock, ISymbol owningSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1189Action<Diagnostic> reportDiagnostic, 1190Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1208/// Report a <see cref="Diagnostic"/> about a code block. 1210/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 1211public void ReportDiagnostic(Diagnostic diagnostic) 1324/// A code block end action reports <see cref="Diagnostic"/>s about code blocks. 1331/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 1343/// An operation action can report <see cref="Diagnostic"/>s about <see cref="IOperation"/>s, and can also collect 1372/// An operation block action or operation block end action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s about an operation block. 1380private readonly Action<Diagnostic> _reportDiagnostic; 1381private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1436Action<Diagnostic> reportDiagnostic, 1437Func<Diagnostic, bool> isSupportedDiagnostic, 1449Action<Diagnostic> reportDiagnostic, 1450Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1471/// Report a <see cref="Diagnostic"/> about a code block. 1473/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 1474public void ReportDiagnostic(Diagnostic diagnostic) 1505/// A syntax tree action can use a <see cref="SyntaxTreeAnalysisContext"/> to report <see cref="Diagnostic"/>s about a <see cref="SyntaxTree"/> for a code document. 1512private readonly Action<Diagnostic> _reportDiagnostic; 1513private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1546public SyntaxTreeAnalysisContext(SyntaxTree tree, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1554Action<Diagnostic> reportDiagnostic, 1555Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1572/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxTree"/>. 1574/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 1575public void ReportDiagnostic(Diagnostic diagnostic) 1587/// An additional file action can use an <see cref="AdditionalFileAnalysisContext"/> to report <see cref="Diagnostic"/>s about a non-source <see cref="AdditionalText"/> document. 1591private readonly Action<Diagnostic> _reportDiagnostic; 1592private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1624Action<Diagnostic> reportDiagnostic, 1625Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1644public void ReportDiagnostic(Diagnostic diagnostic) 1656/// A syntax node action can use a <see cref="SyntaxNodeAnalysisContext"/> to report <see cref="Diagnostic"/>s for a <see cref="SyntaxNode"/>. 1664private readonly Action<Diagnostic> _reportDiagnostic; 1665private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1716public SyntaxNodeAnalysisContext(SyntaxNode node, ISymbol? containingSymbol, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1722public SyntaxNodeAnalysisContext(SyntaxNode node, SemanticModel semanticModel, AnalyzerOptions options, Action<Diagnostic> reportDiagnostic, Func<Diagnostic, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 1732Action<Diagnostic> reportDiagnostic, 1733Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1751/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>. 1753/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 1754public void ReportDiagnostic(Diagnostic diagnostic) 1766/// An operation action can use an <see cref="OperationAnalysisContext"/> to report <see cref="Diagnostic"/>s for an <see cref="IOperation"/>. 1774private readonly Action<Diagnostic> _reportDiagnostic; 1775private readonly Func<Diagnostic, CancellationToken, bool> _isSupportedDiagnostic; 1827Action<Diagnostic> reportDiagnostic, 1828Func<Diagnostic, bool> isSupportedDiagnostic, 1839Action<Diagnostic> reportDiagnostic, 1840Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, 1860/// Report a <see cref="Diagnostic"/> about a <see cref="SyntaxNode"/>. 1862/// <param name="diagnostic"><see cref="Diagnostic"/> to be reported.</param> 1863public void ReportDiagnostic(Diagnostic diagnostic) 1894/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>. 1897public ImmutableArray<Diagnostic> ReportedDiagnostics { get; } 1917ImmutableArray<Diagnostic> reportedDiagnostics,
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (3)
43internal static void VerifyArguments(Diagnostic diagnostic, Compilation? compilation, Func<Diagnostic, CancellationToken, bool> isSupportedDiagnostic, CancellationToken cancellationToken) 75internal static void VerifyDiagnosticLocationsInCompilation(Diagnostic diagnostic, Compilation compilation)
DiagnosticAnalyzer\DiagnosticQueue.cs (34)
20public abstract bool TryDequeue([NotNullWhen(returnValue: true)] out Diagnostic? d); 21public abstract void Enqueue(Diagnostic diagnostic); 24public abstract void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic); 25public abstract void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer); 26public abstract ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer); 27public abstract ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer); 28public abstract ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer); 40private readonly AsyncQueue<Diagnostic> _queue; 44_queue = new AsyncQueue<Diagnostic>(); 47public SimpleDiagnosticQueue(Diagnostic diagnostic) 49_queue = new AsyncQueue<Diagnostic>(); 53public override void Enqueue(Diagnostic diagnostic) 58public override void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic) 63public override void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 68public override ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer) 73public override ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer) 78public override ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer) 88public override bool TryDequeue([NotNullWhen(returnValue: true)] out Diagnostic? d) 104public override void Enqueue(Diagnostic diagnostic) 109public override void EnqueueLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer, bool isSyntaxDiagnostic) 122public override void EnqueueNonLocal(Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 129Diagnostic diagnostic, 139private static void EnqueueCore_NoLock(Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue> diagnosticsMap, Diagnostic diagnostic, DiagnosticAnalyzer analyzer) 156public override bool TryDequeue([NotNullWhen(returnValue: true)] out Diagnostic? d) 164private bool TryDequeue_NoLock([NotNullWhen(returnValue: true)] out Diagnostic? d) 171private static bool TryDequeue_NoLock(Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? lazyDiagnosticsMap, [NotNullWhen(returnValue: true)] out Diagnostic? d) 173Diagnostic? diag = null; 185public override ImmutableArray<Diagnostic> DequeueLocalSyntaxDiagnostics(DiagnosticAnalyzer analyzer) 190public override ImmutableArray<Diagnostic> DequeueLocalSemanticDiagnostics(DiagnosticAnalyzer analyzer) 195public override ImmutableArray<Diagnostic> DequeueNonLocalDiagnostics(DiagnosticAnalyzer analyzer) 200private ImmutableArray<Diagnostic> DequeueDiagnosticsCore(DiagnosticAnalyzer analyzer, Dictionary<DiagnosticAnalyzer, SimpleDiagnosticQueue>? lazyDiagnosticsMap) 204var builder = ImmutableArray.CreateBuilder<Diagnostic>(); 205while (queue.TryDequeue(out var d)) 213return ImmutableArray<Diagnostic>.Empty;
DiagnosticAnalyzer\DiagnosticSuppressor.cs (1)
35/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>.
DiagnosticAnalyzer\Suppression.cs (8)
13/// Programmatic suppression of a <see cref="Diagnostic"/> by a <see cref="DiagnosticSuppressor"/>. 17private Suppression(SuppressionDescriptor descriptor, Diagnostic suppressedDiagnostic) 32/// Creates a suppression of a <see cref="Diagnostic"/> with the given <see cref="SuppressionDescriptor"/>. 39/// <see cref="Diagnostic"/> to be suppressed, which must be from <see cref="SuppressionAnalysisContext.ReportedDiagnostics"/> 41public static Suppression Create(SuppressionDescriptor descriptor, Diagnostic suppressedDiagnostic) 52public Diagnostic SuppressedDiagnostic { get; } 73&& EqualityComparer<Diagnostic>.Default.Equals(SuppressedDiagnostic, other.SuppressedDiagnostic); 80EqualityComparer<Diagnostic>.Default.GetHashCode(SuppressedDiagnostic));
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (4)
111public Diagnostic ApplySourceSuppressions(Diagnostic diagnostic) 129public bool IsDiagnosticSuppressed(Diagnostic diagnostic, [NotNullWhen(true)] out AttributeData? suppressingAttribute) 142private bool IsDiagnosticSuppressed(Diagnostic diagnostic, out SuppressMessageInfo info)
Emit\EditAndContinue\EmitDifferenceResult.cs (1)
24internal EmitDifferenceResult(bool success, ImmutableArray<Diagnostic> diagnostics, EmitBaseline? baseline, ImmutableArray<MethodDefinitionHandle> updatedMethods, ImmutableArray<TypeDefinitionHandle> changedTypes)
MetadataReader\MetadataHelpers.cs (1)
979internal static void CheckAssemblyOrModuleName(string name, CommonMessageProvider messageProvider, int code, ArrayBuilder<Diagnostic> builder)
MetadataReference\PortableExecutableReference.cs (1)
186internal static Diagnostic ExceptionToDiagnostic(Exception e, CommonMessageProvider messageProvider, Location location, string display, MetadataImageKind kind)
ReferenceManager\CommonReferenceManager.Resolution.cs (3)
488Diagnostic? newDiagnostic = null; 530Debug.Assert(existing is Metadata || existing is Diagnostic); 535diagnostics.Add((Diagnostic)existing);
ReferenceManager\CommonReferenceManager.State.cs (3)
142private ImmutableArray<Diagnostic> _lazyDiagnostics; 205internal ImmutableArray<Diagnostic> Diagnostics 416ImmutableArray<Diagnostic> diagnostics,
RuleSet\RuleSet.cs (5)
288internal static ReportDiagnostic GetDiagnosticOptionsFromRulesetFile(string? rulesetFileFullPath, out Dictionary<string, ReportDiagnostic> diagnosticOptions, IList<Diagnostic>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt) 299private static ReportDiagnostic GetDiagnosticOptionsFromRulesetFile(Dictionary<string, ReportDiagnostic> diagnosticOptions, string resolvedPath, IList<Diagnostic>? diagnosticsOpt, CommonMessageProvider? messageProviderOpt) 317diagnosticsOpt.Add(Diagnostic.Create(messageProviderOpt, messageProviderOpt.ERR_CantReadRulesetFile, resolvedPath, e.Message)); 326diagnosticsOpt.Add(Diagnostic.Create(messageProviderOpt, messageProviderOpt.ERR_CantReadRulesetFile, resolvedPath, new CodeAnalysisResourcesLocalizableErrorArgument(nameof(CodeAnalysisResources.FileNotFound)))); 333diagnosticsOpt.Add(Diagnostic.Create(messageProviderOpt, messageProviderOpt.ERR_CantReadRulesetFile, resolvedPath, e.Message));
SourceGeneration\GeneratorContexts.cs (3)
95/// Adds a <see cref="Diagnostic"/> to the users compilation 105public void ReportDiagnostic(Diagnostic diagnostic) 111internal (ImmutableArray<GeneratedSourceText> sources, ImmutableArray<Diagnostic> diagnostics) ToImmutableAndFree()
SourceGeneration\GeneratorDriver.cs (10)
66public GeneratorDriver RunGeneratorsAndUpdateCompilation(Compilation compilation, out Compilation outputCompilation, out ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken = default) 388var diagnostic = CreateGeneratorExceptionDiagnostic(provider, generator, e, isInit); 389var filtered = compilation.Options.FilterDiagnostic(diagnostic, cancellationToken); 399private static Diagnostic CreateGeneratorExceptionDiagnostic(CommonMessageProvider provider, ISourceGenerator generator, Exception e, bool isInit) 416return Diagnostic.Create(descriptor, Location.None, generator.GetGeneratorType().Name, e.GetType().Name, e.Message, e.CreateDiagnosticDescription()); 419private static ImmutableArray<Diagnostic> FilterDiagnostics(Compilation compilation, ImmutableArray<Diagnostic> generatorDiagnostics, DiagnosticBag? driverDiagnostics, CancellationToken cancellationToken) 427ArrayBuilder<Diagnostic> filteredDiagnostics = ArrayBuilder<Diagnostic>.GetInstance(); 428foreach (var diag in generatorDiagnostics)
SourceGeneration\GeneratorState.cs (6)
25ImmutableArray<Diagnostic>.Empty, 40ImmutableArray<Diagnostic>.Empty, 54ImmutableArray<Diagnostic> diagnostics, 75ImmutableArray<Diagnostic> diagnostics, 93public GeneratorState WithError(Exception exception, Diagnostic error, TimeSpan elapsedTime) 121internal ImmutableArray<Diagnostic> Diagnostics { get; }
SourceGeneration\IncrementalContexts.cs (3)
171/// Adds a <see cref="Diagnostic"/> to the users compilation 181public void ReportDiagnostic(Diagnostic diagnostic) 266internal (ImmutableArray<GeneratedSourceText> sources, ImmutableArray<Diagnostic> diagnostics, GeneratorRunStateTable executedSteps, ImmutableDictionary<string, object> hostOutputs) ToImmutableAndFree()
SourceGeneration\Nodes\SourceOutputNode.cs (2)
12using TOutput = System.ValueTuple<System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.GeneratedSourceText>, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.Diagnostic>>; 94public IIncrementalGeneratorNode<(IEnumerable<GeneratedSourceText>, IEnumerable<Diagnostic>)> WithTrackingName(string name) => throw ExceptionUtilities.Unreachable();
SourceGeneration\RunResults.cs (6)
19private ImmutableArray<Diagnostic> _lazyDiagnostics; 40/// The <see cref="Diagnostic"/>s produced by all generators run during this generation pass. 45public ImmutableArray<Diagnostic> Diagnostics 84ImmutableArray<Diagnostic> diagnostics, 116/// A collection of <see cref="Diagnostic"/>s reported by <see cref="Generator"/> 122public ImmutableArray<Diagnostic> Diagnostics { get; }
StrongName\StrongNameKeys.cs (6)
36internal readonly Diagnostic? DiagnosticOpt; 69internal StrongNameKeys(Diagnostic diagnostic) 175var diagnostic = GetError(keyFilePath, keyContainerName, new CodeAnalysisResourcesLocalizableErrorArgument(nameof(CodeAnalysisResources.AssemblySigningNotSupported)), messageProvider); 204internal static Diagnostic GetError(string? keyFilePath, string? keyContainerName, object message, CommonMessageProvider messageProvider) 217internal static Diagnostic GetContainerError(CommonMessageProvider messageProvider, string name, object message) 222internal static Diagnostic GetKeyFileError(CommonMessageProvider messageProvider, string path, object message)
Syntax\SyntaxNode.cs (1)
702public IEnumerable<Diagnostic> GetDiagnostics()
Syntax\SyntaxNodeOrToken.cs (2)
465public IEnumerable<Diagnostic> GetDiagnostics() 477return SpecializedCollections.EmptyEnumerable<Diagnostic>();
Syntax\SyntaxToken.cs (5)
23private static readonly Func<DiagnosticInfo, Diagnostic> s_createDiagnosticWithoutLocation = Diagnostic.Create; 656public IEnumerable<Diagnostic> GetDiagnostics() 660return SpecializedCollections.EmptyEnumerable<Diagnostic>(); 670? SpecializedCollections.EmptyEnumerable<Diagnostic>()
Syntax\SyntaxTree.cs (5)
178public abstract IEnumerable<Diagnostic> GetDiagnostics(CancellationToken cancellationToken = default); 185public abstract IEnumerable<Diagnostic> GetDiagnostics(SyntaxNode node); 192public abstract IEnumerable<Diagnostic> GetDiagnostics(SyntaxToken token); 199public abstract IEnumerable<Diagnostic> GetDiagnostics(SyntaxTrivia trivia); 207public abstract IEnumerable<Diagnostic> GetDiagnostics(SyntaxNodeOrToken nodeOrToken);
Syntax\SyntaxTrivia.cs (1)
420public IEnumerable<Diagnostic> GetDiagnostics()
Microsoft.CodeAnalysis.CodeStyle (87)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
50context.ReportDiagnostic(Diagnostic.Create(Descriptor, location));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (2)
71context.ReportDiagnostic(Diagnostic.Create(s_missingHeaderDescriptor, fileHeader.GetLocation(tree))); 78context.ReportDiagnostic(Diagnostic.Create(s_invalidHeaderDescriptor, fileHeader.GetLocation(tree)));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
98context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (22)
22/// Creates a <see cref="Diagnostic"/> instance. 31/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 35/// can convey more detailed information to the fixer. If null, <see cref="Diagnostic.Properties"/> will return 39/// <returns>The <see cref="Diagnostic"/> instance.</returns> 40public static Diagnostic Create( 79/// <see cref="Diagnostic.AdditionalLocations"/>. 84/// <see cref="Diagnostic.AdditionalLocations"/>. 87/// <returns>The <see cref="Diagnostic"/> instance.</returns> 88public static Diagnostic CreateWithLocationTags( 107private static Diagnostic CreateWithLocationTags( 143/// <see cref="Diagnostic.AdditionalLocations"/>. 148/// <see cref="Diagnostic.AdditionalLocations"/>. 155/// <returns>The <see cref="Diagnostic"/> instance.</returns> 156public static Diagnostic CreateWithLocationTags( 177public static Diagnostic CreateWithLocationTags( 203private static Diagnostic CreateWithLocationTags( 237/// Creates a <see cref="Diagnostic"/> instance. 246/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 250/// can convey more detailed information to the fixer. If null, <see cref="Diagnostic.Properties"/> will return 254/// <returns>The <see cref="Diagnostic"/> instance.</returns> 255public static Diagnostic CreateWithMessage( 270return Diagnostic.Create(
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
127var diagnostic = DiagnosticHelper.Create(
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (3)
67var diagnostic = TryGetDiagnostic( 94var diagnostic = TryGetDiagnostic( 111private Diagnostic? TryGetDiagnostic(
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
74var diagnostic = Diagnostic.Create(
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
112context.ReportDiagnostic(Diagnostic.Create(Descriptor,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (3)
45var diagnostic = TryRemoveCastExpression( 56private Diagnostic? TryRemoveCastExpression(SemanticModel model, TCastExpression node, CancellationToken cancellationToken) 71return Diagnostic.Create(
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
108foreach (var diagnostic in diagnostics) 137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None)); 193private static IEnumerable<Diagnostic> CreateClassificationDiagnostics( 204yield return Diagnostic.Create(descriptor, tree.GetLocation(span)); 211private IEnumerable<Diagnostic> CreateFixableDiagnostics( 217yield return Diagnostic.Create(s_fixableIdDescriptor, tree.GetLocation(span));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (4)
74public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 83reportDiagnostic(Diagnostic.Create(s_invalidScopeDescriptor, attributeSyntax.GetLocation())); 90reportDiagnostic(Diagnostic.Create(s_invalidOrMissingTargetDescriptor, attributeSyntax.GetLocation())); 113reportDiagnostic(Diagnostic.Create(LegacyFormatTargetDescriptor, targetValueOperation.Syntax.GetLocation(), properties!, targetSymbolString));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (20)
89Action<Diagnostic> reportDiagnostic, 389private static async Task<(ImmutableArray<Diagnostic> reportedDiagnostics, ImmutableArray<string> unhandledIds)> GetReportedDiagnosticsForIdsAsync( 450using var _3 = ArrayBuilder<Diagnostic>.GetInstance(out var reportedDiagnostics); 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics) 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 495foreach (var diagnostic in perAnalyzerDiagnostics) 507ImmutableArray<Diagnostic> diagnostics, 516foreach (var diagnostic in diagnostics) 544Diagnostic diagnostic, 584Diagnostic diagnostic, 612Action<Diagnostic> reportDiagnostic, 616using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder); 622foreach (var diagnostic in effectiveDiagnostics) 630ArrayBuilder<Diagnostic> diagnosticsBuilder, 655var diagnostic = Diagnostic.Create(s_removeUnnecessarySuppressionDescriptor, pragma.GetLocation(), severity, additionalLocations, properties: null); 662ArrayBuilder<Diagnostic> diagnosticsBuilder, 670var diagnostic = Diagnostic.Create(s_removeUnnecessarySuppressionDescriptor, attribute.GetLocation(), severity, additionalLocations: null, properties: null);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
294public static bool TryGetUnusedValuePreference(Diagnostic diagnostic, out UnusedValuePreference preference) 315public static bool GetIsUnusedLocalDiagnostic(Diagnostic diagnostic) 321public static bool GetIsRemovableAssignmentDiagnostic(Diagnostic diagnostic)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
215var diagnostic = DiagnosticHelper.Create(s_expressionValueIsUnusedRule, 573var diagnostic = DiagnosticHelper.Create(s_valueAssignedIsUnusedRule,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
122Action<Diagnostic> reportDiagnostic, 146var diagnostic = DiagnosticHelper.CreateWithMessage(s_unusedParameterRule, location,
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
152context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (7)
111protected abstract ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root); 112protected abstract ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree); 114public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken) 135internal static Diagnostic CreateDiagnostic(SemanticModel model, TSimplifierOptions options, AnalyzerOptions analyzerOptions, TextSpan issueSpan, string diagnosticId, bool inDeclaration) 167var diagnostic = DiagnosticHelper.Create(descriptor, tree.GetLocation(issueSpan), notificationOption, analyzerOptions, additionalLocations: null, builder.ToImmutable()); 244foreach (var diagnostic in diagnostics) 297foreach (var diagnostic in diagnostics)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
671context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
99public static bool ChangesSemantics(Diagnostic diagnostic)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
357var diagnostic = Diagnostic.Create(
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
11internal static bool HasAnyErrors<T>(this ImmutableArray<T> diagnostics) where T : Diagnostic
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
27Action<Diagnostic> reportDiagnostic,
Microsoft.CodeAnalysis.CodeStyle.Fixes (165)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (3)
28var diagnostic = context.Diagnostics.First(); 44Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (5)
38var diagnostic = context.Diagnostics[0]; 54Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 84Document document, ImmutableArray<Diagnostic> diagnostics, 92foreach (var diagnostic in diagnostics) 101Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
70var diagnostic = context.Diagnostics.First(); 214ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
72Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
55var diagnostic = context.Diagnostics.First(); 99SyntaxNode initialNode, SyntaxNode node, Diagnostic diagnostic)
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (4)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 32var firstDiagnostic = context.Diagnostics[0]; 43Document document, ImmutableArray<Diagnostic> diagnostics, 48foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
392Document document, ImmutableArray<Diagnostic> diagnostics, 413foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (4)
20protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 38var diagnostic = context.Diagnostics.FirstOrDefault(); 62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
33foreach (var diagnostic in context.Diagnostics)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (3)
40protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 44Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (3)
43foreach (var diagnostic in context.Diagnostics) 62private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 80protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
24var diagnostic = context.Diagnostics.FirstOrDefault();
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (3)
28protected abstract bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic); 39var diagnostic = context.Diagnostics.First(); 63TextSpan span, Diagnostic diagnostic)
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 34var diagnostic = context.Diagnostics.FirstOrDefault();
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
40ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (4)
20protected abstract bool IsSupportedDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken); 36var diagnostic = context.Diagnostics.First(); 104Diagnostic diagnostic, 147private SyntaxNode? GetContainingFunction(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (2)
29protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 35foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (3)
51static async Task<ImmutableArray<Diagnostic>> GetSolutionDiagnosticsAsync(FixAllContext fixAllContext) 53var diagnostics = ImmutableArray.CreateBuilder<Diagnostic>(); 67ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
48var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (3)
32var diagnostic = context.Diagnostics.First(); 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (4)
32var diagnostic = context.Diagnostics.First(); 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 62foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (7)
57var diagnostic = context.Diagnostics.First(); 105Document document, Diagnostic diagnostic, 114Document document, ImmutableArray<Diagnostic> diagnostics, 124Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 128foreach (var diagnostic in diagnostics) 137Document document, SyntaxEditor editor, Diagnostic diagnostic, 221ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (3)
23protected abstract TSimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken); 36Document document, ImmutableArray<Diagnostic> diagnostics, 41foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (3)
36var diagnostic = context.Diagnostics.First(); 64Document document, ImmutableArray<Diagnostic> diagnostics, 75foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (3)
30foreach (var diagnostic in context.Diagnostics) 40protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 42foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (3)
36foreach (var diagnostic in context.Diagnostics) 47protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 56foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
44ImmutableArray<Diagnostic> diagnostics, 54foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (17)
135var diagnostic = context.Diagnostics[0]; 204private static bool IsForEachIterationVariableDiagnostic(Diagnostic diagnostic, Document document, CancellationToken cancellationToken) 215private static string GetEquivalenceKey(Diagnostic diagnostic) 234protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 240private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 241ImmutableArray<Diagnostic> diagnostics, 253foreach (var diagnostic in diagnostics) 265private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 266ImmutableArray<Diagnostic> diagnostics, 273private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 285protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 296ImmutableArray<Diagnostic> diagnostics, 347IEnumerable<Diagnostic> diagnostics, 384IOrderedEnumerable<Diagnostic> diagnostics, 400foreach (var diagnostic in diagnostics) 443IOrderedEnumerable<Diagnostic> diagnostics, 676foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
39ImmutableArray<Diagnostic> diagnostics, 61SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (2)
50Document document, ImmutableArray<Diagnostic> diagnostics, 58foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
35ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics.OrderByDescending(diagnostics => diagnostics.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (3)
31foreach (var diagnostic in context.Diagnostics) 41protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 43foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
21public abstract string SuggestedVersion(ImmutableArray<Diagnostic> diagnostics);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (3)
28protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 38Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (4)
29protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 39Document document, ImmutableArray<Diagnostic> diagnostics, 47foreach (var diagnostic in diagnostics) 60Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, 59foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
41Document document, Diagnostic diagnostic, 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 57foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
59Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
48Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (2)
32Document document, ImmutableArray<Diagnostic> diagnostics, 37foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (4)
32private static bool IsSupportedDiagnostic(Diagnostic diagnostic) 37var diagnostic = context.Diagnostics.First(); 51Document document, ImmutableArray<Diagnostic> diagnostics, 59foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (5)
59protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 69Document document, ImmutableArray<Diagnostic> diagnostics, 75foreach (var diagnostic in diagnostics) 93Diagnostic diagnostic, 142Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
36Document document, ImmutableArray<Diagnostic> diagnostics, 54foreach (var diagnostic in diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (2)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (7)
35/// cref="Diagnostic.Properties"/> for that diagnostic. The diagnostic itself is not passed along as it was 36/// computed with respect to the original user document, and as such its <see cref="Diagnostic.Location"/> and <see 37/// cref="Diagnostic.AdditionalLocations"/> will not be correct. 46protected sealed override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 59ImmutableArray<Diagnostic> diagnostics, 65using var _ = ArrayBuilder<(TDiagnosticNode diagnosticNode, Diagnostic diagnostic)>.GetInstance(out var originalNodes); 66foreach (var diagnostic in diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (9)
48protected void RegisterCodeFix(CodeFixContext context, string title, string equivalenceKey, Diagnostic? diagnostic = null) 51protected void RegisterCodeFix(CodeFixContext context, string title, string equivalenceKey, CodeActionPriority priority, Diagnostic? diagnostic = null) 54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 61Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 89Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 97/// This overload differs from <see cref="IncludeDiagnosticDuringFixAll(Diagnostic)"/> in that it also passes along 103protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 115/// cref="IFixAllState.CodeActionEquivalenceKey"/>), then <see cref="IncludeDiagnosticDuringFixAll(Diagnostic, 120protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
175public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
48public static string? TryGetAnalyzerConfigPathForDiagnosticConfiguration(this Project project, Diagnostic diagnostic) 54private static string? TryGetAnalyzerConfigPathForProjectOrDiagnosticConfiguration(Project project, Diagnostic? diagnostic)
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (8)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpCodeFixVerifier`2+Test.cs (4)
80public Func<ImmutableArray<Diagnostic>, Diagnostic?>? DiagnosticSelector { get; set; } 107protected override Diagnostic? TrySelectDiagnosticToFix(ImmutableArray<Diagnostic> fixableDiagnostics)
src\Features\DiagnosticsTestUtilities\CodeActions\VisualBasicCodeFixVerifier`2+Test.cs (4)
73public Func<ImmutableArray<Diagnostic>, Diagnostic?>? DiagnosticSelector { get; set; } 92protected override Diagnostic? TrySelectDiagnosticToFix(ImmutableArray<Diagnostic> fixableDiagnostics)
Microsoft.CodeAnalysis.CSharp (161)
Binder\Binder_Crefs.cs (1)
1005foreach (Diagnostic diag in unusedDiagnostics.AsEnumerable())
Binder\Binder_Invocation.cs (1)
1843foreach (Diagnostic d in typeOrValue.Data.ValueDiagnostics.Diagnostics)
Binder\SwitchBinder.cs (1)
25private ImmutableArray<Diagnostic> _switchGoverningDiagnostics;
BoundTree\UnboundLambda.cs (9)
1315FirstAmongEqualsSet<Diagnostic>? intersection = null; 1337FirstAmongEqualsSet<Diagnostic>? union = null; 1363private static bool PreventsSuccessfulDelegateConversion(FirstAmongEqualsSet<Diagnostic> set) 1365foreach (var diagnostic in set) 1375private static FirstAmongEqualsSet<Diagnostic> CreateFirstAmongEqualsSet(ImmutableArray<Diagnostic> bag) 1381return new FirstAmongEqualsSet<Diagnostic>( 1393private static int CanonicallyCompareDiagnostics(Diagnostic x, Diagnostic y)
CommandLine\CSharpCommandLineParser.cs (27)
54List<Diagnostic> diagnostics = new List<Diagnostic>(); 121int warningLevel = Diagnostic.DefaultWarningLevel; 352IEnumerable<Diagnostic> defineDiagnostics; 1599private static void ParseAndResolveReferencePaths(string? switchName, ReadOnlyMemory<char>? switchValue, string? baseDirectory, List<string> builder, MessageID origin, List<Diagnostic> diagnostics) 1626private static string? GetWin32Setting(string arg, string? value, List<Diagnostic> diagnostics) 1649List<Diagnostic> diagnostics, 1748public static IEnumerable<string> ParseConditionalCompilationSymbols(string value, out IEnumerable<Diagnostic> diagnostics) 1755internal static void ParseConditionalCompilationSymbols(ReadOnlyMemory<char> valueMemory, ArrayBuilder<string> defines, out IEnumerable<Diagnostic> diagnostics) 1761outputDiagnostics.Add(Diagnostic.Create(CSharp.MessageProvider.Instance, (int)ErrorCode.WRN_DefineIdentifierRequired, valueMemory.ToString())); 1793outputDiagnostics.Add(Diagnostic.Create(CSharp.MessageProvider.Instance, (int)ErrorCode.WRN_DefineIdentifierRequired, id)); 1800private static Platform ParsePlatform(string value, IList<Diagnostic> diagnostics) 1824private static OutputKind ParseTarget(string value, IList<Diagnostic> diagnostics) 1852private static IEnumerable<string> ParseUsings(string arg, string? value, IList<Diagnostic> diagnostics) 1866private static void ParseAnalyzers(string arg, ReadOnlyMemory<char>? valueMemory, List<CommandLineAnalyzerReference> analyzerReferences, List<Diagnostic> diagnostics) 1893private static void ParseAssemblyReferences(string arg, ReadOnlyMemory<char>? valueMemory, IList<Diagnostic> diagnostics, bool embedInteropTypes, List<CommandLineReference> commandLineReferences) 1977private static void ValidateWin32Settings(string? win32ResourceFile, string? win32IconResourceFile, string? win32ManifestFile, OutputKind outputKind, IList<Diagnostic> diagnostics) 1998private static IEnumerable<InstrumentationKind> ParseInstrumentationKinds(string value, IList<Diagnostic> diagnostics) 2020IList<Diagnostic> diagnostics, 2028IList<Diagnostic> diagnostics, 2153private static void UnimplementedSwitch(IList<Diagnostic> diagnostics, string switchName) 2158internal override void GenerateErrorForNoFilesFoundInRecurse(string path, IList<Diagnostic> diagnostics) 2163private static void AddDiagnostic(IList<Diagnostic> diagnostics, ErrorCode errorCode) 2165diagnostics.Add(Diagnostic.Create(CSharp.MessageProvider.Instance, (int)errorCode)); 2168private static void AddDiagnostic(IList<Diagnostic> diagnostics, ErrorCode errorCode, params object[] arguments) 2170diagnostics.Add(Diagnostic.Create(CSharp.MessageProvider.Instance, (int)errorCode, arguments)); 2176private static void AddDiagnostic(IList<Diagnostic> diagnostics, Dictionary<string, ReportDiagnostic> warningOptions, ErrorCode errorCode, params object[] arguments)
CommandLine\CSharpCompiler.cs (2)
381private protected override void DiagnoseBadAccesses(TextWriter consoleOutput, ErrorLogger? errorLogger, Compilation compilation, ImmutableArray<Diagnostic> diagnostics) 384foreach (var diag in diagnostics)
Compilation\CSharpCompilation.cs (20)
74private ImmutableArray<Diagnostic> _lazyClsComplianceDiagnostics; 2865public override ImmutableArray<Diagnostic> GetParseDiagnostics(CancellationToken cancellationToken = default) 2874public override ImmutableArray<Diagnostic> GetDeclarationDiagnostics(CancellationToken cancellationToken = default) 2882public override ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(CancellationToken cancellationToken = default) 2891public override ImmutableArray<Diagnostic> GetDiagnostics(CancellationToken cancellationToken = default) 2896internal ImmutableArray<Diagnostic> GetDiagnostics(CompilationStage stage, bool includeEarlierStages, Predicate<ISymbolInternal>? symbolFilter, CancellationToken cancellationToken) 2958foreach (var error in syntaxTree.Options.Errors) 3005private static void AppendLoadDirectiveDiagnostics(DiagnosticBag builder, SyntaxAndDeclarationManager syntaxAndDeclarations, SyntaxTree syntaxTree, Func<IEnumerable<Diagnostic>, IEnumerable<Diagnostic>>? locationFilterOpt = null) 3013IEnumerable<Diagnostic> diagnostics = directive.Diagnostics; 3067private ImmutableArray<Diagnostic> GetDiagnosticsForMethodBodiesInTree(SyntaxTree tree, TextSpan? span, CancellationToken cancellationToken) 3199private ReadOnlyBindingDiagnostic<AssemblySymbol> GetSourceDeclarationDiagnostics(SyntaxTree? syntaxTree = null, TextSpan? filterSpanWithinTree = null, Func<IEnumerable<Diagnostic>, SyntaxTree, TextSpan?, IEnumerable<Diagnostic>>? locationFilterOpt = null, Predicate<Symbol>? symbolFilter = null, CancellationToken cancellationToken = default) 3226var result = _lazyDeclarationDiagnostics?.AsEnumerable() ?? Enumerable.Empty<Diagnostic>(); 3271private static IEnumerable<Diagnostic> FilterDiagnosticsByLocation(IEnumerable<Diagnostic> diagnostics, SyntaxTree tree, TextSpan? filterSpanWithinTree) 3273foreach (var diagnostic in diagnostics) 3282internal ImmutableArray<Diagnostic> GetDiagnosticsForSyntaxTree( 3320IEnumerable<Diagnostic> methodBodyDiagnostics = GetDiagnosticsForMethodBodiesInTree(syntaxTree, filterSpanWithinTree, cancellationToken); 3334return result.ToReadOnlyAndFree<Diagnostic>();
Compilation\CSharpDiagnosticFilter.cs (5)
16/// Applies C#-specific modification and filtering of <see cref="Diagnostic"/>s. 25/// Modifies an input <see cref="Diagnostic"/> per the given options. For example, the 26/// severity may be escalated, or the <see cref="Diagnostic"/> may be filtered out entirely 35internal static Diagnostic? Filter( 36Diagnostic d,
Compilation\MemberSemanticModel.cs (4)
571public sealed override ImmutableArray<Diagnostic> GetSyntaxDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 576public sealed override ImmutableArray<Diagnostic> GetDeclarationDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 581public sealed override ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 586public sealed override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (4)
235public override ImmutableArray<Diagnostic> GetSyntaxDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 240public override ImmutableArray<Diagnostic> GetDeclarationDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 245public override ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 250public override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (4)
114public override ImmutableArray<Diagnostic> GetSyntaxDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 121public override ImmutableArray<Diagnostic> GetDeclarationDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 128public override ImmutableArray<Diagnostic> GetMethodBodyDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken)) 135public override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Compiler\DocumentationCommentCompiler.cs (1)
745foreach (Diagnostic diag in node.GetDiagnostics())
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (2)
640foreach (Diagnostic diagnostic in CSharpSyntaxTree.Dummy.GetDiagnostics(treelessSyntax)) 656foreach (Diagnostic diagnostic in bindingDiagnostics.DiagnosticBag.AsEnumerable())
Compiler\MethodCompiler.cs (1)
900sourceMethod.SetDiagnostics(ImmutableArray<Diagnostic>.Empty, out diagsWritten);
CSharpCompilationOptions.cs (14)
64int warningLevel = Diagnostic.DefaultWarningLevel, 662internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder) 671builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_NoMainOnDLL)); 676builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(MainTypeName), MainTypeName)); 682builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadPlatformType, Platform.ToString())); 692builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(OutputKind), OutputKind.ToString())); 697builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(OptimizationLevel), OptimizationLevel.ToString())); 702builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(ScriptClassName), ScriptClassName ?? "null")); 707builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(WarningLevel), WarningLevel)); 712builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(Usings), Usings.Where(u => !u.IsValidClrNamespaceName()).First() ?? "null")); 717builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadPrefer32OnLib)); 722builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadCompilationOptionValue, nameof(MetadataImportOptions), MetadataImportOptions.ToString())); 761internal override Diagnostic? FilterDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken)
CSharpParseOptions.cs (4)
233internal override void ValidateOptions(ArrayBuilder<Diagnostic> builder) 240builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_BadLanguageVersion, LanguageVersion.ToString())); 249builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_InvalidPreprocessingSymbol, "null")); 253builder.Add(Diagnostic.Create(MessageProvider.Instance, (int)ErrorCode.ERR_InvalidPreprocessingSymbol, symbol));
Declarations\DeclarationTreeBuilder.cs (6)
190var diagnostics = ImmutableArray<Diagnostic>.Empty; 228diagnostics: ImmutableArray<Diagnostic>.Empty, 232private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatementSyntax firstGlobalStatement, bool hasAwaitExpressions, bool isIterator, bool hasReturnWithExpression, ImmutableArray<Diagnostic> diagnostics) 343diagnostics: ImmutableArray<Diagnostic>.Empty, 355diagnostics: ImmutableArray<Diagnostic>.Empty); 516diagnostics: ImmutableArray<Diagnostic>.Empty);
Declarations\RootSingleNamespaceDeclaration.cs (1)
35ImmutableArray<Diagnostic> diagnostics,
Declarations\SingleNamespaceDeclaration.cs (2)
20ImmutableArray<Diagnostic> diagnostics) 70ImmutableArray<Diagnostic> diagnostics)
Declarations\SingleNamespaceDeclarationEx.cs (1)
20ImmutableArray<Diagnostic> diagnostics)
Declarations\SingleNamespaceOrTypeDeclaration.cs (2)
21public readonly ImmutableArray<Diagnostic> Diagnostics; 27ImmutableArray<Diagnostic> diagnostics)
Declarations\SingleTypeDeclaration.cs (1)
82ImmutableArray<Diagnostic> diagnostics,
Errors\CSDiagnostic.cs (3)
26internal override Diagnostic WithLocation(Location location) 41internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 52internal override Diagnostic WithIsSuppressed(bool isSuppressed)
Errors\CSharpDiagnosticFormatter.cs (1)
15internal override bool HasDefaultHelpLinkUri(Diagnostic diagnostic)
Errors\ErrorFacts.cs (5)
178return Diagnostic.CompilerDiagnosticCategory; 206return Diagnostic.InfoAndHiddenWarningLevel; 2521foreach (Diagnostic diag in diagnostics.AsEnumerable()) // Checking the code would have resolved them anyway. 2532internal static bool PreventsSuccessfulDelegateConversion(ImmutableArray<Diagnostic> diagnostics) 2534foreach (var diag in diagnostics)
Errors\MessageProvider.cs (2)
87public override Diagnostic CreateDiagnostic(int code, Location location, params object[] args) 93public override Diagnostic CreateDiagnostic(DiagnosticInfo info)
FlowAnalysis\DefiniteAssignment.cs (6)
584HashSet<Diagnostic> compatDiagnosticSet = new HashSet<Diagnostic>(compatDiagnostics.AsEnumerable(), SameDiagnosticComparer.Instance); 669private sealed class SameDiagnosticComparer : EqualityComparer<Diagnostic> 672public override bool Equals(Diagnostic x, Diagnostic y) => x.Equals(y); 673public override int GetHashCode(Diagnostic obj) =>
FlowAnalysis\FlowAnalysisPass.cs (2)
90IEnumerable<Diagnostic> getErrorsOnly(IEnumerable<Diagnostic> diags) => diags.Where(d => d.Severity == DiagnosticSeverity.Error);
Lowering\SyntheticBoundNodeFactory.cs (2)
36public MissingPredefinedMember(Diagnostic error) : base(error.ToString()) 41public Diagnostic Diagnostic { get; }
Symbols\Source\SourceAssemblySymbol.cs (2)
113private ImmutableArray<Diagnostic> _unusedFieldWarnings; 2664internal ImmutableArray<Diagnostic> GetUnusedFieldWarnings(CancellationToken cancellationToken)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (2)
168Diagnostic diag = new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.ERR_DuplicateExplicitImpl, interfaceMember), this.GetFirstLocation()); 1795foreach (Diagnostic diagnostic in implementingMemberAndDiagnostics.Diagnostics.Diagnostics)
Symbols\Source\SourceMemberMethodSymbol.cs (4)
307private ImmutableArray<Diagnostic> _cachedDiagnostics; 308internal ImmutableArray<Diagnostic> Diagnostics 313internal ImmutableArray<Diagnostic> SetDiagnostics(ImmutableArray<Diagnostic> newSet, out bool diagsWritten)
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (4)
1086public static readonly ExternAliasesAndDiagnostics Empty = new ExternAliasesAndDiagnostics() { ExternAliases = ImmutableArray<AliasAndExternAliasDirective>.Empty, Diagnostics = ImmutableArray<Diagnostic>.Empty }; 1089public ImmutableArray<Diagnostic> Diagnostics { get; init; } 1124Diagnostics = ImmutableArray<Diagnostic>.Empty, 1130public ImmutableArray<Diagnostic> Diagnostics { get; init; }
Symbols\Symbol_Attributes.cs (3)
486var toRemove = new HashSet<Diagnostic>(ReferenceEqualityComparer.Instance); 489foreach (Diagnostic d in diagnostics.DiagnosticBag.AsEnumerableWithoutResolution()) 514foreach (Diagnostic d in diagnostics.DiagnosticBag.AsEnumerableWithoutResolution())
Syntax\CSharpSyntaxNode.cs (1)
215public new IEnumerable<Diagnostic> GetDiagnostics()
Syntax\CSharpSyntaxTree.cs (8)
774public override IEnumerable<Diagnostic> GetDiagnostics(SyntaxNode node) 784private IEnumerable<Diagnostic> GetDiagnostics(GreenNode greenNode, int position) 796return SpecializedCollections.EmptyEnumerable<Diagnostic>(); 799private IEnumerable<Diagnostic> EnumerateDiagnostics(GreenNode node, int position) 815public override IEnumerable<Diagnostic> GetDiagnostics(SyntaxToken token) 831public override IEnumerable<Diagnostic> GetDiagnostics(SyntaxTrivia trivia) 848public override IEnumerable<Diagnostic> GetDiagnostics(SyntaxNodeOrToken nodeOrToken) 864public override IEnumerable<Diagnostic> GetDiagnostics(CancellationToken cancellationToken = default)
Syntax\SyntaxFactory.cs (1)
2393foreach (var error in token.GetDiagnostics())
Syntax\SyntaxTreeDiagnosticEnumerator.cs (2)
18private Diagnostic? _current; 109public Diagnostic Current
Microsoft.CodeAnalysis.CSharp.CodeStyle (25)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
36var diagnostic = AnalyzeNamespace(context, namespaceDeclaration); 41private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, FileScopedNamespaceDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
40var diagnostic = AnalyzeNamespace(context, root, namespaceDeclaration); 45private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, CompilationUnitSyntax root, BaseNamespaceDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
52Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (2)
113var diagnostic = Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
46var methodToDiagnostic = PooledDictionary<IMethodSymbol, Diagnostic>.GetInstance(); 102SymbolAnalysisContext context, ReportDiagnostic severity, PooledDictionary<IMethodSymbol, Diagnostic> methodToDiagnostic) 135Dictionary<IMethodSymbol, Diagnostic> methodToDiagnostic)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
97context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
103context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (5)
89private ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, int positionOfFirstReducingNullableDirective, TextSpanMutableIntervalTree? codeBlockIntervalTree, TextSpanMutableIntervalTree? possibleNullableImpactIntervalTree) 103using var diagnostics = TemporaryArray<Diagnostic>.Empty; 129diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 161diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 318foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
61foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
89private Diagnostic? AnalyzeSyntax(
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
63var diagnostic = AnalyzeSyntax(context.SemanticModel, option, declaration, context.Options, context.CancellationToken); 70private static Diagnostic? AnalyzeSyntax(
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
67private static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
248private Diagnostic CreateDiagnostic(Result result, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
44public static bool IsSafe(Diagnostic diagnostic)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
33foreach (var diagnostic in diagnostics)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (176)
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
32Document document, ImmutableArray<Diagnostic> diagnostics, 36foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (3)
47foreach (var diagnostic in context.Diagnostics) 79protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 83foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
96Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 136Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
38var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 52Document document, ImmutableArray<Diagnostic> diagnostics, 55var diagnostic = diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (2)
52Document document, ImmutableArray<Diagnostic> diagnostics, 56foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (2)
31Diagnostic diagnostic, 46Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (4)
40var diagnostic = context.Diagnostics.First(); 51SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken, 133Document document, ImmutableArray<Diagnostic> diagnostics, 139foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (4)
31Diagnostic diagnostic, 67var diagnostic = context.Diagnostics.First(); 77Document document, ImmutableArray<Diagnostic> diagnostics, 83foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 127protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
50protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
38protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
35protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
54protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
40protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
45Document document, ImmutableArray<Diagnostic> diagnostics, 53foreach (var diagnostic in diagnostics) 79Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (6)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 45Document document, ImmutableArray<Diagnostic> diagnostics, 48foreach (var diagnostic in diagnostics) 58SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken) 73Diagnostic diagnostic, 117SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (2)
38protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
33var diagnostic = context.Diagnostics.First(); 52protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 64ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
107protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 113foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
38protected override bool IsSupportedDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 48Document document, ImmutableArray<Diagnostic> diagnostics, 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
36ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
38ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
35ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
72foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
34var diagnostic = context.Diagnostics.First(); 44private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 47public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 53foreach (var diagnostic in diagnostics) 64Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
33var diagnostic = context.Diagnostics.First(); 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 50foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (4)
36var diagnostic = context.Diagnostics.First(); 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 55foreach (var diagnostic in diagnostics) 63Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
76ImmutableArray<Diagnostic> diagnostics, 85foreach (var diagnostic in diagnostics) 93protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\QualifyMemberAccess\CSharpQualifyMemberAccessCodeFixProvider.cs (1)
21protected override SimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (2)
58Document document, ImmutableArray<Diagnostic> diagnostics, 67foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
35var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (2)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (2)
38foreach (var diagnostic in context.Diagnostics) 51ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (5)
29var diagnostic = context.Diagnostics[0]; 44protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 47private static bool IsSubsequentSection(Diagnostic diagnostic) 52ImmutableArray<Diagnostic> diagnostics, 56foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (4)
30Diagnostic diagnostic, CancellationToken cancellationToken, [NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 85var diagnostic = context.Diagnostics.First(); 96Document document, ImmutableArray<Diagnostic> diagnostics, 99foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (3)
65public override string SuggestedVersion(ImmutableArray<Diagnostic> diagnostics) 68private static LanguageVersion RequiredVersion(ImmutableArray<Diagnostic> diagnostics) 71foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
41Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (5)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 41var diagnostic = context.Diagnostics.First(); 54Document document, ImmutableArray<Diagnostic> diagnostics, 60foreach (var diagnostic in diagnostics) 76SemanticModel semanticModel, SyntaxEditor editor, Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (6)
30var diagnostic = context.Diagnostics[0]; 42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 45private static async Task FixAllImplAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 48foreach (var diagnostic in diagnostics) 55private static Task<Document> FixWithSyntaxEditorAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 61Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
41Document document, ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
33Document document, ImmutableArray<Diagnostic> diagnostics, 38foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (2)
36Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
46Document document, ImmutableArray<Diagnostic> diagnostics, 80private static InvocationExpressionSyntax GetInvocationExpression(Diagnostic d, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (3)
36Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics) 50Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (4)
34private static bool IsSupportedDiagnostic(Diagnostic diagnostic) 39var diagnostic = context.Diagnostics.First(); 54Document document, ImmutableArray<Diagnostic> diagnostics, 57foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (2)
39Document document, ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (3)
42protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 52Document document, ImmutableArray<Diagnostic> diagnostics, 64foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (2)
38ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (4)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 60var diagnostic = context.Diagnostics.First(); 73Document document, ImmutableArray<Diagnostic> diagnostics, 77foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 43foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start)) 49private static void FixOne(SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 51foreach (var diagnostic in diagnostics) 85Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (3)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics) 51Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (3)
35Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics) 49Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
54foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
45foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (3)
30protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 40Document document, ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (3)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics) 47SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 43foreach (var diagnostic in diagnostics) 50SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (3)
43Document document, ImmutableArray<Diagnostic> diagnostics, 52foreach (var diagnostic in diagnostics) 91private static IArrayCreationOperation GetArrayCreationOperation(SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (9)
CommandLineTests.cs (9)
917var diags = new List<Diagnostic>(); 1924IEnumerable<Diagnostic> diagnostics; 2731ImmutableArray<Diagnostic> parseRef(string refText) 6487var diagnostics = new List<Diagnostic>(); 15789context.ReportDiagnostic(Diagnostic.Create(Hidden01, context.Node.GetLocation())); 15815context.ReportDiagnostic(Diagnostic.Create(Info01, context.Node.GetLocation())); 15843symbolContext.ReportDiagnostic(Diagnostic.Create(Warning01, symbolContext.Symbol.Locations.First())); 15860symbolContext.ReportDiagnostic(Diagnostic.Create(Warning02, symbolContext.Symbol.Locations.First())); 15887nodeContext.ReportDiagnostic(Diagnostic.Create(Error01, nodeContext.Node.GetLocation()));
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
StringCopyPaste\StringCopyPasteHelpers.cs (4)
43using var _ = PooledHashSet<Diagnostic>.GetInstance(out var errors); 44foreach (var diagnostic in interpolatedString.GetDiagnostics()) 55foreach (var diagnostic in text.GetDiagnostics()) 68foreach (var diagnostic in nodeOrToken.GetDiagnostics())
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (12)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (8)
236=> context.ReportDiagnostic(Diagnostic.Create(s_syntaxDiagnosticDescriptor, context.Tree.GetRoot().GetFirstToken().GetLocation())); 280var diagnostics = compilerEngineCompilation.GetAnalyzerDiagnostics([analyzer]); 326context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Node.GetLocation())); 340var diagnostics = compilerEngineCompilation.GetAnalyzerDiagnostics([analyzer]); 355=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.Create(context.Tree, TextSpan.FromBounds(1000, 2000)))); 886var diagnostic = Diagnostic.Create(descriptor, context.Symbol.Locations[0]); 939foreach (var diagnostic in context.ReportedDiagnostics)
Diagnostics\FixAllProvider\BatchFixerTests.cs (2)
54var diagnostic = Diagnostic.Create(Descriptor, node.GetLocation());
Formatting\CodeCleanupTests.TestFixers.cs (1)
25foreach (var diagnostic in context.Diagnostics)
Semantics\SpeculationAnalyzerTests.cs (1)
539static bool isProblem(Diagnostic d) => d.Severity >= DiagnosticSeverity.Warning;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (4)
CodeGen\CodeGenOperators.cs (1)
5417var diagnostics = ImmutableArray<Diagnostic>.Empty;
Emit\CompilationEmitTests.cs (1)
5214var err = result.Diagnostics.Single();
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (2)
2450ImmutableArray<Diagnostic> diagnostics = CreateEmptyCompilation(source + InstrumentationHelperSource).GetEmitDiagnostics(EmitOptions.Default.WithInstrumentationKinds(ImmutableArray.Create(InstrumentationKind.TestCoverage))); 2451foreach (Diagnostic diagnostic in diagnostics)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (131)
Attributes\AttributeTests_WellKnownAttributes.cs (15)
8297var diag = diags.Single(); 8330var diag = diags.Single(); 8361var diag = diags.Single(); 8392var diag = diags.Single(); 8463var diag = diags.Single(); 8511var diag = diags.Last(); 8708var diag = diags.Single(); 8751var diag = diags.Single(); 8853var diag = diags.Single(); 8955var diag = diags.Single(); 9138var diag = diags.Single(); 9189var diag = diags.Single(); 9330var diag = diags.Single(); 9468var diag = diags.Single(); 9518var diag = diags.Single();
Attributes\InternalsVisibleToAndStrongNameTests.cs (2)
399var err = other.GetDiagnostics().Single(); 1611var err = other.GetDiagnostics().Single();
Diagnostics\DiagnosticAnalyzerTests.cs (64)
58context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_CA9999_UseOfVariableThatStartsWithX, id.Location, id.Identifier.ValueText)); 254var diag1 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "Attribute"); 259var diag2 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "ClassDeclaration"); 264var diag3 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Node.GetLocation(), "UsingDirective"); 272var diag1 = CodeAnalysis.Diagnostic.Create(s_descriptor, context.Symbol.Locations[0], "NamedType"); 308var noneDiag = CodeAnalysis.Diagnostic.Create(noneDiagDescriptor, Location.None); 309var infoDiag = CodeAnalysis.Diagnostic.Create(infoDiagDescriptor, Location.None); 310var warningDiag = CodeAnalysis.Diagnostic.Create(warningDiagDescriptor, Location.None); 311var errorDiag = CodeAnalysis.Diagnostic.Create(errorDiagDescriptor, Location.None); 325foreach (var effectiveDiag in effectiveDiags) 354foreach (var effectiveDiag in effectiveDiags) 392var noneDiag = Microsoft.CodeAnalysis.Diagnostic.Create(noneDiagDescriptor, Location.None); 393var infoDiag = Microsoft.CodeAnalysis.Diagnostic.Create(infoDiagDescriptor, Location.None); 394var warningDiag = Microsoft.CodeAnalysis.Diagnostic.Create(warningDiagDescriptor, Location.None); 395var errorDiag = Microsoft.CodeAnalysis.Diagnostic.Create(errorDiagDescriptor, Location.None); 445var disabledDiag = CodeAnalysis.Diagnostic.Create(disabledDiagDescriptor, Location.None); 446var enabledDiag = CodeAnalysis.Diagnostic.Create(enabledDiagDescriptor, Location.None); 668var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, fieldDeclaration.GetLocation()); 784context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor1, Location.None)); 799registerSyntaxNodeAction(context => { context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor2, Location.None)); }, 802registerSyntaxNodeAction(context => { context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor3, Location.None)); }, 821context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(descriptor, Location.None)); 841ctxt.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor1, method.Locations[0], method.ToDisplayString())); 895compilationContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(UnsupportedDescriptor, Location.None)); 1655nodeContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(ExpressionDescriptor, nodeContext.Node.GetLocation())); 2336var diagnostic = CodeAnalysis.Diagnostic.Create(Summary, Location.None, sortedCallbackEntityNames.Join(",")); 2341private void ReportNodeDiagnostics(SyntaxNode node, Action<Diagnostic> addDiagnostic) 2346private void ReportOperationDiagnostics(IOperation operation, string name, Action<Diagnostic> addDiagnostic) 2351private void ReportDiagnosticsCore(Action<Diagnostic> addDiagnostic, Location location, params object[] messageArguments) 2354var diagnostic = CodeAnalysis.Diagnostic.Create(Warning, location, messageArguments); 3711var diagnostics = diagnosticsMap.TryGetValue(tree1, out var value) ? value : ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>.Empty; 3718var diagnostic = Assert.Single(diagnostics[analyzer]); 3850context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation())), 3856context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation())), 3863context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Operation.Syntax.GetLocation())), 3869context => context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(Rule, context.Operation.Syntax.GetLocation())), 3900void verifyDiagnostics(ImmutableArray<Diagnostic> diagnostics) 3902var diagnostic = Assert.Single(diagnostics); 3956ImmutableArray<Diagnostic> diagnostics, 4021static ImmutableArray<Diagnostic> getReportedDiagnostics(AnalysisResult analysisResult, DiagnosticAnalyzer analyzer, AdditionalText additionalFile) 4029return ImmutableArray<Diagnostic>.Empty; 4087var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, recordDeclaration.GetLocation()); 4135var diagnostic = CodeAnalysis.Diagnostic.Create(Rule, context.Node.GetLocation(), context.Node.Kind(), context.ContainingSymbol.Name); 4250var diagnostic = Assert.Single(diagnostics); 4253async Task<ImmutableArray<Diagnostic>> getDiagnosticsAsync(CancellationToken cancellationToken)
Diagnostics\DiagnosticSuppressorTests.cs (1)
642var diagnostic = Assert.Single(diagnostics);
Diagnostics\GetDiagnosticsTests.cs (18)
118var diag = compilation.GetDiagnostics().Single(); 123var error = diag.WithSeverity(DiagnosticSeverity.Error); 128var warning = error.WithSeverity(DiagnosticSeverity.Warning); 133var hidden = diag.WithSeverity(DiagnosticSeverity.Hidden); 138var info = diag.WithSeverity(DiagnosticSeverity.Info); 567static void verifyDiagnostics(ImmutableArray<Diagnostic> diagnostics) 572var diagnostic = diagnostics.Single(); 620var diagnostic = analyzerDiagnostics.Single(); 757var diagnostic = Assert.Single(diagnostics); 971blockEndContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, blockEndContext.CodeBlock.GetLocation())); 990blockEndContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(DescriptorForBlockEnd, operationBlock.Syntax.GetLocation())); 1011static void analyzeNode(SyntaxNode node, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic) 1040reportDiagnostic(CodeAnalysis.Diagnostic.Create(Descriptor, location, containingSymbol.Name)); 1436var compilationDiagnostic = compilationDiagnostics.Single(); 1441var analyzerDiagnostic = analyzerDiagnostics.Single(); 1477foreach (var diagnostic in context.ReportedDiagnostics) 1725var diag = CodeAnalysis.Diagnostic.Create(Descriptor, field.DeclaringSyntaxReferences[0].GetLocation());
FlowAnalysis\FlowDiagnosticTests.cs (4)
155foreach (var e in this.FlowDiagnostics(comp)) 183foreach (var e in this.FlowDiagnostics(comp)) 352foreach (var e in this.FlowDiagnostics(comp)) 384foreach (var e in this.FlowDiagnostics(comp))
FlowAnalysis\FlowTestBase.cs (1)
21internal ImmutableArray<Diagnostic> FlowDiagnostics(CSharpCompilation compilation)
FlowAnalysis\StructTests.cs (7)
580options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 587options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 649CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 651CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 694CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 696CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 814CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
Semantics\ExperimentalAttributeTests.cs (18)
63var diag = comp.GetDiagnostics().Single(); 118foreach (var diag in comp.GetDiagnostics()) 183foreach (var diag in comp.GetDiagnostics()) 292foreach (var diag in comp.GetDiagnostics()) 440foreach (var diag in comp.GetDiagnostics()) 510foreach (var diag in comp.GetDiagnostics()) 1070var diag = comp.GetDiagnostics().Single(); 1099var diag = comp.GetDiagnostics().Single(); 1130var diag = comp.GetDiagnostics().Single(); 1161var diag = comp.GetDiagnostics().Single(); 1192var diag = comp.GetDiagnostics().Single(); 1811var diag = comp.GetDiagnostics().Single(); 1852var diag = comp.GetDiagnostics().Single(); 1893var diag = comp.GetDiagnostics().Single(); 1919var diag = comp.GetDiagnostics().Single(); 1945var diag = comp.GetDiagnostics().Single(); 1976var diag = comp.GetDiagnostics().Single(); 2002var diag = comp.GetDiagnostics().Single();
Semantics\PrimaryConstructorTests.cs (1)
7849var diagnosticsToCheck = (IEnumerable<Diagnostic>)comp.GetEmitDiagnostics();
Microsoft.CodeAnalysis.CSharp.Features (222)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.cs (1)
46protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (7)
37protected override SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 44Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 51SyntaxToken disableOrRestoreKeyword, Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken) 103Diagnostic diagnostic, 130SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic) 154Diagnostic diagnostic, 177private static AttributeArgumentListSyntax CreateAttributeArguments(ISymbol targetSymbol, Diagnostic diagnostic, bool isAssemblyAttribute)
ConvertProgram\ConvertToProgramMainCodeFixProvider.cs (1)
49Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
ConvertProgram\ConvertToTopLevelStatementsCodeFixProvider.cs (1)
49Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
Copilot\CSharpCopilotCodeFixProvider.cs (2)
79foreach (var diagnostic in context.Diagnostics) 94Diagnostic diagnostic,
Copilot\CSharpCopilotCodeFixProvider.DismissChangesCodeAction.cs (2)
21private sealed class CopilotDismissChangesCodeAction(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeAction 32private sealed class TriggerDismissalCodeActionOperation(SyntaxNode originalMethodNode, Diagnostic diagnostic) : CodeActionOperation
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (2)
51protected override ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root) 67protected override ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree)
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.cs (4)
48private ImmutableArray<Diagnostic>.Builder? _diagnostics; 60public ImmutableArray<Diagnostic> Diagnostics => _diagnostics?.ToImmutable() ?? []; 62public ImmutableArray<Diagnostic>.Builder DiagnosticsBuilder 67Interlocked.CompareExchange(ref _diagnostics, ImmutableArray.CreateBuilder<Diagnostic>(), null);
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (2)
36var diagnostic = AnalyzeNamespace(context, namespaceDeclaration); 41private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, FileScopedNamespaceDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (2)
40var diagnostic = AnalyzeNamespace(context, root, namespaceDeclaration); 45private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, CompilationUnitSyntax root, BaseNamespaceDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\MakeAnonymousFunctionStatic\MakeAnonymousFunctionStaticDiagnosticAnalyzer.cs (1)
52Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (2)
113var diagnostic = Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (3)
46var methodToDiagnostic = PooledDictionary<IMethodSymbol, Diagnostic>.GetInstance(); 102SymbolAnalysisContext context, ReportDiagnostic severity, PooledDictionary<IMethodSymbol, Diagnostic> methodToDiagnostic) 135Dictionary<IMethodSymbol, Diagnostic> methodToDiagnostic)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
97context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
103context.ReportDiagnostic(Diagnostic.Create(Descriptor, directive.GetLocation()));
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveDiagnosticAnalyzer.cs (5)
89private ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, int positionOfFirstReducingNullableDirective, TextSpanMutableIntervalTree? codeBlockIntervalTree, TextSpanMutableIntervalTree? possibleNullableImpactIntervalTree) 103using var diagnostics = TemporaryArray<Diagnostic>.Empty; 129diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 161diagnostics.Add(Diagnostic.Create(Descriptor, currentOptionsDirective.GetLocation())); 318foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
61foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (1)
89private Diagnostic? AnalyzeSyntax(
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (2)
63var diagnostic = AnalyzeSyntax(context.SemanticModel, option, declaration, context.Options, context.CancellationToken); 70private static Diagnostic? AnalyzeSyntax(
src\Analyzers\CSharp\Analyzers\UseImplicitOrExplicitType\CSharpTypeStyleDiagnosticAnalyzerBase.cs (1)
67private static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, SyntaxNode declaration, TextSpan diagnosticSpan, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (1)
248private Diagnostic CreateDiagnostic(Result result, NotificationOption2 notificationOption, AnalyzerOptions analyzerOptions)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
44public static bool IsSafe(Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\AddBraces\CSharpAddBracesCodeFixProvider.cs (2)
32Document document, ImmutableArray<Diagnostic> diagnostics, 36foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\AddInheritdoc\AddInheritdocCodeFixProvider.cs (3)
47foreach (var diagnostic in context.Diagnostics) 79protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 83foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\AssignOutParameters\AbstractAssignOutParametersCodeFixProvider.cs (2)
96Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 136Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\ConditionalExpressionInStringInterpolation\CSharpAddParenthesesAroundConditionalExpressionInInterpolatedStringCodeFixProvider.cs (1)
38var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 52Document document, ImmutableArray<Diagnostic> diagnostics, 55var diagnostic = diagnostics.First();
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (2)
52Document document, ImmutableArray<Diagnostic> diagnostics, 56foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\ConvertToAsync\CSharpConvertToAsyncMethodCodeFixProvider.cs (2)
31Diagnostic diagnostic, 46Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (4)
40var diagnostic = context.Diagnostics.First(); 51SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken, 133Document document, ImmutableArray<Diagnostic> diagnostics, 139foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\FixIncorrectConstraint\CSharpFixIncorrectConstraintCodeFixProvider.cs (4)
31Diagnostic diagnostic, 67var diagnostic = context.Diagnostics.First(); 77Document document, ImmutableArray<Diagnostic> diagnostics, 83foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (2)
62Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 127protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.cs (1)
50protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.cs (1)
38protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateConversionCodeFixProvider.cs (1)
35protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateMethodCodeFixProvider.cs (1)
54protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\GenerateVariable\CSharpGenerateVariableCodeFixProvider.cs (1)
40protected override bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic)
src\Analyzers\CSharp\CodeFixes\HideBase\HideBaseCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
45Document document, ImmutableArray<Diagnostic> diagnostics, 53foreach (var diagnostic in diagnostics) 79Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (6)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 45Document document, ImmutableArray<Diagnostic> diagnostics, 48foreach (var diagnostic in diagnostics) 58SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken) 73Diagnostic diagnostic, 117SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpAddYieldCodeFixProvider.cs (1)
44protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
35protected override async Task<CodeAction?> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (2)
38protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixProvider.cs (1)
32Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\PassInCapturedVariablesAsArgumentsCodeFixProvider.cs (3)
33var diagnostic = context.Diagnostics.First(); 52protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 64ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeMemberRequired\CSharpMakeMemberRequiredCodeFixProvider.cs (2)
107protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 113foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
38protected override bool IsSupportedDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 48Document document, ImmutableArray<Diagnostic> diagnostics, 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableCodeFixProvider.cs (2)
36ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyCodeFixProvider.cs (1)
38ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MakeStructReadOnly\CSharpMakeStructReadOnlyCodeFixProvider.cs (1)
35ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProvider.cs (1)
72foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementCodeFixProvider.cs (3)
34var diagnostic = context.Diagnostics.First(); 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (5)
34var diagnostic = context.Diagnostics.First(); 44private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 47public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 53foreach (var diagnostic in diagnostics) 64Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\NewLines\ConstructorInitializerPlacement\ConstructorInitializerPlacementCodeFixProvider.cs (3)
33var diagnostic = context.Diagnostics.First(); 44Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 50foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (4)
36var diagnostic = context.Diagnostics.First(); 46public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 55foreach (var diagnostic in diagnostics) 63Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (3)
76ImmutableArray<Diagnostic> diagnostics, 85foreach (var diagnostic in diagnostics) 93protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\QualifyMemberAccess\CSharpQualifyMemberAccessCodeFixProvider.cs (1)
21protected override SimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (2)
58Document document, ImmutableArray<Diagnostic> diagnostics, 67foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveInKeyword\RemoveInKeywordCodeFixProvider.cs (1)
37var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveNewModifier\RemoveNewModifierCodeFixProvider.cs (1)
35var diagnostic = context.Diagnostics.First();
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionCodeFixProvider.cs (2)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnnecessaryNullableDirective\CSharpRemoveUnnecessaryNullableDirectiveCodeFixProvider.cs (2)
38foreach (var diagnostic in context.Diagnostics) 51ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (5)
29var diagnostic = context.Diagnostics[0]; 44protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 47private static bool IsSubsequentSection(Diagnostic diagnostic) 52ImmutableArray<Diagnostic> diagnostics, 56foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\SimplifyPropertyPattern\CSharpSimplifyPropertyPatternCodeFixProvider.cs (1)
39Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\TransposeRecordKeyword\CSharpTransposeRecordKeywordCodeFixProvider.cs (4)
30Diagnostic diagnostic, CancellationToken cancellationToken, [NotNullWhen(true)] out RecordDeclarationSyntax? recordDeclaration) 85var diagnostic = context.Diagnostics.First(); 96Document document, ImmutableArray<Diagnostic> diagnostics, 99foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (3)
65public override string SuggestedVersion(ImmutableArray<Diagnostic> diagnostics) 68private static LanguageVersion RequiredVersion(ImmutableArray<Diagnostic> diagnostics) 71foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentCodeFixProvider.cs (2)
41Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
40Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (5)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 41var diagnostic = context.Diagnostics.First(); 54Document document, ImmutableArray<Diagnostic> diagnostics, 60foreach (var diagnostic in diagnostics) 76SemanticModel semanticModel, SyntaxEditor editor, Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (6)
30var diagnostic = context.Diagnostics[0]; 42protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 45private static async Task FixAllImplAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 48foreach (var diagnostic in diagnostics) 55private static Task<Document> FixWithSyntaxEditorAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 61Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseImplicitObjectCreation\CSharpUseImplicitObjectCreationCodeFixProvider.cs (2)
35protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 45Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
41Document document, ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseImplicitTypeCodeFixProvider.cs (2)
33Document document, ImmutableArray<Diagnostic> diagnostics, 38foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseIndexOperatorCodeFixProvider.cs (2)
36Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (2)
46Document document, ImmutableArray<Diagnostic> diagnostics, 80private static InvocationExpressionSyntax GetInvocationExpression(Diagnostic d, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (3)
36Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics) 50Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseIsNullCheckForCastAndEqualityOperatorCodeFixProvider.cs (4)
34private static bool IsSupportedDiagnostic(Diagnostic diagnostic) 39var diagnostic = context.Diagnostics.First(); 54Document document, ImmutableArray<Diagnostic> diagnostics, 57foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseIsNullCheck\CSharpUseNullCheckOverTypeCheckCodeFixProvider.cs (2)
39Document document, ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (3)
42protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 52Document document, ImmutableArray<Diagnostic> diagnostics, 64foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseNameofInAttribute\CSharpUseNameofInAttributeCodeFixProvider.cs (2)
38ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (4)
52Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 60var diagnostic = context.Diagnostics.First(); 73Document document, ImmutableArray<Diagnostic> diagnostics, 77foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndMemberAccessCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 43foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start)) 49private static void FixOne(SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 51foreach (var diagnostic in diagnostics) 85Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (3)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics) 51Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (3)
35Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics) 49Diagnostic diagnostic,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
54foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (1)
46Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (1)
45foreach (var diagnostic in context.Diagnostics)
src\Analyzers\CSharp\CodeFixes\UseThrowExpression\UseThrowExpressionCodeFixProvider.cs (3)
30protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 40Document document, ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\CSharp\CodeFixes\UseTupleSwap\CSharpUseTupleSwapCodeFixProvider.cs (3)
37Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics) 47SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseUnboundGenericTypeInNameOf\CSharpUseUnboundGenericTypeInNameOfCodeFixProvider.cs (3)
40Document document, ImmutableArray<Diagnostic> diagnostics, 43foreach (var diagnostic in diagnostics) 50SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (3)
43Document document, ImmutableArray<Diagnostic> diagnostics, 52foreach (var diagnostic in diagnostics) 91private static IArrayCreationOperation GetArrayCreationOperation(SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken)
StringIndentation\CSharpStringIndentationService.cs (1)
100foreach (var error in errors)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
48Document document, ImmutableArray<Diagnostic> diagnostics,
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (24)
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (1)
38c => c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
50context.ReportDiagnostic(Diagnostic.Create(Decsciptor, location));
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (3)
104context.ReportDiagnostic(Diagnostic.Create(rule, local.Locations[0])); 1308var diagnostic = Diagnostic.Create(Descriptor, context.Symbol.ContainingNamespace.Locations[0]);
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (2)
52context.ReportDiagnostic(Diagnostic.Create(Decsciptor1, location)); 53context.ReportDiagnostic(Diagnostic.Create(Decsciptor2, location));
Diagnostics\Suppression\SuppressionTests.cs (15)
709context.ReportDiagnostic(Diagnostic.Create(Decsciptor, classDecl.Identifier.GetLocation())); 819context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())); 882context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())); 932context.ReportDiagnostic(Diagnostic.Create(Decsciptor, classDecl.GetLocation())); 1076context.ReportDiagnostic(Diagnostic.Create(Descriptor, classDecl.Identifier.GetLocation())); 1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, ns.Name.GetLocation())); 1086context.ReportDiagnostic(Diagnostic.Create(Descriptor, method.Identifier.GetLocation())); 1091context.ReportDiagnostic(Diagnostic.Create(Descriptor, property.Identifier.GetLocation())); 1096context.ReportDiagnostic(Diagnostic.Create(Descriptor, field.Declaration.Variables.First().Identifier.GetLocation())); 1101context.ReportDiagnostic(Diagnostic.Create(Descriptor, e.Identifier.GetLocation())); 1108context.ReportDiagnostic(Diagnostic.Create(Descriptor, trivia.GetLocation())); 2070context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())); 2075context.ReportDiagnostic(Diagnostic.Create(_descriptor, ns.Name.GetLocation())); 2080context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.GetLocation())); 2461=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (51)
Semantics\MethodBodyModelTests.cs (1)
127foreach (var e in comp.GetDiagnostics())
Semantics\NullableReferenceTypesTests.cs (2)
112496foreach (var diagnostic in diagnostics) 157886var reportedDiagnostics = new HashSet<Diagnostic>();
Semantics\QueryTests.cs (1)
1658foreach (var dd in compilation.GetDiagnostics()) Console.WriteLine(dd);
Semantics\UninitializedNonNullableFieldTests.cs (1)
2808var diagnostic = Assert.Single(diagnostics);
Semantics\UseSiteErrorTests.cs (2)
1237foreach (var diag in compilation.GetDiagnostics()) 2445foreach (var diagnostic in diagnostics)
Semantics\WarningVersionTests.cs (12)
48CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 78CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 117CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 157options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 235options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 321options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 392CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 445options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 532options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 619options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 683CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 713CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(
SourceGeneration\GeneratorDriverTests.cs (32)
434var diagnostic = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic, Location.None); 666var diagnostic1 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic1, Location.None); 667var diagnostic2 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic2, Location.None); 668var diagnostic3 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic3, Location.None); 713var diagnostic1 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic1, Location.None); 714var diagnostic2 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic2, Location.None); 715var diagnostic3 = Microsoft.CodeAnalysis.Diagnostic.Create(generatorDiagnostic3, Location.None); 1215var gen001 = CSDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 2); 1253void verifyDiagnosticsWithSource(string source, (Diagnostic, TextSpan)[] reportDiagnostics, params DiagnosticDescription[] expected) 1263foreach ((var d, var l) in reportDiagnostics) 1286var gen001 = CSDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, isEnabledByDefault: true, warningLevel: 2); 1344static void verify(string source, IReadOnlyList<(Diagnostic Diagnostic, string Location)> reportDiagnostics, params DiagnosticDescription[] expected) 3366var diag = Assert.Single(result.Diagnostics); 3618ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3651ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3682ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3712ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3744ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3776ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3807ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3836ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3868ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 3898ctx.ReportDiagnostic(CodeAnalysis.Diagnostic.Create( 4109Diagnostic diagnostic, 4125Diagnostic diagnostic,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (7)
Compilation\CSharpCompilationOptionsTests.cs (1)
194Assert.Equal(CodeAnalysis.Diagnostic.DefaultWarningLevel, defaultWarnings.WarningLevel);
Symbols\Retargeting\RetargetExplicitInterfaceImplementation.cs (1)
357foreach (var diag in comp1.GetDiagnostics())
Symbols\Source\FieldTests.cs (1)
103var one = errors.Single();
Symbols\Source\NullablePublicAPITests.cs (2)
1171syntaxContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor1, syntaxContext.Node.GetLocation(), syntaxContext.Node, info.Nullability.FlowState, info.Nullability.Annotation, specInfo.Nullability.FlowState)); 1179context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_descriptor2, declarator.GetLocation(), declaredSymbol.Name, declaredSymbol.NullableAnnotation));
Symbols\Source\PropertyTests.cs (1)
1933var one = errors.Single();
Symbols\SymbolDistinguisherTests.cs (1)
751foreach (var diagnostic in diagnostics)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (17)
Diagnostics\LocationsTests.cs (10)
313var diag = diags.First(); 376var diag = diags.First(); 397foreach (var diag in diags) 462foreach (var diag in expressionDiags) 505var diagnostic = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: location); 523var diagnosticWithoutMapping = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: locationWithoutMapping); 526var diagnosticWithMapping = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: locationWithMapping);
LexicalAndXml\PreprocessorTests.cs (2)
3215var error = tree.GetDiagnostics().Single(); 3875var diagnostic = tree.GetDiagnostics().Single();
Parsing\ParserErrorMessageTests.cs (1)
2632var error = parsedTree.GetDiagnostics().Single();
Parsing\ParserRegressionTests.cs (2)
226IEnumerable<Diagnostic> actualErrors = parsedTree.GetDiagnostics(); 244IEnumerable<Diagnostic> actualErrors = parsedTree.GetDiagnostics();
Syntax\SyntaxNodeTests.cs (2)
3380foreach (var e in syntaxTree.GetDiagnostics(t)) 3424foreach (var diag in tree.GetDiagnostics(trivia))
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CSharpTestBase.cs (1)
1390static bool shouldCompare(Diagnostic d)
DiagnosticTestUtilities.cs (2)
96public static void VerifyErrorCodes(IEnumerable<Diagnostic> actualErrors, params ErrorDescription[] expectedErrorDesp) 170public static void VerifyErrorCodesNoLineColumn(IEnumerable<Diagnostic> actualErrors, params ErrorDescription[] expectedErrorDesp)
TestOptions.cs (1)
190=> new CSharpCompilationOptions(outputKind, optimizationLevel: optimizationLevel, warningLevel: Diagnostic.MaxWarningLevel, allowUnsafe: allowUnsafe);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Simplification\CSharpSimplificationService.cs (1)
191foreach (var diagnostic in diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
33foreach (var diagnostic in diagnostics)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
Workspaces\NoCompilationDocumentDiagnosticAnalyzer.cs (4)
24public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 25=> SpecializedTasks.EmptyImmutableArray<Diagnostic>(); 27public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 30Diagnostic.Create(Descriptor, Location.Create(document.FilePath, default, default))));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (40)
CodeFixes\CodeFixServiceTests.cs (10)
563c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0)))); 588public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 591return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 594public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 597return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 615context.ReportDiagnostic(Diagnostic.Create(s_descriptor, tree.GetLocation(new TextSpan(0, 1)))); 928context.ReportDiagnostic(Diagnostic.Create(_descriptor, location)); 1194context.ReportDiagnostic(Diagnostic.Create(Descriptor, decl.GetLocation())); 1204context.ReportDiagnostic(Diagnostic.Create(Descriptor, decl.GetLocation())); 1210context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Operation.Syntax.GetLocation())),
Diagnostics\DiagnosticAnalyzerServiceTests.cs (23)
923context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 924context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.GetRoot().GetLocation()))); 925context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation()))); 939context.RegisterSyntaxTreeAction(c => c.ReportDiagnostic(Diagnostic.Create(s_syntaxRule, c.Tree.GetRoot().GetLocation()))); 940context.RegisterSemanticModelAction(c => c.ReportDiagnostic(Diagnostic.Create(s_semanticRule, c.SemanticModel.SyntaxTree.GetRoot().GetLocation()))); 941context.RegisterCompilationAction(c => c.ReportDiagnostic(Diagnostic.Create(s_compilationRule, c.Compilation.SyntaxTrees.First().GetRoot().GetLocation()))); 951public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 952=> Task.FromResult(ImmutableArray.Create(Diagnostic.Create(s_syntaxRule, Location.Create(document.FilePath, TextSpan.FromBounds(0, 0), new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 0)))))); 954public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 955=> SpecializedTasks.Default<ImmutableArray<Diagnostic>>(); 990public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 991=> Task.FromResult(ImmutableArray<Diagnostic>.Empty); 992public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 993=> Task.FromResult(ImmutableArray<Diagnostic>.Empty); 1003public override Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 1004=> Task.FromResult(ImmutableArray<Diagnostic>.Empty); 1013public override async Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 1016return ImmutableArray.Create(Diagnostic.Create(s_syntaxRule, root.GetLocation())); 1019public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 1020=> SpecializedTasks.Default<ImmutableArray<Diagnostic>>(); 1027public override Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) => SpecializedTasks.Default<ImmutableArray<Diagnostic>>(); 1047c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Symbol.Locations[0]));
EditAndContinue\EditAndContinueLanguageServiceTests.cs (7)
163var documentDiagnostic = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), ["doc", "error 1"]); 164var projectDiagnostic = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.None, ["proj", "error 2"]); 165var syntaxError = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), ["doc", "syntax error 3"]); 166var rudeEditDiagnostic = new RudeEditDiagnostic(RudeEditKind.Delete, TextSpan.FromBounds(2, 3), arguments: ["x"]).ToDiagnostic(syntaxTree);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (5)
Suggestions\FixAll\FixMultipleOccurrencesService.cs (2)
34ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 52ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
Suggestions\RefineUsingCopilot\RefineUsingCopilotCodeAction.cs (1)
91Diagnostic? convertedPrimaryDiagnostic,
Suggestions\SuggestedActions\FixAllCodeFixSuggestedAction.cs (2)
21public Diagnostic Diagnostic { get; } 30Diagnostic diagnostic,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (23)
CodeFixes\CodeFixServiceTests.vb (6)
205context.ReportDiagnostic(Diagnostic.Create(DiagDescriptor, context.Symbol.Locations.First(), context.Symbol.Locations.Skip(1))) 291NoCompilationCopilotCodeAnalysisService.Diagnostics = diagnostics.SelectAsArray(Of Diagnostic)( 332Public Shared Property Diagnostics As ImmutableArray(Of Diagnostic) = ImmutableArray(Of Diagnostic).Empty 346Public Function GetCachedDocumentDiagnosticsAsync(document As Document, span As TextSpan?, promptTitles As ImmutableArray(Of String), cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Diagnostic)) Implements ICopilotCodeAnalysisService.GetCachedDocumentDiagnosticsAsync 350Public Function StartRefinementSessionAsync(oldDocument As Document, newDocument As Document, primaryDiagnostic As Diagnostic, cancellationToken As CancellationToken) As Task Implements ICopilotCodeAnalysisService.StartRefinementSessionAsync
Diagnostics\AbstractCrossLanguageUserDiagnosticTest.vb (4)
125Friend Async Function GetDiagnosticAndFixAsync(workspace As EditorTestWorkspace) As Task(Of Tuple(Of Diagnostic, CodeFixCollection)) 151Private Async Function GetDiagnosticAndFixesAsync(workspace As EditorTestWorkspace) As Task(Of IEnumerable(Of Tuple(Of Diagnostic, CodeFixCollection))) 158Dim result = New List(Of Tuple(Of Diagnostic, CodeFixCollection)) 180Private Shared Async Function GetDocumentAndDiagnosticsAsync(workspace As EditorTestWorkspace) As Task(Of Tuple(Of Document, IEnumerable(Of Diagnostic)))
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
97context.ReportDiagnostic(Diagnostic.Create(Rule, context.Symbol.Locations.First()))
Diagnostics\DiagnosticServiceTests.vb (12)
1381context.ReportDiagnostic(Diagnostic.Create(Descriptor1, fieldDecl.GetLocation, fieldDecl.ToString())) 1461Dim diag = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations(0), additionalFileText) 1548context.ReportDiagnostic(Diagnostic.Create(DiagDescriptor, context.Symbol.Locations.First(), context.Symbol.Locations.Skip(1))) 1576context.ReportDiagnostic(Diagnostic.Create(DiagDescriptor, location)) 1603sc.ReportDiagnostic(Diagnostic.Create(DiagDescriptor, sc.Symbol.Locations.First())) 1702context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1724context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.CodeBlock.GetLocation)) 1750context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None)) 1751context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Compilation.SyntaxTrees(0).GetRoot().GetLocation)) 1789context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None, _symbolNames.Count)) 1861context.ReportDiagnostic(Diagnostic.Create(descriptor, context.Node.GetLocation)) 1887ctxt.ReportDiagnostic(Diagnostic.Create(Descriptor, method.Locations(0), method.ToDisplayString))
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (8)
DebuggerDiagnosticFormatter.cs (1)
13public override string Format(Diagnostic diagnostic, IFormatProvider? formatter = null)
EvaluationContextBase.cs (7)
82Diagnostic error, 91internal abstract bool HasDuplicateTypesOrAssemblies(Diagnostic diagnostic); 93internal abstract ImmutableArray<AssemblyIdentity> GetMissingAssemblyIdentities(Diagnostic diagnostic, AssemblyIdentity linqLibrary); 151public override bool Equals(Diagnostic? obj) 166internal override Diagnostic WithLocation(Location location) 171internal override Diagnostic WithSeverity(DiagnosticSeverity severity) 176internal override Diagnostic WithIsSuppressed(bool isSuppressed)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (28)
Analyzer\IExternalCSharpCopilotCodeAnalysisService.cs (3)
18Task<ImmutableArray<Diagnostic>> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 19Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken); 20Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
Internal\Analyzer\AbstractCopilotCodeAnalysisService.cs (11)
35private readonly ConditionalWeakTable<Document, ConcurrentDictionary<string, (ImmutableArray<Diagnostic> Diagnostics, bool IsCompleteResult)>> _diagnosticsCache = new(); 39protected abstract Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken); 40protected abstract Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken); 41protected abstract Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken); 95private bool TryGetDiagnosticsFromCache(Document document, string promptTitle, out ImmutableArray<Diagnostic> diagnostics, out bool isCompleteResult) 110private void CacheAndRefreshDiagnosticsIfNeeded(Document document, string promptTitle, ImmutableArray<Diagnostic> diagnostics, bool isCompleteResult) 128public async Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken) 133using var _1 = ArrayBuilder<Diagnostic>.GetInstance(out var diagnostics); 162protected virtual Task<ImmutableArray<Diagnostic>> GetDiagnosticsIntersectWithSpanAsync(Document document, IReadOnlyList<Diagnostic> diagnostics, TextSpan span, CancellationToken cancellationToken) 167public async Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken)
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.cs (7)
45protected override Task<ImmutableArray<Diagnostic>> AnalyzeDocumentCoreAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 51protected override Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsCoreAsync(Document document, string promptTitle, CancellationToken cancellationToken) 57protected override Task StartRefinementSessionCoreAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken) 63protected override async Task<ImmutableArray<Diagnostic>> GetDiagnosticsIntersectWithSpanAsync( 64Document document, IReadOnlyList<Diagnostic> diagnostics, TextSpan span, CancellationToken cancellationToken) 66using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var filteredDiagnostics); 73foreach (var diagnostic in diagnostics)
Internal\Analyzer\CSharp\CSharpCopilotCodeAnalysisService.ReflectionWrapper.cs (7)
17using AnalyzeDocumentAsyncDelegateType = Func<Document, TextSpan?, string, CancellationToken, Task<ImmutableArray<Diagnostic>>>; 19using GetCachedDiagnosticsAsyncDelegateType = Func<Document, string, CancellationToken, Task<ImmutableArray<Diagnostic>>>; 21using StartRefinementSessionAsyncDelegateType = Func<Document, Document, Diagnostic?, CancellationToken, Task>; 114=> CreateDelegate<StartRefinementSessionAsyncDelegateType>(StartRefinementSessionAsyncMethodName, [typeof(Document), typeof(Document), typeof(Diagnostic), typeof(CancellationToken)]); 138public async Task<ImmutableArray<Diagnostic>> AnalyzeDocumentAsync(Document document, TextSpan? span, string promptTitle, CancellationToken cancellationToken) 146public async Task<ImmutableArray<Diagnostic>> GetCachedDiagnosticsAsync(Document document, string promptTitle, CancellationToken cancellationToken) 154public Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (26)
Diagnostics\IFSharpDocumentDiagnosticAnalyzer.cs (2)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken); 17Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpSimplifyNameDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpUnusedDeclarationsDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
Diagnostics\IFSharpUnusedOpensDiagnosticAnalyzer.cs (1)
15Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken);
Internal\Diagnostics\FSharpDocumentDiagnosticAnalyzer.cs (6)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 40public Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 73public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 78return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 84public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 89return Task.FromResult(ImmutableArray<Diagnostic>.Empty);
Internal\Diagnostics\FSharpSimplifyNameDiagnosticAnalyzer.cs (5)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 57public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 62return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 68public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 70return Task.FromResult(ImmutableArray<Diagnostic>.Empty);
Internal\Diagnostics\FSharpUnusedDeclarationsAnalyzer.cs (5)
35public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 59public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 64return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 70public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 72return Task.FromResult(ImmutableArray<Diagnostic>.Empty);
Internal\Diagnostics\FSharpUnusedOpensDiagnosticAnalyzer.cs (5)
32public Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(DiagnosticDescriptor descriptor, Document document, CancellationToken cancellationToken) 52public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 57return Task.FromResult(ImmutableArray<Diagnostic>.Empty); 63public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 65return Task.FromResult(ImmutableArray<Diagnostic>.Empty);
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
CodeActions\OmniSharpCodeFixContextFactory.cs (2)
20ImmutableArray<Diagnostic> diagnostics, 21Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix,
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
External\IXamlDiagnosticSource.cs (1)
13Task<ImmutableArray<Diagnostic>> GetDiagnosticsAsync(
Microsoft.CodeAnalysis.Features (448)
AddImport\AbstractAddImportFeatureService.cs (4)
507public async Task<ImmutableArray<(Diagnostic Diagnostic, ImmutableArray<AddImportFixData> Fixes)>> GetFixesForDiagnosticsAsync( 508Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 515var result = new FixedSizeArrayBuilder<(Diagnostic, ImmutableArray<AddImportFixData>)>(diagnostics.Length); 517foreach (var diagnostic in diagnostics)
AddImport\IAddImportFeatureService.cs (5)
21/// Gets data for how to fix a particular <see cref="Diagnostic" /> id within the specified Document. 30/// Gets data for how to fix a set of <see cref="Diagnostic" />s within the specified Document. 33Task<ImmutableArray<(Diagnostic Diagnostic, ImmutableArray<AddImportFixData> Fixes)>> GetFixesForDiagnosticsAsync( 34Document document, TextSpan span, ImmutableArray<Diagnostic> diagnostics, int maxResultsPerDiagnostic, 47/// Gets data for how to fix a particular <see cref="Diagnostic" /> id within the specified Document.
AddMissingReference\AbstractAddMissingReferenceCodeFixProvider.cs (1)
64foreach (var diagnostic in context.Diagnostics)
CodeFixes\CodeFixCollection.cs (2)
22Diagnostic firstDiagnostic) 33public Diagnostic FirstDiagnostic { get; } = firstDiagnostic;
CodeFixes\Configuration\ConfigurationUpdater.cs (8)
67private readonly Diagnostic? _diagnostic; 79Diagnostic? diagnosticToConfigure, 109Diagnostic diagnostic, 128Diagnostic diagnostic, 200Diagnostic diagnostic, 212Diagnostic diagnostic, 341Diagnostic diagnostic, 383internal static ImmutableArray<IOption2> GetCodeStyleOptionsForDiagnostic(Diagnostic diagnostic, Project project)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (6)
38public bool IsFixableDiagnostic(Diagnostic diagnostic) 56public Task<ImmutableArray<CodeFix>> GetFixesAsync(TextDocument document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 59public Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 62private static ImmutableArray<CodeFix> GetConfigurations(Project project, IEnumerable<Diagnostic> diagnostics) 65foreach (var diagnostic in diagnostics) 102TopLevelConfigureCodeStyleOptionCodeAction? GetCodeActionForCodeStyleOption(IOption2 option, Diagnostic diagnostic, bool hasMultipleOptions)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.TopLevelConfigureCodeStyleOptionCodeAction.cs (1)
14public TopLevelConfigureCodeStyleOptionCodeAction(Diagnostic diagnostic, ImmutableArray<CodeAction> nestedActions)
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (9)
41public bool IsFixableDiagnostic(Diagnostic diagnostic) 47public Task<ImmutableArray<CodeFix>> GetFixesAsync(TextDocument document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 50public Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 53private static ImmutableArray<CodeFix> GetConfigurations(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 56var analyzerDiagnosticsByCategory = new SortedDictionary<string, ArrayBuilder<Diagnostic>>(); 57using var disposer = ArrayBuilder<Diagnostic>.GetInstance(out var analyzerDiagnostics); 58foreach (var diagnostic in diagnostics) 79var diagnosticsForCategory = analyzerDiagnosticsByCategory.GetOrAdd(diagnostic.Descriptor.Category, _ => ArrayBuilder<Diagnostic>.GetInstance()); 99void AddBulkConfigurationCodeFixes(ImmutableArray<Diagnostic> diagnostics, string? category)
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.TopLevelConfigureSeverityCodeAction.cs (1)
14private sealed class TopLevelConfigureSeverityCodeAction(Diagnostic diagnostic, ImmutableArray<CodeAction> nestedActions) : AbstractConfigurationActionWithNestedActions(nestedActions, string.Format(FeaturesResources.Configure_0_severity, diagnostic.Id))
CodeFixes\FixAllOccurrences\IFixMultipleOccurrencesService.cs (2)
22ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 37ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix,
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (16)
45ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 74private async Task<ImmutableArray<(Diagnostic diagnostic, CodeAction action)>> GetDiagnosticsAndCodeActionsAsync( 75ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap, 95return await ProducerConsumer<(Diagnostic diagnostic, CodeAction action)>.RunParallelAsync( 112Document document, ImmutableArray<Diagnostic> diagnostics, 113Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 135ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap, 146var bag = new ConcurrentBag<(Diagnostic diagnostic, CodeAction action)>(); 175private static Action<CodeAction, ImmutableArray<Diagnostic>> GetRegisterCodeFixAction( 177Action<(Diagnostic diagnostic, CodeAction action)> onItemFound) 200Project project, ImmutableArray<Diagnostic> diagnostics, 201ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> fixes, 208ImmutableArray<(Diagnostic diagnostic, CodeAction action)> batchOfFixes, 227ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions, 250ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions, 273ImmutableArray<(Diagnostic diagnostic, CodeAction action)> diagnosticsAndCodeActions,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (12)
44public bool IsFixableDiagnostic(Diagnostic diagnostic) 47protected abstract SyntaxTriviaList CreatePragmaDisableDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken); 48protected abstract SyntaxTriviaList CreatePragmaRestoreDirectiveTrivia(Diagnostic diagnostic, Func<SyntaxNode, CancellationToken, SyntaxNode> formatNode, bool needsLeadingEndOfLine, bool needsTrailingEndOfLine, CancellationToken cancellationToken); 54Diagnostic diagnostic, 61SyntaxNode targetNode, ISymbol targetSymbol, INamedTypeSymbol suppressMessageAttribute, Diagnostic diagnostic); 80protected static string GetOrMapDiagnosticId(Diagnostic diagnostic, out bool includeTitle) 142TextDocument textDocument, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 150internal async Task<ImmutableArray<PragmaWarningCodeAction>> GetPragmaSuppressionsAsync(Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 159Document document, TextSpan span, IEnumerable<Diagnostic> diagnostics, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 172Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken) 188Document documentOpt, Project project, IEnumerable<Diagnostic> diagnostics, SuppressionTargetInfo suppressionTargetInfo, bool skipSuppressMessage, bool skipUnsuppress, CancellationToken cancellationToken) 207foreach (var diagnostic in diagnostics)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (2)
20Project project, Diagnostic diagnostic, 24private readonly Diagnostic _diagnostic = diagnostic;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (23)
28private readonly IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> _diagnosticsBySymbol; 33IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> diagnosticsBySymbol, 41internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Document triggerDocument, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument) 48internal static CodeAction Create(string title, AbstractSuppressionCodeFixProvider fixer, Project triggerProject, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject) 70ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsByDocument, 99ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 152private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(AbstractSuppressionCodeFixProvider fixer, IEnumerable<KeyValuePair<Document, ImmutableArray<Diagnostic>>> diagnosticsByDocument, CancellationToken cancellationToken) 154var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 157foreach (var diagnostic in diagnostics) 173private static async Task<IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>> CreateDiagnosticsBySymbolAsync(Project project, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 175var diagnosticsMapBuilder = ImmutableDictionary.CreateBuilder<ISymbol, List<Diagnostic>>(); 179foreach (var diagnostic in diagnostics) 190private static void AddDiagnosticForSymbolIfNeeded(ISymbol targetSymbol, Diagnostic diagnostic, ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 206private static IEnumerable<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>> CreateDiagnosticsBySymbol(ImmutableDictionary<ISymbol, List<Diagnostic>>.Builder diagnosticsMapBuilder) 211var builder = new List<KeyValuePair<ISymbol, ImmutableArray<Diagnostic>>>(); 218private static ImmutableArray<Diagnostic> GetUniqueDiagnostics(List<Diagnostic> diagnostics) 221var uniqueDiagnostics = ArrayBuilder<Diagnostic>.GetInstance(); 222foreach (var diagnostic in diagnostics)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.LocalSuppressMessageCodeAction.cs (2)
20Diagnostic diagnostic) : AbstractSuppressionCodeAction(fixer, FeaturesResources.in_Source_attribute) 26private readonly Diagnostic _diagnostic = diagnostic;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (9)
30ImmutableArray<Diagnostic> pragmaDiagnostics, 45ImmutableArray<Diagnostic> diagnostics, 50var currentDiagnosticSpans = new Dictionary<Diagnostic, TextSpan>(); 51foreach (var diagnostic in diagnostics) 60var diagnostic = diagnostics[i]; 71diagnostic = Diagnostic.Create( 130private static void UpdateDiagnosticSpans(ImmutableArray<Diagnostic> diagnostics, Dictionary<Diagnostic, TextSpan> currentDiagnosticSpans, IEnumerable<TextChange> textChanges) 136foreach (var diagnostic in diagnostics)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
105Diagnostic diagnostic, 157Diagnostic diagnostic,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (4)
27Document document, ImmutableArray<Diagnostic> diagnostics, 28Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 32var pragmaDiagnosticsBuilder = ArrayBuilder<Diagnostic>.GetInstance(); 34foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && !d.IsSuppressed))
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (3)
20private readonly Diagnostic _diagnostic; 27Diagnostic diagnostic, 41Diagnostic diagnostic,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (9)
35Document document, ImmutableArray<Diagnostic> diagnostics, 36Action<(Diagnostic diagnostic, CodeAction action)> onItemFound, 41using var _2 = ArrayBuilder<Diagnostic>.GetInstance(out var pragmaDiagnosticsBuilder); 43foreach (var diagnostic in diagnostics.Where(d => d.Location.IsInSource && d.IsSuppressed)) 85Project project, ImmutableArray<Diagnostic> diagnostics, 86ConcurrentBag<(Diagnostic diagnostic, CodeAction action)> bag, 89foreach (var diagnostic in diagnostics.Where(d => !d.Location.IsInSource && d.IsSuppressed)) 106ImmutableArray<(Diagnostic diagnostic, CodeAction action)> batchOfFixes, 119var newBatchOfFixes = new List<(Diagnostic diagnostic, CodeAction action)>();
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.cs (3)
21private readonly Diagnostic _diagnostic; 28Diagnostic diagnostic, 50Diagnostic diagnostic,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (2)
29Diagnostic diagnostic, 38Diagnostic diagnostic,
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (5)
35Diagnostic diagnostic, 49Diagnostic diagnostic, 118private static bool CanRemovePragmaTrivia(SyntaxToken token, Diagnostic diagnostic, AbstractSuppressionCodeFixProvider fixer, bool isStartToken, out int indexOfTriviaToRemove) 212var dummyDiagnosticWithLocationToCheck = Diagnostic.Create(_diagnostic.Descriptor, locationToCheck);
CodeFixes\Suppression\SuppressionHelpers.cs (7)
20public static bool CanBeSuppressed(Diagnostic diagnostic) 23public static bool CanBeSuppressedWithAttribute(Diagnostic diagnostic) 35public static bool CanBeUnsuppressed(Diagnostic diagnostic) 38private static bool CanBeSuppressedOrUnsuppressed(Diagnostic diagnostic, bool checkCanBeSuppressed) 70public static bool IsNotConfigurableDiagnostic(Diagnostic diagnostic) 76public static bool IsCompilerDiagnostic(Diagnostic diagnostic) 82public static bool IsSynthesizedExternalSourceDiagnostic(Diagnostic diagnostic)
CodeFixes\Suppression\TopLevelSuppressionCodeAction.cs (1)
12internal sealed class TopLevelSuppressionCodeAction(Diagnostic diagnostic, ImmutableArray<NestedSuppressionCodeAction> nestedActions) : AbstractConfigurationActionWithNestedActions(ImmutableArray<CodeAction>.CastUp(nestedActions), string.Format(FeaturesResources.Suppress_0, diagnostic.Id))
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
193foreach (var diagnostic in attribute.GetDiagnostics())
Copilot\ICopilotCodeAnalysisService.cs (2)
54Task<ImmutableArray<Diagnostic>> GetCachedDocumentDiagnosticsAsync(Document document, TextSpan? span, ImmutableArray<string> promptTitles, CancellationToken cancellationToken); 62Task StartRefinementSessionAsync(Document oldDocument, Document newDocument, Diagnostic? primaryDiagnostic, CancellationToken cancellationToken);
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
81context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptor, typeName.GetLocation(), typeName.ToString()));
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
571var syntaxError = syntaxDiagnostics.FirstOrDefault(d => d.Severity == DiagnosticSeverity.Error);
EditAndContinue\DebuggingSession.cs (8)
40private readonly Dictionary<ProjectId, (Guid Mvid, Diagnostic Error)> _projectModuleIds = []; 248internal async Task<(Guid Mvid, Diagnostic? Error)> GetProjectModuleIdAsync(Project project, CancellationToken cancellationToken) 260(Guid Mvid, Diagnostic? Error) ReadMvid() 275return (Mvid: Guid.Empty, Error: Diagnostic.Create(descriptor, Location.None, [outputs.AssemblyDisplayPath, e.Message])); 316out ImmutableArray<Diagnostic> diagnostics, 362out ImmutableArray<Diagnostic> diagnostics, 416diagnostics = [Diagnostic.Create(descriptor, Location.None, [fileBeingRead, e.Message])]; 443public async ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\DocumentAnalysisResults.cs (3)
41public Diagnostic? SyntaxError { get; } 112Diagnostic? syntaxError, 191public static DocumentAnalysisResults SyntaxErrors(DocumentId documentId, string filePath, ImmutableArray<RudeEditDiagnostic> rudeEdits, Diagnostic? syntaxError, TimeSpan elapsedTime, bool hasChanges)
EditAndContinue\EditAndContinueService.cs (1)
213public ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
EditAndContinue\EditSession.cs (11)
118private async Task<Diagnostic?> GetUnsupportedChangesDiagnosticAsync(EmitDifferenceResult emitResult, CancellationToken cancellationToken) 140return Diagnostic.Create(descriptor, Location.None); 151public async Task<ImmutableArray<Diagnostic>?> GetModuleDiagnosticsAsync(Guid mvid, Project oldProject, Project newProject, ImmutableArray<DocumentAnalysisResults> documentAnalyses, CancellationToken cancellationToken) 163return ImmutableArray<Diagnostic>.Empty; 169using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnostics); 173diagnostics.Add(Diagnostic.Create(descriptor, location, messageArgs)); 526private async Task<(ImmutableArray<DocumentAnalysisResults> results, ImmutableArray<Diagnostic> diagnostics)> AnalyzeDocumentsAsync( 531using var _1 = ArrayBuilder<Diagnostic>.GetInstance(out var documentDiagnostics); 546documentDiagnostics.Add(Diagnostic.Create(descriptor, Location.Create(newDocument.FilePath!, textSpan: default, lineSpan: default), [newDocument.FilePath])); 813Diagnostic? syntaxError = null; 1046var unsupportedChangesDiagnostic = await GetUnsupportedChangesDiagnosticAsync(emitResult, cancellationToken).ConfigureAwait(false);
EditAndContinue\EditSessionTelemetry.cs (1)
126public void LogProjectAnalysisSummary(ProjectAnalysisSummary summary, Guid projectTelemetryId, ImmutableArray<Diagnostic> emitDiagnostics)
EditAndContinue\IEditAndContinueService.cs (1)
22ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken);
EditAndContinue\ProjectDiagnostics.cs (2)
12internal readonly record struct ProjectDiagnostics(ProjectId ProjectId, ImmutableArray<Diagnostic> Diagnostics); 24foreach (var diagnostic in projectDiagnostics)
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (2)
105var diagnostic = Diagnostic.Create(
EditAndContinue\RudeEditDiagnostic.cs (4)
41internal Diagnostic ToDiagnostic(SyntaxTree tree) 44return Diagnostic.Create(descriptor, tree.GetLocation(Span), Arguments); 56internal static bool IsBlockingRudeEdit(this Diagnostic diagnostic) 59public static bool HasBlockingRudeEdits(this ImmutableArray<Diagnostic> diagnostics)
EditAndContinue\SolutionUpdate.cs (3)
17Diagnostic? syntaxError) 24public readonly Diagnostic? SyntaxError = syntaxError; 29Diagnostic? syntaxError,
EditAndContinue\TraceLog.cs (1)
91public static implicit operator Arg(Diagnostic value) => new(value.ToString());
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (3)
46public void Fix(SyntaxEditor editor, Diagnostic diagnostic, CancellationToken cancellationToken) 59Document document, ImmutableArray<Diagnostic> diagnostics, 62foreach (var diagnostic in diagnostics)
ExternalAccess\VSTypeScript\Api\IVSTypeScriptDiagnosticAnalyzerImplementation.cs (3)
13Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken); 14Task<ImmutableArray<Diagnostic>> AnalyzeDocumentSyntaxAsync(Document document, CancellationToken cancellationToken); 15Task<ImmutableArray<Diagnostic>> AnalyzeDocumentSemanticsAsync(Document document, CancellationToken cancellationToken);
ExternalAccess\VSTypeScript\VSTypeScriptDocumentDiagnosticAnalyzer.cs (4)
18public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 23return SpecializedTasks.EmptyImmutableArray<Diagnostic>(); 29public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 34return SpecializedTasks.EmptyImmutableArray<Diagnostic>();
ExternalAccess\VSTypeScript\VSTypeScriptProjectDiagnosticAnalyzer.cs (2)
18public override Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken) 23return SpecializedTasks.EmptyImmutableArray<Diagnostic>();
ExtractMethod\Extensions.cs (1)
52var set = new HashSet<Diagnostic>(node.GetDiagnostics());
PreferFrameworkType\PreferFrameworkTypeCodeFixProvider.cs (4)
32var diagnostic = context.Diagnostics[0]; 47Document document, ImmutableArray<Diagnostic> diagnostics, 53foreach (var diagnostic in diagnostics) 68protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic)
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (3)
41var diagnostic = context.Diagnostics.First(); 60protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor syntaxEditor, CancellationToken cancellationToken) 71foreach (var diagnostic in diagnostics)
SemanticSearch\AbstractSemanticSearchService.cs (1)
107foreach (var diagnostic in emitResult.Diagnostics)
SimplifyThisOrMe\AbstractSimplifyThisOrMeCodeFixProvider.cs (1)
43Document document, ImmutableArray<Diagnostic> diagnostics,
SimplifyTypeNames\AbstractSimplifyTypeNamesCodeFixProvider.cs (2)
102Document document, ImmutableArray<Diagnostic> diagnostics, 109foreach (var diagnostic in diagnostics)
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
50context.ReportDiagnostic(Diagnostic.Create(Descriptor, location));
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderDiagnosticAnalyzer.cs (2)
71context.ReportDiagnostic(Diagnostic.Create(s_missingHeaderDescriptor, fileHeader.GetLocation(tree))); 78context.ReportDiagnostic(Diagnostic.Create(s_invalidHeaderDescriptor, fileHeader.GetLocation(tree)));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (1)
98context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (22)
22/// Creates a <see cref="Diagnostic"/> instance. 31/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 35/// can convey more detailed information to the fixer. If null, <see cref="Diagnostic.Properties"/> will return 39/// <returns>The <see cref="Diagnostic"/> instance.</returns> 40public static Diagnostic Create( 79/// <see cref="Diagnostic.AdditionalLocations"/>. 84/// <see cref="Diagnostic.AdditionalLocations"/>. 87/// <returns>The <see cref="Diagnostic"/> instance.</returns> 88public static Diagnostic CreateWithLocationTags( 107private static Diagnostic CreateWithLocationTags( 143/// <see cref="Diagnostic.AdditionalLocations"/>. 148/// <see cref="Diagnostic.AdditionalLocations"/>. 155/// <returns>The <see cref="Diagnostic"/> instance.</returns> 156public static Diagnostic CreateWithLocationTags( 177public static Diagnostic CreateWithLocationTags( 203private static Diagnostic CreateWithLocationTags( 237/// Creates a <see cref="Diagnostic"/> instance. 246/// If null, <see cref="Diagnostic.AdditionalLocations"/> will return an empty list. 250/// can convey more detailed information to the fixer. If null, <see cref="Diagnostic.Properties"/> will return 254/// <returns>The <see cref="Diagnostic"/> instance.</returns> 255public static Diagnostic CreateWithMessage( 270return Diagnostic.Create(
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
127var diagnostic = DiagnosticHelper.Create(
src\Analyzers\Core\Analyzers\NamingStyle\NamingStyleDiagnosticAnalyzerBase.cs (3)
67var diagnostic = TryGetDiagnostic( 94var diagnostic = TryGetDiagnostic( 111private Diagnostic? TryGetDiagnostic(
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
74var diagnostic = Diagnostic.Create(
src\Analyzers\Core\Analyzers\RemoveRedundantEquality\AbstractRemoveRedundantEqualityDiagnosticAnalyzer.cs (1)
112context.ReportDiagnostic(Diagnostic.Create(Descriptor,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryCast\AbstractRemoveUnnecessaryCastDiagnosticAnalyzer.cs (3)
45var diagnostic = TryRemoveCastExpression( 56private Diagnostic? TryRemoveCastExpression(SemanticModel model, TCastExpression node, CancellationToken cancellationToken) 71return Diagnostic.Create(
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (6)
108foreach (var diagnostic in diagnostics) 137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None)); 193private static IEnumerable<Diagnostic> CreateClassificationDiagnostics( 204yield return Diagnostic.Create(descriptor, tree.GetLocation(span)); 211private IEnumerable<Diagnostic> CreateFixableDiagnostics( 217yield return Diagnostic.Create(s_fixableIdDescriptor, tree.GetLocation(span));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryAttributeSuppressionsDiagnosticAnalyzer.cs (4)
74public void AnalyzeAssemblyOrModuleAttribute(SyntaxNode attributeSyntax, SemanticModel model, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 83reportDiagnostic(Diagnostic.Create(s_invalidScopeDescriptor, attributeSyntax.GetLocation())); 90reportDiagnostic(Diagnostic.Create(s_invalidOrMissingTargetDescriptor, attributeSyntax.GetLocation())); 113reportDiagnostic(Diagnostic.Create(LegacyFormatTargetDescriptor, targetValueOperation.Syntax.GetLocation(), properties!, targetSymbolString));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (20)
89Action<Diagnostic> reportDiagnostic, 389private static async Task<(ImmutableArray<Diagnostic> reportedDiagnostics, ImmutableArray<string> unhandledIds)> GetReportedDiagnosticsForIdsAsync( 450using var _3 = ArrayBuilder<Diagnostic>.GetInstance(out var reportedDiagnostics); 483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics) 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics) 495foreach (var diagnostic in perAnalyzerDiagnostics) 507ImmutableArray<Diagnostic> diagnostics, 516foreach (var diagnostic in diagnostics) 544Diagnostic diagnostic, 584Diagnostic diagnostic, 612Action<Diagnostic> reportDiagnostic, 616using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder); 622foreach (var diagnostic in effectiveDiagnostics) 630ArrayBuilder<Diagnostic> diagnosticsBuilder, 655var diagnostic = Diagnostic.Create(s_removeUnnecessarySuppressionDescriptor, pragma.GetLocation(), severity, additionalLocations, properties: null); 662ArrayBuilder<Diagnostic> diagnosticsBuilder, 670var diagnostic = Diagnostic.Create(s_removeUnnecessarySuppressionDescriptor, attribute.GetLocation(), severity, additionalLocations: null, properties: null);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
294public static bool TryGetUnusedValuePreference(Diagnostic diagnostic, out UnusedValuePreference preference) 315public static bool GetIsUnusedLocalDiagnostic(Diagnostic diagnostic) 321public static bool GetIsRemovableAssignmentDiagnostic(Diagnostic diagnostic)
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (2)
215var diagnostic = DiagnosticHelper.Create(s_expressionValueIsUnusedRule, 573var diagnostic = DiagnosticHelper.Create(s_valueAssignedIsUnusedRule,
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (2)
122Action<Diagnostic> reportDiagnostic, 146var diagnostic = DiagnosticHelper.CreateWithMessage(s_unusedParameterRule, location,
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
152context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
src\Analyzers\Core\Analyzers\SimplifyTypeNames\SimplifyTypeNamesDiagnosticAnalyzerBase.cs (5)
111protected abstract ImmutableArray<Diagnostic> AnalyzeCodeBlock(CodeBlockAnalysisContext context, SyntaxNode root); 112protected abstract ImmutableArray<Diagnostic> AnalyzeSemanticModel(SemanticModelAnalysisContext context, SyntaxNode root, TextSpanMutableIntervalTree? codeBlockIntervalTree); 114public bool TrySimplify(SemanticModel model, SyntaxNode node, [NotNullWhen(true)] out Diagnostic? diagnostic, TSimplifierOptions options, AnalyzerOptions analyzerOptions, CancellationToken cancellationToken) 135internal static Diagnostic CreateDiagnostic(SemanticModel model, TSimplifierOptions options, AnalyzerOptions analyzerOptions, TextSpan issueSpan, string diagnosticId, bool inDeclaration) 167var diagnostic = DiagnosticHelper.Create(descriptor, tree.GetLocation(issueSpan), notificationOption, analyzerOptions, additionalLocations: null, builder.ToImmutable());
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
671context.ReportDiagnostic(Diagnostic.Create(
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
99public static bool ChangesSemantics(Diagnostic diagnostic)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
357var diagnostic = Diagnostic.Create(
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (3)
28var diagnostic = context.Diagnostics.First(); 44Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\AddAnonymousTypeMemberName\AbstractAddAnonymousTypeMemberNameCodeFixProvider.cs (5)
38var diagnostic = context.Diagnostics[0]; 54Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 84Document document, ImmutableArray<Diagnostic> diagnostics, 92foreach (var diagnostic in diagnostics) 101Document document, SemanticModel semanticModel, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (2)
70var diagnostic = context.Diagnostics.First(); 214ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddObsoleteAttribute\AbstractAddObsoleteAttributeCodeFixProvider.cs (1)
72Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
55var diagnostic = context.Diagnostics.First(); 99SyntaxNode initialNode, SyntaxNode node, Diagnostic diagnostic)
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (4)
26protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 32var firstDiagnostic = context.Diagnostics[0]; 43Document document, ImmutableArray<Diagnostic> diagnostics, 48foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
392Document document, ImmutableArray<Diagnostic> diagnostics, 413foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (4)
20protected abstract Task<string> GetDescriptionAsync(Diagnostic diagnostic, SyntaxNode node, SemanticModel semanticModel, CancellationToken cancellationToken); 21protected abstract Task<Tuple<SyntaxTree, SyntaxNode>> GetRootInOtherSyntaxTreeAsync(SyntaxNode node, SemanticModel semanticModel, Diagnostic diagnostic, CancellationToken cancellationToken); 38var diagnostic = context.Diagnostics.FirstOrDefault(); 62SyntaxNode node, Document document, Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\ConvertTypeOfToNameOf\AbstractConvertTypeOfToNameOfCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 39foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\FileHeaders\AbstractFileHeaderCodeFixProvider.cs (1)
33foreach (var diagnostic in context.Diagnostics)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (3)
40protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 44Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\Formatting\FormattingCodeFixProvider.cs (3)
43foreach (var diagnostic in context.Diagnostics) 62private async Task<Document> FixOneAsync(CodeFixContext context, Diagnostic diagnostic, CancellationToken cancellationToken) 80protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorCodeFixProvider.cs (1)
24var diagnostic = context.Diagnostics.FirstOrDefault();
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberCodeFixProvider.cs (3)
28protected abstract bool IsCandidate(SyntaxNode node, SyntaxToken token, Diagnostic diagnostic); 39var diagnostic = context.Diagnostics.First(); 63TextSpan span, Diagnostic diagnostic)
src\Analyzers\Core\CodeFixes\Iterator\AbstractIteratorCodeFixProvider.cs (2)
24protected abstract Task<CodeAction> GetCodeFixAsync(SyntaxNode root, SyntaxNode node, Document document, Diagnostic diagnostics, CancellationToken cancellationToken); 34var diagnostic = context.Diagnostics.FirstOrDefault();
src\Analyzers\Core\CodeFixes\MakeFieldReadonly\AbstractMakeFieldReadonlyCodeFixProvider.cs (2)
40ImmutableArray<Diagnostic> diagnostics, 46foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (4)
20protected abstract bool IsSupportedDiagnostic(Diagnostic diagnostic, CancellationToken cancellationToken); 36var diagnostic = context.Diagnostics.First(); 104Diagnostic diagnostic, 147private SyntaxNode? GetContainingFunction(Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
32var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
32protected sealed override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor,
src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (2)
29protected override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 35foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (1)
42private static async Task<Solution> FixAllInDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (3)
51static async Task<ImmutableArray<Diagnostic>> GetSolutionDiagnosticsAsync(FixAllContext fixAllContext) 53var diagnostics = ImmutableArray.CreateBuilder<Diagnostic>(); 67ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
48var diagnostic = context.Diagnostics.First();
src\Analyzers\Core\CodeFixes\NewLines\ConsecutiveStatementPlacement\ConsecutiveStatementPlacementCodeFixProvider.cs (3)
32var diagnostic = context.Diagnostics.First(); 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 44public static async Task<Document> FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesCodeFixProvider.cs (4)
32var diagnostic = context.Diagnostics.First(); 41private static Task<Document> UpdateDocumentAsync(Document document, Diagnostic diagnostic, CancellationToken cancellationToken) 45Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 51foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 62foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (7)
57var diagnostic = context.Diagnostics.First(); 105Document document, Diagnostic diagnostic, 114Document document, ImmutableArray<Diagnostic> diagnostics, 124Document document, SyntaxEditor editor, ImmutableArray<Diagnostic> diagnostics, 128foreach (var diagnostic in diagnostics) 137Document document, SyntaxEditor editor, Diagnostic diagnostic, 221ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\QualifyMemberAccess\AbstractQualifyMemberAccessCodeFixProvider.cs (3)
23protected abstract TSimpleNameSyntax? GetNode(Diagnostic diagnostic, CancellationToken cancellationToken); 36Document document, ImmutableArray<Diagnostic> diagnostics, 41foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (3)
36var diagnostic = context.Diagnostics.First(); 64Document document, ImmutableArray<Diagnostic> diagnostics, 75foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesCodeFixProvider.cs (1)
35Document document, ImmutableArray<Diagnostic> diagnostics,
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryAttributeSuppressionsCodeFixProvider.cs (3)
30foreach (var diagnostic in context.Diagnostics) 40protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 42foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (3)
36foreach (var diagnostic in context.Diagnostics) 47protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 56foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (2)
44ImmutableArray<Diagnostic> diagnostics, 54foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (17)
135var diagnostic = context.Diagnostics[0]; 204private static bool IsForEachIterationVariableDiagnostic(Diagnostic diagnostic, Document document, CancellationToken cancellationToken) 215private static string GetEquivalenceKey(Diagnostic diagnostic) 234protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 240private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 241ImmutableArray<Diagnostic> diagnostics, 253foreach (var diagnostic in diagnostics) 265private static IEnumerable<IGrouping<SyntaxNode, Diagnostic>> GetDiagnosticsGroupedByMember( 266ImmutableArray<Diagnostic> diagnostics, 273private static async Task<Document> PreprocessDocumentAsync(Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 285protected sealed override async Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 296ImmutableArray<Diagnostic> diagnostics, 347IEnumerable<Diagnostic> diagnostics, 384IOrderedEnumerable<Diagnostic> diagnostics, 400foreach (var diagnostic in diagnostics) 443IOrderedEnumerable<Diagnostic> diagnostics, 676foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\SimplifyBooleanExpression\SimplifyConditionalCodeFixProvider.cs (2)
39ImmutableArray<Diagnostic> diagnostics, 61SyntaxNode SimplifyConditional(SemanticModel semanticModel, Diagnostic diagnostic, SyntaxNode expr)
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (2)
50Document document, ImmutableArray<Diagnostic> diagnostics, 58foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\SimplifyLinqExpression\SimplifyLinqExpressionCodeFixProvider.cs (2)
35ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics.OrderByDescending(diagnostics => diagnostics.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\UpdateLegacySuppressions\UpdateLegacySuppressionsCodeFixProvider.cs (3)
31foreach (var diagnostic in context.Diagnostics) 41protected override Task FixAllAsync(Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken) 43foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
21public abstract string SuggestedVersion(ImmutableArray<Diagnostic> diagnostics);
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullStatementCheckCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 42foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForNullableTernaryConditionalCheckCodeFixProvider.cs (3)
28protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 38Document document, ImmutableArray<Diagnostic> diagnostics, 49foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseCoalesceExpression\UseCoalesceExpressionForTernaryConditionalCheckCodeFixProvider.cs (4)
29protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 39Document document, ImmutableArray<Diagnostic> diagnostics, 47foreach (var diagnostic in diagnostics) 60Diagnostic diagnostic, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCollectionExpression\AbstractUseCollectionExpressionCodeFixProvider.cs (1)
27protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken)
src\Analyzers\Core\CodeFixes\UseCompoundAssignment\AbstractUseCompoundAssignmentCodeFixProvider.cs (2)
53Document document, ImmutableArray<Diagnostic> diagnostics, 59foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (3)
41Document document, Diagnostic diagnostic, 45Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, 57foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
59Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
48Document document, Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseExplicitTupleName\UseExplicitTupleNameCodeFixProvider.cs (2)
35Document document, ImmutableArray<Diagnostic> diagnostics, 40foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseInferredMemberName\AbstractUseInferredMemberNameCodeFixProvider.cs (2)
32Document document, ImmutableArray<Diagnostic> diagnostics, 37foreach (var diagnostic in diagnostics)
src\Analyzers\Core\CodeFixes\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsCodeFixProvider.cs (4)
32private static bool IsSupportedDiagnostic(Diagnostic diagnostic) 37var diagnostic = context.Diagnostics.First(); 51Document document, ImmutableArray<Diagnostic> diagnostics, 59foreach (var diagnostic in diagnostics.OrderByDescending(d => d.Location.SourceSpan.Start))
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (5)
59protected override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 69Document document, ImmutableArray<Diagnostic> diagnostics, 75foreach (var diagnostic in diagnostics) 93Diagnostic diagnostic, 142Diagnostic diagnostic,
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (2)
36Document document, ImmutableArray<Diagnostic> diagnostics, 54foreach (var diagnostic in diagnostics)
SyncNamespaces\AbstractSyncNamespacesService.cs (13)
58private static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetDiagnosticsByProjectAsync( 64var builder = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 75private static async Task<ImmutableArray<Diagnostic>> GetDiagnosticsAsync( 98ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject, 104var firstDiagnostic = diagnosticsByProject 154private static readonly Task<IEnumerable<Diagnostic>> EmptyDiagnosticResult = Task.FromResult(Enumerable.Empty<Diagnostic>()); 156private readonly ImmutableDictionary<Project, ImmutableArray<Diagnostic>> _diagnosticsByProject; 158internal DiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsByProject) 163public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 168public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 176public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken) 179? Task.FromResult<IEnumerable<Diagnostic>>(diagnostics)
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
68foreach (var diagnostic in context.Diagnostics) 86Solution originalSolution, Solution currentSolution, Diagnostic diagnostic, CancellationToken cancellationToken) 272Diagnostic diagnostic,
Microsoft.CodeAnalysis.Features.Test.Utilities (13)
Diagnostics\DiagnosticProviderTestUtilities.cs (3)
15public static async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync( 26public static async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync( 37public static async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(
Diagnostics\TestDiagnosticAnalyzerDriver.cs (8)
38private async Task<IEnumerable<Diagnostic>> GetDiagnosticsAsync( 45var documentDiagnostics = SpecializedCollections.EmptyEnumerable<Diagnostic>(); 46var projectDiagnostics = SpecializedCollections.EmptyEnumerable<Diagnostic>(); 80public Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Document document, TextSpan? filterSpan) 83public async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project) 85var diagnostics = new List<Diagnostic>(); 98public Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, TextSpan span) 101public Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project)
EditAndContinue\MockEditAndContinueService.cs (2)
32public Func<Document, ActiveStatementSpanProvider, ImmutableArray<Diagnostic>>? GetDocumentDiagnosticsImpl; 58public ValueTask<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, ActiveStatementSpanProvider activeStatementSpanProvider, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features.UnitTests (15)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
54RudeEdits = [.. rudeEdits.Select(id => new ProjectDiagnostics(id, [Diagnostic.Create(EditAndContinueDiagnosticDescriptors.GetDescriptor(RudeEditKind.InternalError), location: null)]))],
EditAndContinue\RemoteEditAndContinueServiceTests.cs (8)
121var diagnostic = Diagnostic.Create(diagnosticDescriptor, Location.Create(syntaxTree, TextSpan.FromBounds(1, 1))); 199var documentDiagnostic = Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), new[] { "doc", "some error" }); 200var projectDiagnostic = Diagnostic.Create(diagnosticDescriptor1, Location.None, new[] { "proj", "some error" }); 201var syntaxError = Diagnostic.Create(diagnosticDescriptor1, Location.Create(syntaxTree, TextSpan.FromBounds(1, 2)), new[] { "doc", "syntax error" });
EditAndContinue\RudeEditDiagnosticTests.cs (4)
86var d = re.ToDiagnostic(tree); 92var d = re.ToDiagnostic(tree); 100var d = re.ToDiagnostic(tree); 109var d = re.ToDiagnostic(tree);
EditAndContinue\TraceLogTests.cs (2)
20var diagnostic = Diagnostic.Create(EditAndContinueDiagnosticDescriptors.GetDescriptor(EditAndContinueErrorCode.ErrorReadingFile), Location.None, "file", "error");
Microsoft.CodeAnalysis.InteractiveHost (4)
Interactive\Core\InteractiveHost.Service.cs (4)
530foreach (var error in args.Errors) 773private void DisplayInteractiveErrors(ImmutableArray<Diagnostic> diagnostics, TextWriter output) 775var displayedDiagnostics = new List<Diagnostic>(); 786foreach (var diagnostic in displayedDiagnostics)
Microsoft.CodeAnalysis.LanguageServer.Protocol (52)
Features\CodeFixes\CodeFixService.cs (13)
502var uniqueDiagosticToEquivalenceKeysMap = new Dictionary<Diagnostic, PooledHashSet<string?>>(); 507var diagnosticAndEquivalenceKeyToFixersMap = new Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider>(); 619ImmutableArray<Diagnostic> diagnostics, 620Dictionary<Diagnostic, PooledHashSet<string?>> uniqueDiagosticToEquivalenceKeysMap, 621Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap, 655static ImmutableArray<Diagnostic> FilterApplicableDiagnostics( 656ImmutableArray<Diagnostic> applicableDiagnostics, 659Dictionary<Diagnostic, PooledHashSet<string?>> uniqueDiagosticToEquivalenceKeysMap, 660Dictionary<(Diagnostic diagnostic, string? equivalenceKey), CodeFixProvider> diagnosticAndEquivalenceKeyToFixersMap) 662using var disposer = ArrayBuilder<Diagnostic>.GetInstance(out var newApplicableDiagnostics); 663foreach (var diagnostic in applicableDiagnostics) 738Func<Diagnostic, bool> hasFix, 739Func<ImmutableArray<Diagnostic>, Task<ImmutableArray<CodeFix>>> getFixes,
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (4)
44public override async Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 52public override async Task<IEnumerable<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan fixAllSpan, CancellationToken cancellationToken) 62public override async Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 69public override async Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Features\CodeFixes\CodeFixService.FixAllPredefinedDiagnosticProvider.cs (8)
19private readonly ImmutableArray<Diagnostic> _diagnostics; 21public FixAllPredefinedDiagnosticProvider(ImmutableArray<Diagnostic> diagnostics) 24public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 25=> Task.FromResult<IEnumerable<Diagnostic>>(_diagnostics); 27public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 28=> Task.FromResult<IEnumerable<Diagnostic>>(_diagnostics); 30public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken) 31=> SpecializedTasks.EmptyEnumerable<Diagnostic>();
Features\Diagnostics\DocumentAnalysisExecutor.cs (3)
199private async Task<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(Project project, CancellationToken cancellationToken) 370static bool IsUnusedImportDiagnostic(Diagnostic d) 385bool shouldInclude(Diagnostic d) => span.Value.IntersectsWith(d.Location.SourceSpan) && !IsUnusedImportDiagnostic(d);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (18)
56internal static Diagnostic CreateAnalyzerExceptionDiagnostic(DiagnosticAnalyzer analyzer, Exception e) 72return Diagnostic.Create(descriptor, Location.None, analyzerName, e.GetType(), e.Message); 239public static async Task<ImmutableArray<Diagnostic>> ComputeDocumentDiagnosticAnalyzerDiagnosticsAsync( 248ImmutableArray<Diagnostic> diagnostics; 280public static async Task<ImmutableArray<Diagnostic>> ComputeProjectDiagnosticAnalyzerDiagnosticsAsync( 288ImmutableArray<Diagnostic> diagnostics; 317private static async Task VerifyDiagnosticLocationsAsync(ImmutableArray<Diagnostic> diagnostics, Project project, CancellationToken cancellationToken) 319foreach (var diagnostic in diagnostics) 401public static IEnumerable<DiagnosticData> ConvertToLocalDiagnostics(IEnumerable<Diagnostic> diagnostics, TextDocument targetTextDocument, TextSpan? span = null) 403foreach (var diagnostic in diagnostics) 418static bool IsReportedInDocument(Diagnostic diagnostic, TextDocument targetTextDocument) 437internal static bool AreEquivalent(Diagnostic[] diagnosticsA, Diagnostic[] diagnosticsB) 439var set = new HashSet<Diagnostic>(diagnosticsA, DiagnosticComparer.Instance); 443private sealed class DiagnosticComparer : IEqualityComparer<Diagnostic?> 447public bool Equals(Diagnostic? x, Diagnostic? y) 457public int GetHashCode(Diagnostic? obj)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
331foreach (var generatorDiagnostic in generatorDiagnostics)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
91public async Task<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(Project project, CancellationToken cancellationToken)
Features\UnifiedSuggestions\UnifiedSuggestedActions\IFixAllCodeFixSuggestedAction.cs (1)
16Diagnostic Diagnostic { get; }
Features\UnifiedSuggestions\UnifiedSuggestedActions\UnifiedFixAllCodeFixSuggestedAction.cs (2)
17public Diagnostic Diagnostic { get; } 26Diagnostic diagnostic)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
213Diagnostic firstDiagnostic,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (12)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (4)
379public override Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 380=> SpecializedTasks.EmptyImmutableArray<Diagnostic>(); 382public override Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 385Diagnostic.Create(Descriptor, Location.Create(document.FilePath!, default, default))));
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
138=> context.ReportDiagnostic(Diagnostic.Create(_descriptor,
Diagnostics\NonLocalDiagnosticTests.cs (4)
94var diagnostic = Diagnostic.Create(NonLocalDescriptor, root.GetFirstToken().GetLocation()); 105var diagnostic = Diagnostic.Create(CompilationEndDescriptor, root.GetFirstToken().GetLocation());
Diagnostics\PullDiagnosticTests.cs (2)
137context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Tree.GetRoot(context.CancellationToken).GetLocation()))); 151context.ReportDiagnostic(Diagnostic.Create(_descriptor, context.Node.GetLocation())),
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
87=> context.ReportDiagnostic(Diagnostic.Create(_descriptor, location: null, "args"));
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\EditAndContinue\RemoteEditAndContinueService.cs (2)
172var diagnostic = Diagnostic.Create(descriptor, Location.None, [e.Message]);
Microsoft.CodeAnalysis.Remote.Workspaces (2)
EditAndContinue\ManagedHotReloadLanguageService.cs (2)
302var diagnostic = Diagnostic.Create(
Microsoft.CodeAnalysis.Scripting (7)
CompilationErrorException.cs (2)
20public ImmutableArray<Diagnostic> Diagnostics { get; } 22public CompilationErrorException(string message, ImmutableArray<Diagnostic> diagnostics)
Hosting\CommandLine\CommandLineRunner.cs (2)
132var errors = Compiler.Arguments.Errors.Concat(diagnosticsInfos.Select(Diagnostic.Create)); 378private void DisplayDiagnostics(ImmutableArray<Diagnostic> diagnostics)
Script.cs (3)
232public ImmutableArray<Diagnostic> Compile(CancellationToken cancellationToken = default(CancellationToken)) 235internal abstract ImmutableArray<Diagnostic> CommonCompile(CancellationToken cancellationToken); 359internal override ImmutableArray<Diagnostic> CommonCompile(CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Test.Utilities (226)
AssemblyLoadTestFixture.cs (1)
523CSharpCompilationOptions options = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: Diagnostic.MaxWarningLevel);
Compilation\DiagnosticBagErrorLogger.cs (1)
19public override void LogDiagnostic(Diagnostic diagnostic, SuppressionInfo? suppressionInfo)
Compilation\Exceptions.cs (2)
19public IEnumerable<Diagnostic> Diagnostics { get; } 21public EmitException(IEnumerable<Diagnostic> diagnostics, string directory)
Compilation\IRuntimeEnvironment.cs (1)
398ImmutableArray<Diagnostic> GetDiagnostics();
Compilation\NullErrorLogger.cs (1)
14public override void LogDiagnostic(Diagnostic diagnostic, SuppressionInfo? suppressionInfo)
CompilationVerifier.cs (2)
36private ImmutableArray<Diagnostic> _diagnostics; 57internal ImmutableArray<Diagnostic> Diagnostics => _diagnostics;
Diagnostics\BoxingOperationAnalyzer.cs (1)
79context.ReportDiagnostic(Diagnostic.Create(BoxingDescriptor, boxingExpression.GetLocation()));
Diagnostics\CommonDiagnosticAnalyzers.cs (92)
72context.ReportDiagnostic(Diagnostic.Create(Descriptor1, location, s_properties)); 77context.ReportDiagnostic(Diagnostic.Create(Descriptor2, Location.None, s_properties))); 522foreach (var diagnostic in context.ReportedDiagnostics) 564compilationContext.ReportDiagnostic(Diagnostic.Create(EnabledRule, Location.None)); 567compilationContext.ReportDiagnostic(Diagnostic.Create(DisabledRule, Location.None)); 610codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockTopLevelRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 619codeBlockContext.ReportDiagnostic(Diagnostic.Create(CodeBlockPerCompilationRule, codeBlockContext.OwningSymbol.Locations[0], codeBlockContext.OwningSymbol.Name)); 658syntaxNodeContext.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptor, syntaxNodeContext.Node.GetLocation())); 688context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation())); 728context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation())); 766context.ReportDiagnostic(Diagnostic.Create(Rule, context.Symbol.Locations[0])); 798context.ReportDiagnostic(Diagnostic.Create(Rule, ns.Locations[0])); 825compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 856compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 877compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 904c.ReportDiagnostic(Diagnostic.Create(Descriptor, SourceLocation.Create(c.Tree, _badSpan))); 948private void ReportDiagnostic(Action<Diagnostic> addDiagnostic, ActionKind actionKindBeingRun) 952var diagnostic = _testInvalidAdditionalLocation ? 953Diagnostic.Create(Descriptor, Location.None, additionalLocations: new[] { _invalidLocation }) : 954Diagnostic.Create(Descriptor, _invalidLocation); 1003symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0])); 1043symbolContext.ReportDiagnostic(Diagnostic.Create(Rule, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name)); 1081context.ReportDiagnostic(Diagnostic.Create(Descriptor, tree.GetRoot().GetLocation())); 1107Diagnostic.Create(Descriptor, context.SemanticModel.SyntaxTree.GetRoot().GetLocation()))); 1177var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 1219var diagnostic = Diagnostic.Create(Descriptor, symbolContext.Symbol.Locations[0]); 1261private void ReportDiagnostic(Action<Diagnostic> addDiagnostic, Location location) 1263var diagnostic = Diagnostic.Create(Descriptor, location, _actionKind); 1392var diagnostic = Diagnostic.Create(Descriptor, c.OwningSymbol.Locations[0], c.OwningSymbol.Name, operationRoot.Kind); 1443private static void AnalyzerFieldReferenceOperation(IFieldReferenceOperation operation, Action<Diagnostic> reportDiagnostic) 1445var diagnostic = Diagnostic.Create(Descriptor, operation.Syntax.GetLocation(), operation.Field.Name, operation.Field.ConstantValue); 1466var diagnostic = Diagnostic.Create(Descriptor, operationContext.Operation.Syntax.GetLocation(), operationContext.ContainingSymbol.Name); 1653var diagnostic = Diagnostic.Create(rule, Location.None, args); 1658private void ReportSymbolDiagnostics(ISymbol symbol, Action<Diagnostic> addDiagnostic) 1663private void ReportTreeDiagnostics(SyntaxTree tree, Action<Diagnostic> addDiagnostic) 1668private void ReportDiagnosticsCore(Action<Diagnostic> addDiagnostic, Location location, params object[] messageArguments) 1671var diagnostic = Diagnostic.Create(Warning, location, messageArguments); 1675diagnostic = Diagnostic.Create(Error, location, messageArguments); 1706var diagnostic = Diagnostic.Create(Rule, namedType.Locations[0], namedType.Name, namedTypes.Count); 1814var diagnostic = Diagnostic.Create(descriptor, symbolContext.Symbol.Locations[0], symbolContext.Symbol.Name); 1823var diagnostic = Diagnostic.Create(descriptor, Location.None, treeContext.Tree.FilePath); 1827diagnostic = Diagnostic.Create(UniqueTextFileDescriptor, Location.None, treeContext.Tree.FilePath); 1838var diagnostic = Diagnostic.Create(NumberOfUniqueTextFileDescriptor, Location.None, _textCallbackSet.Count); 1864context.ReportDiagnostic(Diagnostic.Create(ParameterDescriptor, context.Symbol.Locations[0])); 1978var diagnostics = new ConcurrentBag<Diagnostic>(); 2034compilationEndContext.ReportDiagnostic(Diagnostic.Create(SymbolStartedEndedDifferRule, Location.None, symbolsStartedStr, symbolsEndedStr, _analyzerId)); 2037foreach (var diagnostic in diagnostics) 2049diagnostics.Add(Diagnostic.Create(DuplicateStartActionRule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 2059diagnostics.Add(Diagnostic.Create(DuplicateEndActionRule, Location.None, symbolEndContext.Symbol.Name, _analyzerId)); 2064symbolEndContext.ReportDiagnostic(Diagnostic.Create(rule, Location.None, symbolStartContext.Symbol.Name, _analyzerId)); 2074operationContext.ReportDiagnostic(Diagnostic.Create(OperationRule, Location.None, symbolStartContext.Symbol.Name, operationContext.ContainingSymbol.Name, operationContext.Operation.Syntax.ToString(), _analyzerId)); 2110diagnostics.Add(Diagnostic.Create(SymbolStartedOrderingRule, Location.None, member, symbolStarted, _analyzerId)); 2134diagnostics.Add(Diagnostic.Create(SymbolEndedOrderingRule, Location.None, container, symbolEnded, _analyzerId)); 2149diagnostics.Add(Diagnostic.Create(OperationOrderingRule, Location.None, symbolStartContext.Symbol, operationContext.Operation.Syntax.ToString(), _analyzerId)); 2173foreach (var diagnostic in context.ReportedDiagnostics) 2204foreach (var diagnostic in context.ReportedDiagnostics) 2306foreach (var diagnostic in context.ReportedDiagnostics) 2338foreach (var diagnostic in context.ReportedDiagnostics) 2370var nonReportedDiagnostic = Diagnostic.Create( 2455Diagnostic.Create(_rule, Location.None, GetSortedSymbolCallbacksString()))); 2462private void ReportDiagnostic(ISymbol symbol, Action<Diagnostic> reportDiagnostic) 2463=> reportDiagnostic(Diagnostic.Create(_rule, symbol.Locations[0], symbol.Name)); 2486compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 2542var diagnostic = Diagnostic.Create(Descriptor, context.Symbol.Locations[0], _reportedSeverity, additionalLocations: null, properties: null, messageArgs: null); 2570endContext => endContext.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.OwningSymbol.Locations[0]))); 2603context.ReportDiagnostic(Diagnostic.Create(Descriptor, variable.Identifier.GetLocation())); 2610context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Symbol.Locations[0])), 2661context.ReportDiagnostic(Diagnostic.Create(Descriptor, location)); 2697context.ReportDiagnostic(Diagnostic.Create(s_descriptor, context.Tree.GetRoot().GetLocation())); 2821private static void ReportSymbolDiagnostics(string actionName, ISymbol symbol, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2832private static void ReportDiagnosticsInAllTrees(string actionName, SyntaxTree analyzedTree, Compilation compilation, Action<Diagnostic> reportDiagnostic) 2841private static void ReportDiagnostics(string actionName, SyntaxTree tree, ISymbol containingSymbol, Action<Diagnostic> reportDiagnostic) 2847private static void ReportDiagnosticsInTreeCore(string arg, SyntaxTree tree, Action<Diagnostic> reportDiagnostic) 2852reportDiagnostic(Diagnostic.Create(s_descriptor, localDecl.GetLocation(), arg)); 2882context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Node.GetLocation())), 2888context => context.ReportDiagnostic(Diagnostic.Create(Descriptor, context.Operation.Syntax.GetLocation())), 2951private void HandleCallback(Location analysisLocation, Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 2968reportDiagnostic(Diagnostic.Create(s_descriptor, analysisLocation));
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (2)
295context.ReportDiagnostic(Diagnostic.Create(descriptor, local.Locations.FirstOrDefault(), local, moreSpecificType)); 300context.ReportDiagnostic(Diagnostic.Create(descriptor, field.Locations.FirstOrDefault(), field, moreSpecificType));
Diagnostics\DiagnosticDescription.cs (7)
123public DiagnosticDescription(Diagnostic d, bool errorCodeOnly, bool includeDefaultSeverity = false, bool includeEffectiveSeverity = false) 487public static string GetAssertText(DiagnosticDescription[] expected, IEnumerable<Diagnostic> actual, DiagnosticDescription[] unmatchedExpected, IEnumerable<Diagnostic> unmatchedActual) 521Diagnostic d = e.Current; 567Diagnostic d = e.Current; 582private static IEnumerable<Diagnostic> Sort(IEnumerable<Diagnostic> diagnostics)
Diagnostics\DiagnosticExtensions.cs (29)
31public static void VerifyErrorCodes(this IEnumerable<Diagnostic> actual, params DiagnosticDescription[] expected) 36public static void VerifyErrorCodes(this ImmutableArray<Diagnostic> actual, params DiagnosticDescription[] expected) 38VerifyErrorCodes((IEnumerable<Diagnostic>)actual, expected); 46public static void Verify(this IEnumerable<Diagnostic> actual, params DiagnosticDescription[] expected) 51public static void Verify(this IEnumerable<Diagnostic> actual, bool fallbackToErrorCodeOnlyForNonEnglish, params DiagnosticDescription[] expected) 56public static void VerifyWithFallbackToErrorCodeOnlyForNonEnglish(this IEnumerable<Diagnostic> actual, params DiagnosticDescription[] expected) 61public static void Verify(this ImmutableArray<Diagnostic> actual, params DiagnosticDescription[] expected) 63Verify((IEnumerable<Diagnostic>)actual, expected); 66private static void Verify(IEnumerable<Diagnostic> actual, DiagnosticDescription[] expected, bool errorCodeOnly) 116TCompilation c, ImmutableArray<Diagnostic> diagnostics) where TCompilation : Compilation 118foreach (var diagnostic in diagnostics) 146Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null) 156Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 168Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 177public static ImmutableArray<Diagnostic> GetAnalyzerDiagnostics<TCompilation>( 181Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 188public static ImmutableArray<Diagnostic> GetAnalyzerDiagnostics<TCompilation>( 193Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 205Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 227Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 285Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException = null, 299Action<Exception, DiagnosticAnalyzer, Diagnostic> onAnalyzerException, 303out ImmutableArray<Diagnostic> diagnostics) 339public static IEnumerable<Diagnostic> GetEffectiveDiagnostics(this Compilation compilation, IEnumerable<Diagnostic> diagnostics) 360public static ImmutableArray<Diagnostic> GetEmitDiagnostics<TCompilation>( 376public static ImmutableArray<Diagnostic> GetEmitDiagnostics<TCompilation>(this TCompilation c) 445public static string Inspect(this Diagnostic e) 449public static string ToString(this Diagnostic d, IFormatProvider formatProvider)
Diagnostics\DiagnosticsHelper.cs (1)
25private static void VerifyDiagnostics(IEnumerable<Diagnostic> actualDiagnostics, params string[] expectedDiagnosticIds)
Diagnostics\EmptyArrayAnalyzer.cs (1)
56context.ReportDiagnostic(Diagnostic.Create(UseArrayEmptyDescriptor, arrayCreationExpression.GetLocation()));
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
144context.ReportDiagnostic(Diagnostic.Create(descriptor, field.Locations.FirstOrDefault()));
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
135context.ReportDiagnostic(Diagnostic.Create(descriptor, local.Locations.FirstOrDefault()));
Diagnostics\OperationTestAnalyzer.cs (64)
59operationContext.ReportDiagnostic(Diagnostic.Create(InvalidStatementDescriptor, operationContext.Operation.Syntax.GetLocation())); 63operationContext.ReportDiagnostic(Diagnostic.Create(InvalidExpressionDescriptor, operationContext.Operation.Syntax.GetLocation())); 73operationContext.ReportDiagnostic(Diagnostic.Create(IsInvalidDescriptor, operationContext.Operation.Syntax.GetLocation())); 109operationContext.ReportDiagnostic(Diagnostic.Create(ExpressionDescriptor, operationContext.Operation.Syntax.GetLocation())); 288context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 484context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 549operationContext.ReportDiagnostic(Diagnostic.Create(InvalidArgumentDescriptor, argument.Syntax.GetLocation())); 555operationContext.ReportDiagnostic(Diagnostic.Create(UseDefaultArgumentDescriptor, invocation.Syntax.GetLocation(), argument.Parameter.Name)); 601context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 635operationContext.ReportDiagnostic(Diagnostic.Create(SeventeenDescriptor, literal.Syntax.GetLocation())); 678context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 724context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 765context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 805context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 862context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 923context.ReportDiagnostic(Diagnostic.Create(descriptor, syntax.GetLocation())); 954operationContext.ReportDiagnostic(Diagnostic.Create(instanceReference.IsImplicit ? ImplicitInstanceDescriptor : ExplicitInstanceDescriptor, 1034operationContext.ReportDiagnostic(Diagnostic.Create(EventReferenceDescriptor, operationContext.Operation.Syntax.GetLocation())); 1042operationContext.ReportDiagnostic(Diagnostic.Create(eventAssignment.Adds ? HandlerAddedDescriptor : HandlerRemovedDescriptor, operationContext.Operation.Syntax.GetLocation())); 1046operationContext.ReportDiagnostic(Diagnostic.Create(InvalidEventDescriptor, eventAssignment.Syntax.GetLocation())); 1054operationContext.ReportDiagnostic(Diagnostic.Create(PropertyReferenceDescriptor, operationContext.Operation.Syntax.GetLocation())); 1061operationContext.ReportDiagnostic(Diagnostic.Create(FieldReferenceDescriptor, operationContext.Operation.Syntax.GetLocation())); 1068operationContext.ReportDiagnostic(Diagnostic.Create(MethodBindingDescriptor, operationContext.Operation.Syntax.GetLocation())); 1111operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation())); 1126operationContext.ReportDiagnostic(Diagnostic.Create(InvalidConstructorDescriptor, creation.Syntax.GetLocation())); 1138operationContext.ReportDiagnostic(Diagnostic.Create(LongParamsDescriptor, argument.Value.Syntax.GetLocation())); 1184operationContext.ReportDiagnostic(Diagnostic.Create(EqualsValueDescriptor, equalsValue.Syntax.GetLocation())); 1195operationContext.ReportDiagnostic(Diagnostic.Create(EqualsValueDescriptor, equalsValue.Syntax.GetLocation())); 1226operationContext.ReportDiagnostic(Diagnostic.Create(NoneOperationDescriptor, operationContext.Operation.Syntax.GetLocation())); 1262operationContext.ReportDiagnostic(Diagnostic.Create(AddressOfDescriptor, addressOfOperation.Syntax.GetLocation())); 1266operationContext.ReportDiagnostic(Diagnostic.Create(InvalidAddressOfReferenceDescriptor, addressOfOperation.Reference.Syntax.GetLocation())); 1314operationContext.ReportDiagnostic(Diagnostic.Create(LambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation())); 1323operationContext.ReportDiagnostic(Diagnostic.Create(TooManyStatementsInLambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation())); 1336operationContext.ReportDiagnostic(Diagnostic.Create(NoneOperationInLambdaExpressionDescriptor, operationContext.Operation.Syntax.GetLocation())); 1408operationContext.ReportDiagnostic(Diagnostic.Create(StaticMemberDescriptor, operation.Syntax.GetLocation())); 1412operationContext.ReportDiagnostic(Diagnostic.Create(StaticMemberWithInstanceDescriptor, operation.Syntax.GetLocation())); 1452operationContext.ReportDiagnostic(Diagnostic.Create(LabelDescriptor, operationContext.Operation.Syntax.GetLocation())); 1466operationContext.ReportDiagnostic(Diagnostic.Create(GotoDescriptor, branch.Syntax.GetLocation())); 1518operationContext.ReportDiagnostic(Diagnostic.Create(OperatorAddMethodDescriptor, binary.Syntax.GetLocation())); 1523operationContext.ReportDiagnostic(Diagnostic.Create(DoubleMultiplyDescriptor, binary.Syntax.GetLocation())); 1534operationContext.ReportDiagnostic(Diagnostic.Create(OperatorMinusMethodDescriptor, unary.Syntax.GetLocation())); 1539operationContext.ReportDiagnostic(Diagnostic.Create(BooleanNotDescriptor, unary.Syntax.GetLocation())); 1544operationContext.ReportDiagnostic(Diagnostic.Create(BooleanNotDescriptor, unary.Syntax.GetLocation())); 1573Diagnostic.Create(BinaryUserDefinedOperatorDescriptor, 1626Diagnostic.Create(BinaryOperatorDescriptor, 1650Diagnostic.Create(UnaryOperatorDescriptor, 1701Diagnostic.Create(NullOperationSyntaxDescriptor, null)); 1706Diagnostic.Create(ParamsArrayOperationDescriptor, 1791operationContext.ReportDiagnostic(Diagnostic.Create(InvalidBinaryDescriptor, binary.Syntax.GetLocation())); 1799operationContext.ReportDiagnostic(Diagnostic.Create(InvalidUnaryDescriptor, unary.Syntax.GetLocation())); 1807operationContext.ReportDiagnostic(Diagnostic.Create(InvalidIncrementDescriptor, inc.Syntax.GetLocation())); 1848operationContext.ReportDiagnostic(Diagnostic.Create(ConditionalAccessOperationDescriptor, conditionalAccess.Syntax.GetLocation())); 1857operationContext.ReportDiagnostic(Diagnostic.Create(ConditionalAccessInstanceOperationDescriptor, conditionalAccessInstance.Syntax.GetLocation())); 1897operationContext.ReportDiagnostic(Diagnostic.Create(InvalidConversionExpressionDescriptor, conversion.Syntax.GetLocation())); 1935operationContext.ReportDiagnostic(Diagnostic.Create(ForLoopConditionCrashDescriptor, forLoop.LimitValue.Syntax.GetLocation())); 1974operationContext.ReportDiagnostic(Diagnostic.Create(UnaryTrueDescriptor, unary.Syntax.GetLocation())); 1978operationContext.ReportDiagnostic(Diagnostic.Create(UnaryFalseDescriptor, unary.Syntax.GetLocation())); 2015operationContext.ReportDiagnostic(Diagnostic.Create(AssignmentOperationDescriptor, operationContext.Operation.Syntax.GetLocation())); 2023syntaxContext.ReportDiagnostic(Diagnostic.Create(AssignmentSyntaxDescriptor, syntaxContext.Node.GetLocation())); 2052operationContext.ReportDiagnostic(Diagnostic.Create(LiteralDescriptor, literal.Syntax.GetLocation(), literal.Syntax.ToString())); 2080Diagnostic.Create(OperationActionDescriptor, operationContext.Operation.Syntax.GetLocation(), "Operation", "Analysis")); 2111Diagnostic.Create(OperationActionDescriptor, operationContext.Operation.Syntax.GetLocation(), "Operation", "CompilationStart within Analysis")); 2143syntaxContext.ReportDiagnostic(Diagnostic.Create(GetOperationDescriptor, node.GetLocation())); 2155syntaxContext.ReportDiagnostic(Diagnostic.Create(GetOperationDescriptor, node.GetLocation()));
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (9)
43context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, Location.None, messageArgs: Id)); 69context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 100context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Symbol.Locations.First(), messageArgs: context.Symbol.Name)); 154context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end")); 160context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Node.GetLocation(), messageArgs: context.Node.ToFullString())); 173context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.OwningSymbol.Locations.First(), messageArgs: context.OwningSymbol.Name + ":end")); 179context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, context.Node.GetLocation(), messageArgs: context.Node.ToFullString())); 213context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, comment.GetLocation(), messageArgs: comment.ToFullString())); 248context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, nodeOrToken.GetLocation(), messageArgs: nodeOrToken.ToString()));
Diagnostics\ThrowingDiagnosticAnalyzer.cs (3)
61public static void VerifyAnalyzerEngineIsSafeAgainstExceptions(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 66public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, IEnumerable<Diagnostic>> runAnalysis) 71public static async Task VerifyAnalyzerEngineIsSafeAgainstExceptionsAsync(Func<DiagnosticAnalyzer, Task<IEnumerable<Diagnostic>>> runAnalysis)
ExceptionHelper.cs (2)
16internal static string GetMessageFromResult(IEnumerable<Diagnostic> diagnostics, string directory) 21foreach (var d in diagnostics)
Mocks\TestMessageProvider.cs (2)
21public override Diagnostic CreateDiagnostic(int code, Location location, params object[] args) 26public override Diagnostic CreateDiagnostic(DiagnosticInfo info)
Platform\Desktop\DesktopRuntimeEnvironment.cs (2)
82internal ImmutableArray<Diagnostic> Diagnostics; 288public ImmutableArray<Diagnostic> GetDiagnostics()
SourceGeneration\TestGenerators.cs (1)
69context.ReportDiagnostic(Diagnostic.Create(Descriptor, _produceLocation(context)));
Microsoft.CodeAnalysis.UnitTests (17)
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (1)
103new CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel));
CorLibTypesTests.cs (1)
69options: new CSharp.CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel),
Diagnostics\CompilationWithAnalyzersTests.cs (6)
19using SimpleDiagnostic = Diagnostic.SimpleDiagnostic; 23private static readonly CSharpCompilationOptions s_dllWithMaxWarningLevel = new(OutputKind.DynamicallyLinkedLibrary, warningLevel: CodeAnalysis.Diagnostic.MaxWarningLevel); 29var ds = new[] { (Diagnostic)null }; 31Assert.Throws<ArgumentNullException>(() => CompilationWithAnalyzers.GetEffectiveDiagnostics(default(ImmutableArray<Diagnostic>), c)); 43var d1 = SimpleDiagnostic.Create(MessageProvider.Instance, (int)ErrorCode.WRN_AlignmentMagnitude, "1", "2"); 44var d2 = SimpleDiagnostic.Create(MessageProvider.Instance, (int)ErrorCode.WRN_AlwaysNull, "1");
Diagnostics\DiagnosticCreationTests.cs (2)
20var diagnostic = Diagnostic.Create(descriptor, Location.None, effectiveSeverity, additionalLocations: null, properties: null);
Diagnostics\DiagnosticLocalizationTests.cs (4)
87var localizableDiagnostic = Diagnostic.Create(descriptor, Location.None); 302var exceptionDiagnostics = new List<Diagnostic>(); 304Action<Exception, DiagnosticAnalyzer, Diagnostic, CancellationToken> onAnalyzerException = (ex, a, diag, ct) => exceptionDiagnostics.Add(diag);
Diagnostics\SarifErrorLoggerTests.cs (3)
44logger.LogDiagnostic(Diagnostic.Create(descriptor, mainLocation, additionalLocations), null); 82logger.LogDiagnostic(Diagnostic.Create(descriptor, Location.None), null); 115logger.LogDiagnostic(Diagnostic.Create(
Microsoft.CodeAnalysis.VisualBasic (133)
Binding\Binder.vb (2)
894Public Shared Sub ReportDiagnostic(diagBag As DiagnosticBag, diag As Diagnostic) 924Public Shared Sub ReportDiagnostic(diagBag As BindingDiagnosticBag, diag As Diagnostic)
Binding\Binder_Expressions.vb (1)
1106For Each diag As Diagnostic In tree.GetDiagnostics(root)
Binding\MemberSemanticModel.vb (4)
413Public NotOverridable Overrides Function GetSyntaxDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 428Public NotOverridable Overrides Function GetDeclarationDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 443Public NotOverridable Overrides Function GetMethodBodyDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 460Public NotOverridable Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
CommandLine\CommandLineDiagnosticFormatter.vb (2)
30Public Overrides Function Format(diagnostic As Diagnostic, Optional formatter As IFormatProvider = Nothing) As String 130Private Function GetDiagnosticSpanAndFileText(diagnostic As Diagnostic, <Out> ByRef text As SourceText) As TextSpan?
CommandLine\VisualBasicCommandLineParser.vb (25)
82Dim diagnostics As List(Of Diagnostic) = New List(Of Diagnostic)() 238Dim conditionalCompilationDiagnostics As IEnumerable(Of Diagnostic) = Nothing 1589Private Shared Function GetWin32Setting(arg As String, value As String, diagnostics As List(Of Diagnostic)) As String 1639Private Shared Sub ValidateWin32Settings(noWin32Manifest As Boolean, win32ResSetting As String, win32IconSetting As String, win32ManifestSetting As String, outputKind As OutputKind, diagnostics As List(Of Diagnostic)) 1659Private Shared Function ParseTarget(optionName As String, value As String, diagnostics As IList(Of Diagnostic)) As OutputKind 1682Friend Shared Function ParseAssemblyReferences(name As String, value As String, diagnostics As IList(Of Diagnostic), embedInteropTypes As Boolean) As IEnumerable(Of CommandLineReference) 1693Private Shared Function ParseAnalyzers(name As String, value As String, diagnostics As IList(Of Diagnostic)) As IEnumerable(Of CommandLineAnalyzerReference) 1707Friend Overloads Shared Function ParseResourceDescription(name As String, resourceDescriptor As String, baseDirectory As String, diagnostics As IList(Of Diagnostic), embedded As Boolean) As ResourceDescription 1766Private Shared Sub AddInvalidSwitchValueDiagnostic(diagnostics As IList(Of Diagnostic), ByVal name As String, ByVal nullStringText As String) 1776Private Shared Sub ParseGlobalImports(value As String, globalImports As List(Of GlobalImport), errors As List(Of Diagnostic)) 1780Dim importDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 1793diagnosticBuilder As ArrayBuilder(Of Diagnostic)) As ImmutableDictionary(Of String, InternalSyntax.CConst) 1802diagnosticBuilder.Add(Diagnostic.Create(VisualBasic.MessageProvider.Instance, ERRID.ERR_InvalidPreprocessorConstantType, symbol.Key, symbol.Value.GetType())) 1839<Out> ByRef diagnostics As IEnumerable(Of Diagnostic), 1843Dim diagnosticBuilder = ArrayBuilder(Of Diagnostic).GetInstance() 2100Private Shared Iterator Function ParseInstrumentationKinds(value As String, diagnostics As IList(Of Diagnostic)) As IEnumerable(Of InstrumentationKind) 2147Private Shared Function ParsePlatform(name As String, value As String, errors As List(Of Diagnostic)) As Platform 2181Private Shared Function ParseFileAlignment(name As String, value As String, errors As List(Of Diagnostic)) As Integer 2204Private Shared Function ParseBaseAddress(name As String, value As String, errors As List(Of Diagnostic)) As ULong 2274Private Shared Sub UnimplementedSwitch(diagnostics As IList(Of Diagnostic), switchName As String) 2278Friend Overrides Sub GenerateErrorForNoFilesFoundInRecurse(path As String, errors As IList(Of Diagnostic)) 2282Private Shared Sub AddDiagnostic(diagnostics As IList(Of Diagnostic), errorCode As ERRID, ParamArray arguments As Object()) 2283diagnostics.Add(Diagnostic.Create(VisualBasic.MessageProvider.Instance, CInt(errorCode), arguments)) 2302Private Sub GetCompilationAndModuleNames(diagnostics As List(Of Diagnostic),
CommandLine\VisualBasicCompiler.vb (1)
305Private Protected Overrides Sub DiagnoseBadAccesses(consoleOutput As TextWriter, errorLogger As ErrorLogger, compilation As Compilation, diagnostics As ImmutableArray(Of Diagnostic))
Compilation\MethodCompiler.vb (2)
675If CType(method, SourceMethodSymbol).SetDiagnostics(ImmutableArray(Of Diagnostic).Empty) Then 1244If sourceMethod IsNot Nothing AndAlso sourceMethod.SetDiagnostics(ImmutableArray(Of Diagnostic).Empty) Then
Compilation\SpeculativeSemanticModelWithMemberModel.vb (4)
137Public Overrides Function GetSyntaxDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 141Public Overrides Function GetDeclarationDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 145Public Overrides Function GetMethodBodyDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 149Public Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Compilation\SpeculativeSyntaxTreeSemanticModel.vb (3)
113Public Overrides Function GetSyntaxDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 117Public Overrides Function GetDeclarationDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 121Public Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Compilation\SyntaxTreeSemanticModel.vb (4)
93Public Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 105Public Overrides Function GetSyntaxDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 120Public Overrides Function GetDeclarationDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 135Public Overrides Function GetMethodBodyDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Compilation\VisualBasicCompilation.vb (15)
120Private _lazyClsComplianceDiagnostics As ImmutableArray(Of Diagnostic) 1504Return New EntryPoint(Nothing, ImmutableArray(Of Diagnostic).Empty) 1508Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 1516Private Function FindEntryPoint(cancellationToken As CancellationToken, ByRef sealedDiagnostics As ImmutableArray(Of Diagnostic)) As MethodSymbol 1671Public ReadOnly Diagnostics As ImmutableArray(Of Diagnostic) 1673Public Sub New(methodSymbol As MethodSymbol, diagnostics As ImmutableArray(Of Diagnostic)) 2080Public Overrides Function GetDiagnostics(Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2089Public Overrides Function GetParseDiagnostics(Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2099Public Overrides Function GetDeclarationDiagnostics(Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2109Public Overrides Function GetMethodBodyDiagnostics(Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2122Friend Overloads Function GetDiagnostics(stage As CompilationStage, Optional includeEarlierStages As Boolean = True, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2233Private Shared Iterator Function FilterDiagnosticsByLocation(diagnostics As IEnumerable(Of Diagnostic), tree As SyntaxTree, filterSpanWithinTree As TextSpan?) As IEnumerable(Of Diagnostic) 2245Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic) 2289Return result.ToReadOnlyAndFree(Of Diagnostic)()
Compilation\VisualBasicDiagnosticFilter.vb (5)
13''' Applies Visual Basic-specific modification and filtering of <see cref="Diagnostic"/>s. 21''' Modifies an input <see cref="Diagnostic"/> per the given options. For example, the 22''' severity may be escalated, or the <see cref="Diagnostic"/> may be filtered out entirely 30diagnostic As Diagnostic, 34cancellationToken As CancellationToken) As Diagnostic
Errors\DiagnosticFormatter.vb (1)
27Friend Overrides Function HasDefaultHelpLinkUri(diagnostic As Diagnostic) As Boolean
Errors\ErrorFactories.vb (1)
130Return Diagnostic.CompilerDiagnosticCategory
Errors\MessageProvider.vb (2)
88Public Overrides Function CreateDiagnostic(code As Integer, location As Location, ParamArray args() As Object) As Diagnostic 92Public Overrides Function CreateDiagnostic(info As DiagnosticInfo) As Diagnostic
Errors\VBDiagnostic.vb (3)
21Friend Overrides Function WithLocation(location As Location) As Diagnostic 33Friend Overrides Function WithSeverity(severity As DiagnosticSeverity) As Diagnostic 41Friend Overrides Function WithIsSuppressed(isSuppressed As Boolean) As Diagnostic
GlobalImport.vb (5)
68Public Shared Function Parse(importedNames As String, <Out()> ByRef diagnostics As ImmutableArray(Of Diagnostic)) As GlobalImport 103Public Shared Function Parse(importedNames As IEnumerable(Of String), <Out()> ByRef diagnostics As ImmutableArray(Of Diagnostic)) As IEnumerable(Of GlobalImport) 106diagnostics = errors.ToReadOnlyAndFree(Of Diagnostic)() 111Friend Function MapDiagnostic(unmappedDiag As Diagnostic) As Diagnostic
OptionsValidator.vb (1)
41Dim syntaxErrors As IEnumerable(Of Diagnostic) = clause.GetSyntaxErrors(tree)
Symbols\Source\SourceAssemblySymbol.vb (1)
64Private _lazyAssemblyLevelDeclarationErrors As ImmutableArray(Of Diagnostic)
Symbols\Source\SourceFile.vb (1)
468Friend Function GetDeclarationErrorsInSpan(filterSpan As TextSpan, cancellationToken As CancellationToken) As IEnumerable(Of Diagnostic)
Symbols\Source\SourceMethodSymbol.vb (3)
56Private _cachedDiagnostics As ImmutableArray(Of Diagnostic) 565Friend ReadOnly Property Diagnostics As ImmutableArray(Of Diagnostic) 574Friend Function SetDiagnostics(diags As ImmutableArray(Of Diagnostic)) As Boolean
Symbols\Source\SourceModuleSymbol.vb (8)
81Private _lazyLinkedAssemblyDiagnostics As ImmutableArray(Of Diagnostic) 392For Each d As Diagnostic In diagBagForThisImport.DiagnosticBag.AsEnumerable() 586locationFilter As Func(Of IEnumerable(Of Diagnostic), SyntaxTree, TextSpan?, IEnumerable(Of Diagnostic)), 587cancellationToken As CancellationToken) As ImmutableArray(Of Diagnostic) 588Dim builder = ArrayBuilder(Of Diagnostic).GetInstance() 643For Each d As Diagnostic In declarationDiagnostics 1022For Each d As Diagnostic In diagBag.DiagnosticBag.AsEnumerableWithoutResolution()
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
80For Each diag As Diagnostic In tree.GetDiagnostics(root)
Syntax\SyntaxTreeDiagnosticEnumerator.vb (2)
31Private _current As Diagnostic 147Public ReadOnly Property Current As Diagnostic
Syntax\VisualBasicSyntaxNode.vb (10)
182Friend Shared EmptyErrorCollection As New ReadOnlyCollection(Of Diagnostic)(Array.Empty(Of Diagnostic)) 188Friend Function GetSyntaxErrors(tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic) 192Friend Shared Function DoGetSyntaxErrors(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken) As ReadOnlyCollection(Of Diagnostic) 199Dim errorList As New List(Of Diagnostic) 226Return New ReadOnlyCollection(Of Diagnostic)(errorList) 245errorList As List(Of Diagnostic), 271Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxNodeOrToken, errorInfo As DiagnosticInfo) As Diagnostic 278Private Shared Function CreateSyntaxError(tree As SyntaxTree, nodeOrToken As SyntaxTrivia, errorInfo As DiagnosticInfo) As Diagnostic 465Public Shadows Function GetDiagnostics() As IEnumerable(Of Diagnostic)
Syntax\VisualBasicSyntaxTree.vb (8)
317Public Overrides Function GetDiagnostics(node As SyntaxNode) As IEnumerable(Of Diagnostic) 329Public Overrides Function GetDiagnostics(token As SyntaxToken) As IEnumerable(Of Diagnostic) 339Public Overrides Function GetDiagnostics(trivia As SyntaxTrivia) As IEnumerable(Of Diagnostic) 350Public Overrides Function GetDiagnostics(nodeOrToken As SyntaxNodeOrToken) As IEnumerable(Of Diagnostic) 360Public Overrides Function GetDiagnostics(Optional cancellationToken As CancellationToken = Nothing) As IEnumerable(Of Diagnostic) 364Friend Iterator Function EnumerateDiagnostics(node As InternalSyntax.VisualBasicSyntaxNode, position As Integer, InDocumentationComment As Boolean) As IEnumerable(Of Diagnostic) 372Friend Overloads Function GetDiagnostics(node As InternalSyntax.VisualBasicSyntaxNode, position As Integer, InDocumentationComment As Boolean) As IEnumerable(Of Diagnostic) 380Return SpecializedCollections.EmptyEnumerable(Of Diagnostic)()
VisualBasicCompilationOptions.vb (13)
1023Friend Overrides Sub ValidateOptions(builder As ArrayBuilder(Of Diagnostic)) 1031builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_VBCoreNetModuleConflict)) 1035builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(Platform), Platform.ToString())) 1043builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(OutputKind), OutputKind.ToString())) 1047builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(OptimizationLevel), OptimizationLevel.ToString())) 1051builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(ScriptClassName), If(ScriptClassName, "Nothing"))) 1055builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(MainTypeName), MainTypeName)) 1059builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(RootNamespace), RootNamespace)) 1063builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(OptionStrict), OptionStrict.ToString())) 1068builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_LibAnycpu32bitPreferredConflict, NameOf(Platform), Platform.ToString())) 1072builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidSwitchValue, NameOf(MetadataImportOptions), MetadataImportOptions.ToString())) 1133Friend Overrides Function FilterDiagnostic(diagnostic As Diagnostic, cancellationToken As CancellationToken) As Diagnostic
VisualBasicExtensions.vb (1)
280Friend Function GetSyntaxErrors(token As SyntaxToken, tree As SyntaxTree) As ReadOnlyCollection(Of Diagnostic)
VisualBasicParseOptions.vb (4)
245Friend Overrides Sub ValidateOptions(builder As ArrayBuilder(Of Diagnostic)) 250builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_BadLanguageVersion, LanguageVersion.ToString)) 256builder.Add(Diagnostic.Create(ErrorFactory.ErrorInfo(ERRID.ERR_ConditionalCompilationConstantNotValid, 264builder.Add(Diagnostic.Create(MessageProvider.Instance, ERRID.ERR_InvalidPreprocessorConstantType, symbol.Key, symbol.Value.GetType))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValDiagnosticAnalyzer.vb (1)
33syntaxContext.ReportDiagnostic(Diagnostic.Create(Descriptor, modifier.GetLocation(), additionalLocations:={parameterSyntax.GetLocation()}))
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (16)
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
35Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String) 40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode))
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
58Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
59Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
52Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
34Protected Overrides Function IsSupportedDiagnostic(diagnostic As Diagnostic, cancellationToken As CancellationToken) As Boolean
src\Analyzers\VisualBasic\CodeFixes\QualifyMemberAccess\VisualBasicQualifyMemberAccessCodeFixProvider.vb (1)
27Protected Overrides Function GetNode(diagnostic As Diagnostic, cancellationToken As CancellationToken) As SimpleNameSyntax
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
37Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
54diagnostics As ImmutableArray(Of Diagnostic),
src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (2)
35diagnostics As ImmutableArray(Of Diagnostic), 49diagnostic As Diagnostic,
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (340)
CommandLineArgumentsTests.vb (23)
18Dim errors As IEnumerable(Of Diagnostic) = Nothing 50errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "= ^^ ^^ ")) 57errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "= ^^ ^^ ")) 63errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Expression expected.", "OnlyEqualsNoValue1= ^^ ^^ ")) 69errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Expression expected.", "OnlyEqualsNoValue1= ^^ ^^ ")) 86errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "then ^^ ^^ =bar")) 91errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Syntax error in conditional compilation expression.", "bar= ^^ ^^ then")) 112errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "GOO=23:: ^^ , ^^ ,:::")) 117errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "GOO=23, ^^ : ^^ BAR")) 132Dim errors As IEnumerable(Of Diagnostic) = Nothing 184errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Conversion from 'String' to 'Double' cannot occur in a constant expression.", "RRR=1+""3"" ^^ ^^ ")) 189Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("')' expected.", "X=IF(1,,,,,RRR=1 ^^ ^^ "), 190Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("'If' operator requires either two or three operands.", "X=IF(1,,,,,RRR=1 ^^ ^^ "), 191Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Expression expected.", "X=IF(1,,,,,RRR=1 ^^ ^^ ")) 195errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("End of statement expected.", "A=CHR ^^ ^^ (128)")) 199errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("End of statement expected.", "A=ASCW ^^ ^^ (""G"")")) 203errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("End of statement expected.", "B=1 ^^ ^^ 1")) 207errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("End of statement expected.", "B=1 ^^ ^^ C=1")) 211errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Overflow.", "A=111111111111111111111111 ^^ ^^ ")) 215errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Syntax error in conditional compilation expression.", "A= 2 + " + vbCrLf + " ^^ ^^ 2")) 226Dim errors As IEnumerable(Of Diagnostic) = Nothing 281Dim errors As IEnumerable(Of Diagnostic) = Nothing 285errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", " ^^ 'Blah' ^^ "))
CommandLineIVTTests.vb (2)
592Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("reportivts").WithLocation(1, 1), 593Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1))
CommandLineTests.vb (315)
806args.Errors.Verify(Diagnostic(ERRID.ERR_ExpectedIdentifier), 807Diagnostic(ERRID.ERR_ExpectedIdentifier)) 810args.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("import", ":<str>")) 813args.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("imports", ":<import_list>")) 816args.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("imports", ":<import_list>")) 819args.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/imports+")) ' TODO: Dev11 reports ERR_ArgumentRequired 831args.Errors.Verify({Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/i").WithLocation(1, 1), 832Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)}) 857args.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("i").WithLocation(1, 1)) 869args.Errors.Verify({Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("instrument", ":<string>").WithLocation(1, 1)}) 873args.Errors.Verify({Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("instrument", ":<string>").WithLocation(1, 1)}) 877args.Errors.Verify({Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("instrument", ":<string>").WithLocation(1, 1)}) 881args.Errors.Verify({Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("instrument", ":<string>").WithLocation(1, 1)}) 885args.Errors.Verify({Diagnostic(ERRID.ERR_InvalidInstrumentationKind).WithArguments("InvalidOption").WithLocation(1, 1)}) 889args.Errors.Verify({Diagnostic(ERRID.ERR_InvalidInstrumentationKind).WithArguments("None").WithLocation(1, 1)}) 893args.Errors.Verify({Diagnostic(ERRID.ERR_InvalidInstrumentationKind).WithArguments("InvalidOption").WithLocation(1, 1)}) 1046Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32resource", ":<file>")) 1048Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32resource", ":<file>")) 1050Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32resource", ":<file>")) 1053Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32icon", ":<file>")) 1055Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32icon", ":<file>")) 1057Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32icon", ":<file>")) 1060Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32manifest", ":<file>")) 1062Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32manifest", ":<file>")) 1064Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32manifest", ":<file>")) 1068Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/nowin32manifest:")) 1070Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/nowin32manifest:")) 1079Diagnostic(ERRID.ERR_IconFileAndWin32ResFile)) 1082Diagnostic(ERRID.ERR_CantHaveWin32ResAndManifest)) 1088Diagnostic(ERRID.ERR_IconFileAndWin32ResFile)) 1098Diagnostic(ERRID.ERR_CantHaveWin32ResAndManifest)) 1105Diagnostic(ERRID.ERR_ConflictingManifestSwitches)) 1113Diagnostic(ERRID.ERR_ConflictingManifestSwitches)) 1122parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32resource", ":<file>")) 1125parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32resource+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1128parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32resource-")) ' TODO: Dev11 reports ERR_ArgumentRequired 1131parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32icon", ":<file>")) 1134parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32icon+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1137parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32icon-")) ' TODO: Dev11 reports ERR_ArgumentRequired 1140parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("win32manifest", ":<file>")) 1143parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32manifest+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1146parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/win32manifest-")) ' TODO: Dev11 reports ERR_ArgumentRequired 1162Dim diags = New List(Of Diagnostic)() 1212diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1233diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", "publi")) 1238diags.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("D:rive\relative\path")) 1243diags.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("inva\l*d?path")) 1248diags.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("resource", ":<resinfo>")) 1253diags.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("resource", ":<resinfo>")) 1258diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1263diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1275diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1280diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1285diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1290diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1295diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1314diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1326diags.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("resource", " ")) 1334diags.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii").WithLocation(1, 1)) 1374parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("resource", ":<resinfo>")) 1377parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("resource", ":<resinfo>")) 1380parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("resource", ":<resinfo>")) 1383parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/RES+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1386parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/res-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 1389parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("linkresource", ":<resinfo>")) 1392parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("linkresource", ":<resinfo>")) 1395parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("linkresource", ":<resinfo>")) 1398parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/linkRES+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1401parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/linkres-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 1408Diagnostic(ERRID.WRN_IgnoreModuleManifest)) 1453Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 1562parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("langversion", ":<number>")) 1566parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/langVERSION+")) ' TODO: Dev11 reports ERR_ArgumentRequired 1570parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("langversion", ":<number>")) 1574parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("langversion", "8")) 1578parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("langversion", CStr(LanguageVersion.VisualBasic12 + 1))) 1600parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("delaysign")) 1623parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/VERBOSE:-")) 1626parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("verbose")) 1629parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("verbose")) 1632parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/verbOSE:")) 1663parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/QUIET:-")) 1666parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("quiet")) 1669parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("quiet")) 1672parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/quiET:")) 1710parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optimize")) 1713parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optimize")) 1716parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optimize")) 1771parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("parallel")) 1774parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("parallel")) 1777parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("parallel")) 1792parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("p")) 1795parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("p")) 1798parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("p")) 1826parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("subsystemversion", ":<version>")) 1829parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("subsystemversion", ":<version>")) 1832parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/subsystemversion-")) ' TODO: Dev11 reports ERRID.ERR_ArgumentRequired 1835parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("subsystemversion", ":<version>")) 1838parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments(" 4.1")) 1841parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("4 .0")) 1844parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("4. 0")) 1847parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments(".")) 1850parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("4.")) 1853parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments(".0")) 1859parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("4.65536")) 1862parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("65536.0")) 1865parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("-4.0")) 1882parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadCodepage).WithArguments("0")) 1885parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadCodepage).WithArguments("abc")) 1888parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadCodepage).WithArguments("-5")) 1891parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("codepage", ":<number>")) 1894parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("codepage", ":<number>")) 1897parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/codepage+")) ' Dev11 reports ERR_ArgumentRequired 1900parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("codepage", ":<number>")) 1924parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadChecksumAlgorithm).WithArguments("256")) 1927parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadChecksumAlgorithm).WithArguments("sha-1")) 1930parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadChecksumAlgorithm).WithArguments("sha")) 1933parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("checksumalgorithm", ":<algorithm>")) 1936parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("checksumalgorithm", ":<algorithm>")) 1939parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("checksumalgorithm", ":<algorithm>")) 1942parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/checksumAlgorithm+")) 1957parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("main", ":<class>")) 1962parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("main", ":<class>")) 1965parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("m", ":<class>")) 1968parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/m+")) ' Dev11 reports ERR_ArgumentRequired 1985parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("optioncompare", ":binary|text")) 1990parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("optioncompare", ":binary|text")) 2010parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optionexplicit")) 2015parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optionexplicit")) 2019parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optionexplicit")) 2037parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optioninfer")) 2040parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optioninfer")) 2043parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("optioninfer")) 2236parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("optionstrict", ":custom")) 2239parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("optionstrict", ":custom")) 2260parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("rootnamespace", ":<string>")) 2263parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("rootnamespace", ":<string>")) 2266parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/rootnamespace+")) ' TODO: Dev11 reports ERR_ArgumentRequired 2269parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/rootnamespace-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 2272parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("+")) 2275parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("rootnamespace", ":<string>")) 2278parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments(" A.B.C")) 2281parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("[abcdef")) 2284parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("abcdef]")) 2287parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("[[abcdef]]")) 2302parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("goo$")) 2305parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("I(")) 2308parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("_")) 2311parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("[_]")) 2318parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("[")) 2321parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("]")) 2324parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_BadNamespaceName1).WithArguments("[]")) 2344parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("l", ":<file_list>")) 2347parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("l", ":<file_list>")) 2350parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/l+")) ' TODO: Dev11 reports ERR_ArgumentRequired 2353parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/link-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 2380parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("recurse", ":<wildcard>")) 2383parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("recurse", ":<wildcard>")) 2386parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("recurse", ":<wildcard>")) 2389parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/recurse+")) ' TODO: Dev11 reports ERR_ArgumentRequired 2392parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/recurse-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 2493parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("r", ":<file_list>")) 2496parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("r", ":<file_list>")) 2499parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/reference+")) ' TODO: Dev11 reports ERR_ArgumentRequired 2502parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/reference-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 2589parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("a", ":<file_list>")) 2592parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("a", ":<file_list>")) 2873Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("ruleset", ":<file>")) 2878Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("ruleset", ":<file>")) 2883Diagnostic(ERRID.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah"), "File not found.")) 2888Diagnostic(ERRID.ERR_CantReadRulesetFile).WithArguments(Path.Combine(TempRoot.Root, "blah;blah.ruleset"), "File not found.")) 2938parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("t", ":exe|winexe|library|module|appcontainerexe|winmdobj")) 2941parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("target", ":exe|winexe|library|module|appcontainerexe|winmdobj")) 2944parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("target", "xyz")) 2947parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/T+")) ' TODO: Dev11 reports ERR_ArgumentRequired 2950parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/TARGET-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 2956parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2960parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2964parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2968parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2972parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2976parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2980parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2985Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("t", ":exe|winexe|library|module|appcontainerexe|winmdobj"), 2986Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2990Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("target", ":exe|winexe|library|module|appcontainerexe|winmdobj"), 2991Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 2995Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("target", "xyz"), 2996Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) 3000Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/T+"), 3001Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) ' TODO: Dev11 reports ERR_ArgumentRequired 3005Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/TARGET-:"), 3006Diagnostic(ERRID.ERR_NoSources).WithLocation(1, 1)) ' TODO: Dev11 reports ERR_ArgumentRequired 3035parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("utf8output")) 3133parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("debug", "")) 3136parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("debug", "+")) 3139parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("debug", "invalid")) 3142parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("debug")) 3145parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/pdb:something")) 3169parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SourceLinkRequiresPdb)) 3175parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SourceLinkRequiresPdb)) 3295parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_CannotEmbedWithoutPdb)) 3298parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_CannotEmbedWithoutPdb)) 3301parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_CannotEmbedWithoutPdb)) 3304parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_CannotEmbedWithoutPdb)) 3458Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/pathmap:").WithLocation(1, 1) 3587Diagnostic(ERRID.ERR_ArgumentRequired, arguments:={"sdkpath", ":<path>"}).WithLocation(1, 1), 3588Diagnostic(ERRID.WRN_CannotFindStandardLibrary1).WithArguments("System.dll").WithLocation(1, 1), 3589Diagnostic(ERRID.ERR_LibNotFound).WithArguments("Microsoft.VisualBasic.dll").WithLocation(1, 1)) 3732Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("refout", ":<file>").WithLocation(1, 1)) 3736Diagnostic(ERRID.ERR_NoRefOutWhenRefOnly).WithLocation(1, 1)) 3740Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("refonly").WithLocation(1, 1)) 3744Diagnostic(ERRID.ERR_NoNetModuleOutputWhenRefOutOrRefOnly).WithLocation(1, 1)) 3754Diagnostic(ERRID.ERR_NoNetModuleOutputWhenRefOutOrRefOnly).WithLocation(1, 1)) 3758Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("C:""My Folder\MyBinary.dll").WithLocation(1, 1)) 3825Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(currentDrive + ":a.vb")) 3835Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("\\b")) 3852Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("a.b" & vbNullChar & "b")) 3879Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("a<>.dll")) 3887parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("out", ":<file>")) 3890parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("out", ":<file>")) 3893parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("refout", ":<file>")) 3896parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoRefOutWhenRefOnly).WithLocation(1, 1)) 3899parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/out+")) ' TODO: Dev11 reports ERR_ArgumentRequired 3902parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/out-:")) ' TODO: Dev11 reports ERR_ArgumentRequired 3906Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 3914Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 3922Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".dll")) 3937Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 3945Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 3953Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".dll")) 3985parsedArgs.Errors.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".exe")) 4007parsedArgs.Errors.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(".dll")) 4090Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("doc", ":<file>")) 4377Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments(" ", "The system cannot find the path specified")) 4383Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments(" \ ", "The system cannot find the path specified")) 4390Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments("\\b", "The system cannot find the path specified")) 4398Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments("a.b" + ChrW(0) + "b", "The system cannot find the path specified")) 4405Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments("a" + ChrW(55296) + "b.xml", "The system cannot find the path specified")) 4412Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments("a<>.xml", "The system cannot find the path specified")) 4424Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("doc", ":<file>")) 4444Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("doc")) 4450Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("doc")) 4482Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments(currentDrive + ":a.xml", "The system cannot find the path specified")) 4559Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("errorlog", CommandLineParser.ErrorLogOptionFormat)) 4565Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("errorlog", CommandLineParser.ErrorLogOptionFormat)) 4584Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("C:""My Folder\MyBinary.xml").WithLocation(1, 1)) 4602Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments(filePath)) 4624Diagnostic(ERRID.ERR_BadSwitchValue).WithArguments("C:\MyFolder\MyBinary.xml,version=42", "errorlog", CommandLineParser.ErrorLogOptionFormat)) 4630Diagnostic(ERRID.ERR_BadSwitchValue).WithArguments("C:\MyFolder\MyBinary.xml,version=1.0.0", "errorlog", CommandLineParser.ErrorLogOptionFormat)) 4636Diagnostic(ERRID.ERR_BadSwitchValue).WithArguments("C:\MyFolder\MyBinary.xml,version=2.1.0", "errorlog", CommandLineParser.ErrorLogOptionFormat)) 4643Diagnostic(ERRID.ERR_BadSwitchValue).WithArguments("C:\MyFolder\MyBinary.xml,invalid=42", "errorlog", CommandLineParser.ErrorLogOptionFormat)) 4650Diagnostic(ERRID.ERR_BadSwitchValue).WithArguments("C:\MyFolder\MyBinary.xml,version=2,version=2", "errorlog", CommandLineParser.ErrorLogOptionFormat)) 4686parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keycontainer", ":<string>")) 4690parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/keycontainer-")) 4694parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keycontainer", ":<string>")) 4698parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keycontainer", ":<string>")) 4707parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keyfile", ":<file>")) 4711parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/keyfile-")) 4715parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keyfile", ":<file>")) 4776Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("platform", ":<string>")) 4778Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("platform", ":<string>")) 4780Verify(parsedArgs.Errors, Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/platform+")) ' TODO: Dev11 reports ERR_ArgumentRequired 4784Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("platform", "abcdef")) 4793Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_LibAnycpu32bitPreferredConflict).WithArguments("Platform", "AnyCpu32BitPreferred").WithLocation(1, 1)) 4796Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_LibAnycpu32bitPreferredConflict).WithArguments("Platform", "AnyCpu32BitPreferred").WithLocation(1, 1)) 4843Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("filealign", ":<number>")) 4847Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("filealign", "0")) 4849Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("filealign", "0x")) 4851Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("filealign", "0x0")) 4853Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("filealign", "-1")) 4855Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("filealign", "-0x100")) 4877parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("removeintchecks")) 4880parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("removeintchecks")) 4883parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_SwitchNeedsBool).WithArguments("removeintchecks")) 4935Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("baseaddress", ":<number>")) 4939Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("baseaddress", "0x10000000000000000")) 4941Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("baseaddress", "-1")) 4943Verify(parsedArgs.Errors, Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("baseaddress", ULong.MaxValue.ToString)) 4975parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("addmodule", ":<file_list>")) 4978parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("addmodule", ":<file_list>")) 4981parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/addmodule+")) ' TODO: Dev11 reports ERR_ArgumentRequired 4995parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("libpath", ":<path_list>")) 4998parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("libpath", ":<path_list>")) 5001parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/libpath+")) ' TODO: Dev11 reports ERR_ArgumentRequired 5092parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("sdkpath", ":<path>")) 5095parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("sdkpath", ":<path>")) 5098parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/sdkpath+")) ' TODO: Dev11 reports ERR_ArgumentRequired 5204opt.Errors.Verify(Diagnostic(ERRID.ERR_VBCoreNetModuleConflict)) 5206CreateCompilationWithMscorlib40AndVBRuntime(<compilation><file/></compilation>, opt).GetDiagnostics().Verify(Diagnostic(ERRID.ERR_VBCoreNetModuleConflict)) 5401Verify(parsedArgs.Errors, Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/highentropyva:+")) 5404Verify(parsedArgs.Errors, Diagnostic(ERRID.WRN_BadSwitch).WithArguments("/highentropyva:")) 5438parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_NoSourcesOut)) 7445parsedArgs.Errors.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("\\.\com1").WithLocation(1, 1)) 7452parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_XMLCannotWriteToXMLDocFile2).WithArguments("..\lpt2.xml", "The system cannot find the path specified").WithLocation(1, 1)) 7458parsedArgs.Errors.Verify(Diagnostic(ERRID.WRN_CannotFindStandardLibrary1).WithArguments("System.dll").WithLocation(1, 1), 7459Diagnostic(ERRID.ERR_LibNotFound).WithArguments("Microsoft.VisualBasic.dll").WithLocation(1, 1)) 7846args.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("additionalfile", ":<file_list>")) 7850args.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("additionalfile", ":<file_list>")) 7909Private Shared Sub Verify(actual As IEnumerable(Of Diagnostic), ParamArray expected As DiagnosticDescription()) 9168args.Errors.Verify(Diagnostic(ERRID.FTL_InvalidInputFileName).WithArguments("e:c:\test\test.cs").WithLocation(1, 1)) 9217Dim list As New List(Of Diagnostic) 9273parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keyfile", ":<file>").WithLocation(1, 1)) 9280parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("keyfile", ":<file>").WithLocation(1, 1)) 9669parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "1 ^^ ^^ ").WithLocation(1, 1)) 9675parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("langversion", "1000").WithLocation(1, 1)) 10654parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("generatedfilesout", ":<dir>").WithLocation(1, 1)) 10658parsedArgs.Errors.Verify(Diagnostic(ERRID.ERR_ArgumentRequired).WithArguments("generatedfilesout", ":<dir>").WithLocation(1, 1)) 10944context.ReportDiagnostic(Diagnostic.Create(Hidden01, context.Node.GetLocation())) 10969context.ReportDiagnostic(Diagnostic.Create(Info01, context.Node.GetLocation())) 10995context.ReportDiagnostic(Diagnostic.Create(Warning01, context.Symbol.Locations.First())) 10996context.ReportDiagnostic(Diagnostic.Create(Warning03, context.Symbol.Locations.First())) 11019context.ReportDiagnostic(Diagnostic.Create(Warning04, context.Symbol.Locations.First())) 11043context.ReportDiagnostic(Diagnostic.Create(Error01, context.Node.GetLocation())) 11093Dim diag = Diagnostic.Create(Rule, diagLocation, IO.Path.GetFileNameWithoutExtension(path))
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (726)
Attributes\AssemblyAttributes.vb (5)
116comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidVersionFormatDeterministic, """10101.0.*""").WithLocation(1, 46)) 1125Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "Assembly: System.Reflection.AssemblyFlags(12345)").WithArguments("Public Overloads Sub New(assemblyFlags As Integer)", "This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")) 1141Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "Assembly: System.Reflection.AssemblyFlags(12345UI)").WithArguments("Public Overloads Sub New(flags As UInteger)", "This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")) 1632Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsageInNetModule2).WithArguments("UserDefinedAssemblyAttrNoAllowMultipleAttribute", "NetModuleWithAssemblyAttributes.netmodule")) 1649Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsageInNetModule2).WithArguments("UserDefinedAssemblyAttrNoAllowMultipleAttribute", "NetModuleWithAssemblyAttributes.netmodule"))
Attributes\AttributeTests.vb (49)
1610Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "EvntWithAccessors"), 1611Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "PropertyWithAccessors"), 1612Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Evnt"), 1613Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Field"), 1614Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "WE"), 1615Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "NestedType"), 1616Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Iface")) 1707Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "EvntWithAccessors"), 1708Diagnostic(ERRID.ERR_InvalidAttributeUsageOnAccessor, "Attr").WithArguments("Attr", "AddHandler", "EvntWithAccessors"), 1709Diagnostic(ERRID.ERR_InvalidAttributeUsageOnAccessor, "Attr").WithArguments("Attr", "RemoveHandler", "EvntWithAccessors"), 1710Diagnostic(ERRID.ERR_InvalidAttributeUsageOnAccessor, "Attr").WithArguments("Attr", "RaiseEvent", "EvntWithAccessors"), 1711Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "PropertyWithAccessors"), 1712Diagnostic(ERRID.ERR_InvalidAttributeUsageOnAccessor, "Attr").WithArguments("Attr", "Get", "PropertyWithAccessors"), 1713Diagnostic(ERRID.ERR_InvalidAttributeUsageOnAccessor, "Attr").WithArguments("Attr", "Set", "PropertyWithAccessors"), 1714Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Sub1"), 1715Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Ftn2"), 1716Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "DeclareFtn"), 1717Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "DeclareSub"), 1718Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "-"), 1719Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "CType"), 1720Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Evnt"), 1721Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "NestedType"), 1722Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "Attr").WithArguments("Attr", "Iface")) 1871compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeNonPublicConstructor, "Fred")) 2034compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ArrayOfRawGenericInvalid, "()")) 2796Diagnostic(ERRID.ERR_InaccessibleSymbol2, "x1").WithArguments("m1.X1", "Private"), 2797Diagnostic(ERRID.ERR_NameNotDeclared1, "C1").WithArguments("C1"), 2798Diagnostic(ERRID.ERR_NameNotDeclared1, "C1").WithArguments("C1"), 2799Diagnostic(ERRID.ERR_NameNotDeclared1, "s").WithArguments("s"), 2800Diagnostic(ERRID.ERR_RequiredConstExpr, "s.GetType() isnot nothing"), 2801Diagnostic(ERRID.ERR_NameNotDeclared1, "a").WithArguments("a"), 2802Diagnostic(ERRID.ERR_RequiredConstExpr, "a = 1")) 2832Diagnostic(ERRID.ERR_MissingValuesForArraysInApplAttrs, "{}"), 2833Diagnostic(ERRID.ERR_InitializerTooFewElements1, "{1}").WithArguments("5") 3050compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_AttrCannotBeGenerics, "T").WithArguments("T")) 3071compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstExpr, "New With {.anonymousField = False}.anonymousField")) 3092Diagnostic(ERRID.ERR_TooManyArgs1, "0").WithArguments("Public Sub New()")) 3112Diagnostic(ERRID.ERR_TooManyArgs1, "0").WithArguments("Public Sub New()")) 3269comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleSymbol2, "A").WithArguments("AAttribute", "Friend")) 3306comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleSymbol2, "NS").WithArguments("C.NSAttribute", "Private")) 3344comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_AmbiguousInImports2, "A").WithArguments("AAttribute", "N1, N2")) 3841comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeNonPublicType1, "MyAttr1").WithArguments("e2()")) 3864comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotMember2, "EditorBrowsableState.n").WithArguments("n", "System.ComponentModel.EditorBrowsableState")) 3893comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "A").WithArguments("A"), 3894Diagnostic(ERRID.ERR_NameNotDeclared1, "Mid").WithArguments("Mid"), 3895Diagnostic(ERRID.ERR_PropertyOrFieldNotDefined1, "F").WithArguments("F"), 3896Diagnostic(ERRID.ERR_NameNotDeclared1, "Mid").WithArguments("Mid")) 5115Diagnostic(ERRID.ERR_BadAttributeConstructor1, "Command").WithArguments("a.Class1.CommandAttribute.FxCommand").WithLocation(20, 10), 5116Diagnostic(ERRID.ERR_RequiredConstExpr, "AddressOf UserInfo").WithLocation(20, 18))
Attributes\AttributeTests_MarshalAs.vb (52)
238Diagnostic(ERRID.ERR_BadAttribute1, "CType(-1, UnmanagedType)").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 239Diagnostic(ERRID.ERR_BadAttribute1, "CType(&H20000000, UnmanagedType)").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute")) 320Diagnostic(ERRID.ERR_BadAttribute1, "IidParameterIndex:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 321Diagnostic(ERRID.ERR_BadAttribute1, "IidParameterIndex:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 322Diagnostic(ERRID.ERR_BadAttribute1, "IidParameterIndex:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 323Diagnostic(ERRID.ERR_BadAttribute1, "IidParameterIndex:=&H20000000").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute")) 442Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArraySubType:=VarEnum.VT_BSTR"), 443Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 444Diagnostic(ERRID.ERR_BadAttribute1, "SizeParamIndex:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 445Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 446Diagnostic(ERRID.ERR_BadAttribute1, "SizeParamIndex:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 447Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=Int32.MaxValue").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 448Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=Int32.MaxValue / 4 + 1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 449Diagnostic(ERRID.ERR_BadAttribute1, "ArraySubType:=UnmanagedType.CustomMarshaler").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 450Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArraySubType:=VarEnum.VT_I1"), 451Diagnostic(ERRID.ERR_BadAttribute1, "ArraySubType:=DirectCast(&H20000000, UnmanagedType)").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 452Diagnostic(ERRID.ERR_BadAttribute1, "ArraySubType:=DirectCast((-1), UnmanagedType)").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute")) 555Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArraySubType:=VarEnum.VT_BSTR"), 556Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 557Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=-1"), 558Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=Int16.MaxValue"), 559Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArraySubType:=VarEnum.VT_I2"), 560Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=&H20000000").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute")) 731Diagnostic(ERRID.ERR_ParameterNotValidForType, "ArraySubType:=UnmanagedType.ByValTStr"), 732Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeConst:=-1"), 733Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=-1"), 734Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArrayUserDefinedSubType:=Nothing"), 735Diagnostic(ERRID.ERR_ParameterNotValidForType, "ArraySubType:=UnmanagedType.ByValTStr"), 736Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeConst:=1"), 737Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=1"), 738Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArrayUserDefinedSubType:=Nothing"), 739Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArrayUserDefinedSubType:=Nothing"), 740Diagnostic(ERRID.ERR_ParameterNotValidForType, "SafeArrayUserDefinedSubType:=GetType(Integer)")) 812Diagnostic(ERRID.ERR_ParameterNotValidForType, "ArraySubType:=UnmanagedType.ByValTStr"), 813Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 814Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=-1"), 815Diagnostic(ERRID.ERR_AttributeParameterRequired1, "MarshalAs").WithArguments("SizeConst"), 816Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=-1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 817Diagnostic(ERRID.ERR_AttributeParameterRequired1, "MarshalAs").WithArguments("SizeConst"), 818Diagnostic(ERRID.ERR_BadAttribute1, "SizeConst:=(Int32.MaxValue - 3) / 4 + 1").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 819Diagnostic(ERRID.ERR_AttributeParameterRequired1, "MarshalAs").WithArguments("SizeConst"), 820Diagnostic(ERRID.ERR_ParameterNotValidForType, "SizeParamIndex:=1"), 821Diagnostic(ERRID.ERR_ParameterNotValidForType, "ArraySubType:=UnmanagedType.ByValTStr")) 930Diagnostic(ERRID.ERR_AttributeParameterRequired2, "MarshalAs").WithArguments("MarshalType", "MarshalTypeRef"), 931Diagnostic(ERRID.ERR_BadAttribute1, "MarshalType:=""a"" & ChrW(&HDC00) & ""b""").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute"), 932Diagnostic(ERRID.ERR_BadAttribute1, "MarshalCookie:=""y"" & ChrW(&HDC00)").WithArguments("System.Runtime.InteropServices.MarshalAsAttribute")) 952Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "MarshalAs").WithArguments("MarshalAsAttribute", "e")) 1349Diagnostic(ERRID.ERR_MarshalUnmanagedTypeOnlyValidForFields, "UnmanagedType.ByValArray").WithArguments("ByValArray"), 1350Diagnostic(ERRID.ERR_MarshalUnmanagedTypeOnlyValidForFields, "UnmanagedType.ByValTStr").WithArguments("ByValTStr"), 1351Diagnostic(ERRID.ERR_MarshalUnmanagedTypeOnlyValidForFields, "UnmanagedType.ByValArray").WithArguments("ByValArray"), 1352Diagnostic(ERRID.ERR_MarshalUnmanagedTypeOnlyValidForFields, "UnmanagedType.ByValTStr").WithArguments("ByValTStr"), 1353Diagnostic(ERRID.ERR_MarshalUnmanagedTypeNotValidForFields, "UnmanagedType.VBByRefStr").WithArguments("VBByRefStr"))
Attributes\AttributeTests_ObsoleteAttribute.vb (106)
119Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "AnotherAttribute").WithArguments("AnotherAttribute"), 120Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "A1").WithArguments("A1", "Do not use A1"), 121Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "G(Of Integer, AnotherAttribute)").WithArguments("G(Of Integer, AnotherAttribute)"), 122Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Class1").WithArguments("Class1", "Do not use this type"), 123Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Class1").WithArguments("Class1", "Do not use this type"), 124Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Class1").WithArguments("Class1", "Do not use this type"), 125Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "SelfReferenceInBase").WithArguments("SelfReferenceInBase"), 126Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Class1").WithArguments("Class1", "Do not use this type"), 127Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Class1").WithArguments("Class1", "Do not use this type"), 128Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "Mydeleg").WithArguments("Mydeleg")) 415Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "10").WithArguments("Public Shared Widening Operator CType(x As Integer) As Test"), 416Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "CType(""10"", Test)").WithArguments("Public Shared Narrowing Operator CType(x As String) As Test"), 417Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "-c").WithArguments("Public Shared Operator -(x As Test) As Test"), 418Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "c").WithArguments("Public Shared Operator IsTrue(x As Test) As Boolean"), 419Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "c AndAlso c1").WithArguments("Public Shared Operator And(x As Test, y As Test) As Test"), 420Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "c AndAlso c1").WithArguments("Public Shared Operator IsFalse(x As Test) As Boolean"), 421Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "(c AndAlso c1)").WithArguments("Public Shared Operator IsTrue(x As Test) As Boolean"), 422Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "c1 += c").WithArguments("Public Shared Operator +(x As Test, y As Test) As Test")) 501Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "TestClass1").WithArguments("TestClass1"), 502Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "TestClass2").WithArguments("TestClass2", "TestClass2 is obsolete"), 503Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "TestClass3").WithArguments("TestClass3", "Do not use TestClass3"), 504Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "TestClass4").WithArguments("TestClass4", "TestClass4 is obsolete"), 505Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "c.TestMethod()").WithArguments("Public Sub TestMethod()", "Do not use TestMethod"), 506Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "c.Prop1").WithArguments("Public Property Prop1 As Integer", "Do not use Prop1"), 507Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "c.field1").WithArguments("Public field1 As TestClass", "Do not use field1"), 508Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "c.event1").WithArguments("Public Event event1 As System.Action", "Do not use event"), 509Diagnostic(ERRID.ERR_UseOfObsoleteSymbolNoMessage1, "TestModule").WithArguments("TestModule")) 591Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "F5"), 592Diagnostic(ERRID.ERR_RequiredConstExpr, "F5"), 593Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "P1"), 594Diagnostic(ERRID.ERR_RequiredConstExpr, "P1"), 595Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "P2"), 596Diagnostic(ERRID.ERR_NoArgumentCountOverloadCandidates1, "SomeAttr").WithArguments("New"), 597Diagnostic(ERRID.ERR_RequiredConstExpr, "P2"), 598Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "Method1"), 599Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "Method2")) 937Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "C").WithArguments("C"), 938Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "o.Goo()").WithArguments("Public Sub Goo()")) 1005Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "XEvent").WithArguments("Public Event XEvent()"), 1006Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "MyDeleg").WithArguments("MyDeleg"), 1007Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "MyDeleg").WithArguments("MyDeleg"), 1008Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "MyDeleg").WithArguments("MyDeleg"), 1009Diagnostic(ERRID.WRN_UseOfObsoletePropertyAccessor2, "s.p += ""as""").WithArguments("Set", "Public Property p As String"), 1010Diagnostic(ERRID.WRN_UseOfObsoletePropertyAccessor2, "s.p").WithArguments("Get", "Public Property p As String"), 1011Diagnostic(ERRID.WRN_UseOfObsoletePropertyAccessor2, "s.p").WithArguments("Get", "Public Property p As String")) 1056Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Att()").WithArguments("Public Sub New()", "Constructor"), 1057Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Att").WithArguments("Public Sub New()", "Constructor"), 1058Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Field:=1").WithArguments("Public Field As Integer", "Field"), 1059Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Att(Field:=1)").WithArguments("Public Sub New()", "Constructor"), 1060Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Prop:=1").WithArguments("Public Property Prop As Integer", "Property"), 1061Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "Att(Prop:=1)").WithArguments("Public Sub New()", "Constructor")) 1133Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C1").WithArguments("A.B.C1"), 1134Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer)").WithArguments("A.B.C2(Of Integer)"), 1135Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer)").WithArguments("A.B.C2(Of Integer)"), 1136Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer).E(Of Integer)").WithArguments("A.B.C2(Of Integer).E(Of Integer)"), 1137Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C").WithArguments("A.B.C"), 1138Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C.Field1").WithArguments("Public Shared Field1 As Integer"), 1139Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C").WithArguments("A.B.C"), 1140Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C.D").WithArguments("A.B.C.D"), 1141Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C.D.Field2").WithArguments("Public Shared Field2 As Integer"), 1142Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C1").WithArguments("A.B.C1"), 1143Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer)").WithArguments("A.B.C2(Of Integer)"), 1144Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer)").WithArguments("A.B.C2(Of T)"), 1145Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "A.B.C2(Of Integer).Field1").WithArguments("Public Shared Field1 As Integer"), 1146Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "a.b.c2(Of Integer)").WithArguments("A.B.C2(Of Integer)"), 1147Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "a.b.c2(Of Integer).E(Of Integer)").WithArguments("A.B.C2(Of Integer).E(Of Integer)")) 1194diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(9, 9)) 1224diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(9, 9)) 1254diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(9, 9)) 1284diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(9, 9)) 1331Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "DiagnosticId").WithArguments("DiagnosticId", "class", "System.ObsoleteAttribute").WithLocation(4, 15), 1332Diagnostic(ERRID.ERR_MultiplyDefinedType3, "DiagnosticId").WithArguments("DiagnosticId", "Public DiagnosticId As String", "class").WithLocation(27, 25)) 1359diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()", "don't use").WithLocation(9, 9)) 1389diags.Verify(Diagnostic("A", "M1()").WithArguments("Public Sub M1()").WithLocation(9, 9)) 1431Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()", "don't use").WithLocation(13, 9), 1432Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M2()").WithArguments("Public Sub M2()").WithLocation(14, 9), 1433Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M2()").WithArguments("Public Sub M2()").WithLocation(18, 9), 1434Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()", "don't use").WithLocation(22, 9)) 1484Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()", "don't use").WithLocation(5, 9), 1485Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M2()").WithArguments("Public Sub M2()").WithLocation(6, 9), 1486Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M2()").WithArguments("Public Sub M2()").WithLocation(10, 9), 1487Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()", "don't use").WithLocation(14, 9) 1540Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9), 1541Diagnostic("TEST2", "M2()").WithArguments("Public Sub M2()", "don't use").WithLocation(6, 9), 1542Diagnostic("TEST3", "M3()").WithArguments("Public Sub M3()", "don't use").WithLocation(7, 9) 1586diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1593diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1633diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1640diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1689diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1696diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1745diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1752diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1831diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1838diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1895diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1902diags.Verify(Diagnostic("TEST1", "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1957diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 1964diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 2019diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 2026diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 2168diags.Verify(Diagnostic("A", "M1()").WithArguments("Public Overloads Sub M1()").WithLocation(5, 9)) 2308diags.Verify(Diagnostic("A", "M1()").WithArguments("Public Overloads Sub M1()").WithLocation(5, 9)) 2363diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 2370diags.Verify(Diagnostic(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "M1()").WithArguments("Public Sub M1()").WithLocation(5, 9)) 2729Diagnostic(ERRID.ERR_UseOfObsoleteSymbol2, "S").WithArguments("S", "Types with embedded references are not supported in this version of your compiler.").WithLocation(2, 16)
Attributes\AttributeTests_Synthesized.vb (1)
928Diagnostic(ERRID.ERR_InvalidModuleAttribute1, "RuntimeCompatibilityAttribute").WithArguments("RuntimeCompatibilityAttribute").WithLocation(4, 10))
Attributes\AttributeTests_WellKnownAttributes.vb (97)
1272Diagnostic(ERRID.ERR_AttributeMustInheritSysAttr, "DllImport").WithArguments("System.Runtime.InteropServices.DllImportAttribute")) 1344Diagnostic(ERRID.ERR_BadAttribute1, "Nothing").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1345Diagnostic(ERRID.ERR_BadAttribute1, """""").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1346Diagnostic(ERRID.ERR_BadAttribute1, "EntryPoint:=Nothing").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1347Diagnostic(ERRID.ERR_BadAttribute1, "EntryPoint:=""""").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1348Diagnostic(ERRID.ERR_BadAttribute1, "Nothing").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1349Diagnostic(ERRID.ERR_BadAttribute1, "EntryPoint:=Nothing").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1350Diagnostic(ERRID.ERR_BadAttribute1, "ChrW(0)").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1351Diagnostic(ERRID.ERR_BadAttribute1, "ChrW(0) & ""b""").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1352Diagnostic(ERRID.ERR_BadAttribute1, """b"" & ChrW(0)").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1353Diagnostic(ERRID.ERR_BadAttribute1, """x"" & ChrW(0) & ""y""").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1354Diagnostic(ERRID.ERR_BadAttribute1, "EntryPoint:=""x"" & ChrW(0) & ""y""").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1355Diagnostic(ERRID.ERR_BadAttribute1, "ChrW(&HDC00)").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1356Diagnostic(ERRID.ERR_BadAttribute1, "ChrW(&HDC00) & ChrW(&HD800)").WithArguments("System.Runtime.InteropServices.DllImportAttribute"), 1357Diagnostic(ERRID.ERR_BadAttribute1, "EntryPoint:=ChrW(&HDC00) & ChrW(&HD800)").WithArguments("System.Runtime.InteropServices.DllImportAttribute")) 1756Diagnostic(ERRID.ERR_DllImportOnInstanceMethod, "DllImport")) 1784Diagnostic(ERRID.ERR_DllImportOnNonEmptySubOrFunction, "System.Runtime.InteropServices.DllImport")) 1861Diagnostic(ERRID.ERR_DllImportNotLegalOnGetOrSet, "DllImport"), 1862Diagnostic(ERRID.ERR_DllImportNotLegalOnGetOrSet, "DllImport"), 1863Diagnostic(ERRID.ERR_DllImportNotLegalOnEventMethod, "DllImport"), 1864Diagnostic(ERRID.ERR_DllImportNotLegalOnEventMethod, "DllImport"), 1865Diagnostic(ERRID.ERR_DllImportNotLegalOnEventMethod, "DllImport"), 1866Diagnostic(ERRID.ERR_DllImportOnInstanceMethod, "DllImport"), 1867Diagnostic(ERRID.ERR_DllImportOnNonEmptySubOrFunction, "DllImport"), 1868Diagnostic(ERRID.ERR_DllImportOnGenericSubOrFunction, "DllImport"), 1869Diagnostic(ERRID.ERR_DllImportOnGenericSubOrFunction, "DllImport"), 1870Diagnostic(ERRID.ERR_DllImportOnInterfaceMethod, "DllImport"), 1871Diagnostic(ERRID.ERR_DllImportOnInterfaceMethod, "DllImport")) 2186Diagnostic(ERRID.ERR_DllImportNotLegalOnDeclare, "DllImport")) 2885Diagnostic(ERRID.ERR_BadDeclareFlags1, "Shared").WithArguments("Shared"), 2886Diagnostic(ERRID.ERR_BadDeclareFlags1, "Static").WithArguments("Static"), 2887Diagnostic(ERRID.ERR_BadDeclareFlags1, "ReadOnly").WithArguments("ReadOnly"), 2888Diagnostic(ERRID.ERR_BadDeclareFlags1, "WriteOnly").WithArguments("WriteOnly"), 2889Diagnostic(ERRID.ERR_BadDeclareFlags1, "Overrides").WithArguments("Overrides"), 2890Diagnostic(ERRID.ERR_BadDeclareFlags1, "Overridable").WithArguments("Overridable"), 2891Diagnostic(ERRID.ERR_BadDeclareFlags1, "MustOverride").WithArguments("MustOverride"), 2892Diagnostic(ERRID.ERR_BadDeclareFlags1, "NotOverridable").WithArguments("NotOverridable"), 2893Diagnostic(ERRID.ERR_BadDeclareFlags1, "Dim").WithArguments("Dim"), 2894Diagnostic(ERRID.ERR_BadDeclareFlags1, "Const").WithArguments("Const"), 2895Diagnostic(ERRID.ERR_BadDeclareFlags1, "Static").WithArguments("Static"), 2896Diagnostic(ERRID.ERR_BadDeclareFlags1, "Default").WithArguments("Default"), 2897Diagnostic(ERRID.ERR_BadDeclareFlags1, "WithEvents").WithArguments("WithEvents"), 2898Diagnostic(ERRID.ERR_BadDeclareFlags1, "Widening").WithArguments("Widening"), 2899Diagnostic(ERRID.ERR_BadDeclareFlags1, "Narrowing").WithArguments("Narrowing"), 2900Diagnostic(ERRID.ERR_BadDeclareFlags1, "Partial").WithArguments("Partial"), 2901Diagnostic(ERRID.ERR_BadDeclareFlags1, "MustInherit").WithArguments("MustInherit"), 2902Diagnostic(ERRID.ERR_BadDeclareFlags1, "NotInheritable").WithArguments("NotInheritable") 2920Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Lib"), 2921Diagnostic(ERRID.ERR_MissingLibInDeclare, "") 2939Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 2940Diagnostic(ERRID.ERR_IllegalChar, "$") 3665compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "AttributeUsage(AttributeTargets.Class)").WithArguments("AttributeUsageAttribute")) 3793compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "AttributeUsage(AttributeTargets.Class, AllowMultiple:= True)").WithArguments("AttributeUsageAttribute")) 4302Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4303Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4304Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "DirectCast(1, SecurityAction)").WithArguments("DirectCast(1, SecurityAction)"), 4305Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Assert").WithArguments("SecurityAction.Assert"), 4306Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Demand").WithArguments("SecurityAction.Demand"), 4307Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Deny").WithArguments("SecurityAction.Deny"), 4308Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.InheritanceDemand").WithArguments("SecurityAction.InheritanceDemand"), 4309Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.LinkDemand").WithArguments("SecurityAction.LinkDemand"), 4310Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.PermitOnly").WithArguments("SecurityAction.PermitOnly"), 4311Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "DirectCast(1, SecurityAction)").WithArguments("DirectCast(1, SecurityAction)"), 4312Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Assert").WithArguments("SecurityAction.Assert"), 4313Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Demand").WithArguments("SecurityAction.Demand"), 4314Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.Deny").WithArguments("SecurityAction.Deny"), 4315Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.InheritanceDemand").WithArguments("SecurityAction.InheritanceDemand"), 4316Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.LinkDemand").WithArguments("SecurityAction.LinkDemand"), 4317Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionAssembly, "SecurityAction.PermitOnly").WithArguments("SecurityAction.PermitOnly")) 4411Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestMinimum").WithArguments("RequestMinimum", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4412Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestOptional").WithArguments("RequestOptional", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4413Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestRefuse").WithArguments("RequestRefuse", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4414Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestMinimum").WithArguments("RequestMinimum", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4415Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestOptional").WithArguments("RequestOptional", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4416Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestRefuse").WithArguments("RequestRefuse", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4417Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestMinimum").WithArguments("SecurityAction.RequestMinimum"), 4418Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestOptional").WithArguments("SecurityAction.RequestOptional"), 4419Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestRefuse").WithArguments("SecurityAction.RequestRefuse"), 4420Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestMinimum").WithArguments("SecurityAction.RequestMinimum"), 4421Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestOptional").WithArguments("SecurityAction.RequestOptional"), 4422Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestRefuse").WithArguments("SecurityAction.RequestRefuse"), 4423Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestMinimum").WithArguments("RequestMinimum", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4424Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestOptional").WithArguments("RequestOptional", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4425Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestRefuse").WithArguments("RequestRefuse", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4426Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestMinimum").WithArguments("RequestMinimum", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4427Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestOptional").WithArguments("RequestOptional", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4428Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestRefuse").WithArguments("RequestRefuse", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4429Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestMinimum").WithArguments("SecurityAction.RequestMinimum"), 4430Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestOptional").WithArguments("SecurityAction.RequestOptional"), 4431Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestRefuse").WithArguments("SecurityAction.RequestRefuse"), 4432Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestMinimum").WithArguments("SecurityAction.RequestMinimum"), 4433Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestOptional").WithArguments("SecurityAction.RequestOptional"), 4434Diagnostic(ERRID.ERR_SecurityAttributeInvalidActionTypeOrMethod, "SecurityAction.RequestRefuse").WithArguments("SecurityAction.RequestRefuse")) 4469Diagnostic(ERRID.ERR_SecurityAttributeInvalidTarget, "MyPermission").WithArguments("MyPermissionAttribute")) 4496CreateCompilationWithMscorlib40(source).VerifyDiagnostics(Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 4497Diagnostic(ERRID.ERR_PrincipalPermissionInvalidAction, "SecurityAction.InheritanceDemand").WithArguments("SecurityAction.InheritanceDemand"), 4498Diagnostic(ERRID.ERR_PrincipalPermissionInvalidAction, "SecurityAction.LinkDemand").WithArguments("SecurityAction.LinkDemand"))
Attributes\EmitTestStrongNameProvider.vb (1)
43Diagnostic(ERRID.ERR_PeWritingFailure).WithArguments(thrownException.ToString()).WithLocation(1, 1))
Attributes\InternalsVisibleToAndStrongNameTests.vb (9)
102Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(keyFileName, CodeAnalysisResources.FileNotFound)) 132Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments("..\" & keyFileName, CodeAnalysisResources.FileNotFound)) 208Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(keyFileName, CodeAnalysisResources.FileNotFound)) 268Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(publicKeyFileName, CodeAnalysisResources.FileNotFound), 269Diagnostic(ERRID.WRN_DelaySignButNoKey)) 509Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(tmp.Path, CodeAnalysisResources.InvalidPublicKey)) 722c2.VerifyDiagnostics(Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments("bogus", CodeAnalysisResources.FileNotFound)) 1338Diagnostic(ERRID.ERR_InaccessibleSymbol2, "Base").WithArguments("Base", "Friend")) 2294Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: System.Runtime.CompilerServices.InternalsVisibleTo(""System.Runtime.Serialization, PublicKey = 10000000000000000400000000000000"")").WithArguments("System.Runtime.Serialization, PublicKey = 10000000000000000400000000000000").WithLocation(1, 2))
BreakingChanges.vb (6)
666Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"), 667Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"), 668Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"), 669Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 670Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 671Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"))
CodeGen\CodeGenClosureLambdaTests.vb (11)
578VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 620VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 713VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 766VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 820VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 876VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 951Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label2").WithArguments("Goto ", "label2", "label2"), 952Diagnostic(ERRID.ERR_CannotGotoNonScopeBlocksWithClosure, "goto label1").WithArguments("Goto ", "label1", "label1")) 1860VerifyDiagnostics(Diagnostic(ERRID.ERR_CannotLiftByRefParamLambda1, "x").WithArguments("x")) 1926VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_CannotLiftRestrictedTypeLambda, "lifted").WithArguments("System.ArgIterator")) 2290VerifyDiagnostics(Diagnostic(ERRID.ERR_CannotLiftByRefParamLambda1, "ex").WithArguments("ex"))
CodeGen\CodeGenConstLocal.vb (2)
750verifier.VerifyDiagnostics(Diagnostic(ERRID.ERR_CircularEvaluation1, "i").WithArguments("i"), 751Diagnostic(ERRID.ERR_CircularEvaluation1, "j").WithArguments("j"))
CodeGen\CodeGenEvents.vb (6)
1475Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1476Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1477Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1478Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1479Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1480Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"))
CodeGen\CodeGenLateBound.vb (4)
2749Diagnostic(ERRID.ERR_NameNotMember2, "I1.GoHome").WithArguments("GoHome", "Module1.II1"), 2750Diagnostic(ERRID.ERR_NameNotMember2, "I2.GoHome").WithArguments("GoHome", "Module1.II2")) 2799Diagnostic(ERRID.ERR_NameNotMember2, "I0.GoHome").WithArguments("GoHome", "Module1.II0"), 2800Diagnostic(ERRID.ERR_NameNotMember2, "I4.GoHome").WithArguments("GoHome", "Module1.II4"))
CodeGen\CodeGenNullable.vb (8)
1397).VerifyDiagnostics(Diagnostic(ERRID.WRN_EqualToLiteralNothing, "Nothing")) 3379comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ConstAsNonConstant, "Boolean?"), 3380Diagnostic(ERRID.ERR_ConstAsNonConstant, "ULong?"), 3381Diagnostic(ERRID.ERR_ConstAsNonConstant, "E?"), 3382Diagnostic(ERRID.ERR_ConstAsNonConstant, "S?")) 3427comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotMember2, "ns.field").WithArguments("field", "S?")) 3455Diagnostic(ERRID.WRN_EqualToLiteralNothing, "x = Nothing"), 3456Diagnostic(ERRID.WRN_NotEqualToLiteralNothing, "Nothing <> y")
CodeGen\CodeGenScriptTests.vb (8)
62Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "System.Console.WriteLine(1+1)")) 94c.VerifyDiagnostics(Diagnostic(ERRID.ERR_KeywordNotAllowedInScript, "Me").WithArguments("Me"), 95Diagnostic(ERRID.ERR_KeywordNotAllowedInScript, "Me").WithArguments("Me")) 115c.VerifyDiagnostics(Diagnostic(ERRID.ERR_KeywordNotAllowedInScript, "MyClass").WithArguments("MyClass"), 116Diagnostic(ERRID.ERR_KeywordNotAllowedInScript, "MyBase").WithArguments("MyBase")) 146CreateCompilationWithMscorlib40(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidInNamespace, "Sub Goo")) 236Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "1 ")) 417Diagnostic(ERRID.ERR_MissingRuntimeHelper).WithArguments("Task.GetAwaiter").WithLocation(1, 1))
CodeGen\CodeGenSelectCase.vb (7)
4536VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "number").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.CompareString")) 4551VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Select """""), 4552Diagnostic(ERRID.ERR_EndSelectNoSelect, "End Select")) 4565VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Select """""), 4566Diagnostic(ERRID.ERR_EndSelectNoSelect, "End Select")) 4626Diagnostic(ERRID.ERR_MissingRuntimeHelper, "number").WithArguments("System.String.get_Chars"), 4627Diagnostic(ERRID.ERR_MissingRuntimeHelper, "number").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.CompareString"))
CodeGen\CodeGenTests.vb (11)
6129VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "o = o").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual")) 6145VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "o = o").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual")) 6161VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "o = o").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual")) 6177VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "o = o").WithArguments("Microsoft.VisualBasic.CompilerServices.Operators.CompareObjectEqual")) 11874Diagnostic(ERRID.WRN_DefAsgNoRetValPropVal1, "End Get").WithArguments("P")) 13753Dim diagnostics = ImmutableArray(Of Diagnostic).Empty 13780Diagnostic(ERRID.ERR_TooLongOrComplexExpression, "a").WithLocation(7, 16) 13829Diagnostic(ERRID.ERR_TooLongOrComplexExpression, "1").WithLocation(13, 16) 13923Diagnostic(ERRID.ERR_TooLongOrComplexExpression, "a").WithLocation(7, 16), 13924Diagnostic(ERRID.ERR_TooLongOrComplexExpression, "a").WithLocation(7, 16), 13925Diagnostic(ERRID.ERR_TooLongOrComplexExpression, "a").WithLocation(7, 16)
CodeGen\CodeGenTuples.vb (22)
9797Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "x.goo.Alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer)").WithLocation(8, 34), 9798Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "x.goo.alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer)").WithLocation(9, 34), 9799Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "f.Alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer)").WithLocation(14, 34), 9800Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "f.alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer)").WithLocation(15, 34) 9858Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "x.goo.Alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer, Integer)").WithLocation(9, 34), 9859Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "x.goo.alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer, Integer)").WithLocation(10, 34), 9860Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "f.Alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer, Integer)").WithLocation(16, 34), 9861Diagnostic(ERRID.ERR_MetadataMembersAmbiguous3, "f.alice").WithArguments("Alice", "structure", "(Alice As Integer, alice As Integer, Integer)").WithLocation(17, 34) 10336Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(8, 34) 10661Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss.Rest.Rest.Rest").WithArguments("Rest").WithLocation(36, 34), 10662Diagnostic(ERRID.WRN_DefAsgUseNullRef, "ss.I31").WithArguments("I31").WithLocation(38, 34), 10663Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss.Rest.Rest").WithArguments("Rest").WithLocation(49, 34), 10664Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss.Rest").WithArguments("Rest").WithLocation(52, 34), 10665Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(55, 34), 10666Diagnostic(ERRID.WRN_DefAsgUseNullRef, "ss.I2").WithArguments("I2").WithLocation(58, 34)) 10817Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(44, 38), 10818Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(65, 38) 10900Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(43, 38), 10901Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss").WithArguments("ss").WithLocation(64, 38) 10946Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "ss.Rest").WithArguments("Rest").WithLocation(28, 38) 10982Diagnostic(ERRID.WRN_DefAsgUseNullRef, "ss.I3").WithArguments("I3").WithLocation(18, 38) 22286Diagnostic(ERRID.ERR_NoMostSpecificOverload2, "M1").WithArguments("M1", "
CodeGen\CodeGenUnstructuredErrorHandling.vb (8)
153Dim compilation = CreateCompilationWithMscorlib40AndVBRuntime(source, TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_MultiplyDefined1, "10").WithArguments("10")) 1045Dim compilation = CreateCompilationWithMscorlib40AndVBRuntime(source, TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_Syntax, "-")) 1121Dim compilation = CreateCompilationWithMscorlib40AndVBRuntime(source, TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_Syntax, "1L"), 1122Diagnostic(ERRID.ERR_Syntax, "2S"), 1123Diagnostic(ERRID.ERR_Syntax, "1%")) 1405options:=TestOptions.ReleaseDll.WithEmbedVbCoreRuntime(True)).VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotDeclared1, "Err").WithArguments("Err"), 1406Diagnostic(ERRID.ERR_NameNotDeclared1, "err").WithArguments("err"), 1407Diagnostic(ERRID.ERR_NameNotDeclared1, "err").WithArguments("err"))
CodeGen\CodeGenVBCore.vb (30)
2940compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_MissingRuntimeHelper, "Module1").WithArguments("Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute..ctor")) 3024Diagnostic(ERRID.ERR_NewInStruct, "New").WithLocation(20, 24), 3025Diagnostic(ERRID.ERR_StructCantInherit, "Inherits System.Exception").WithLocation(19, 13), 3026Diagnostic(ERRID.ERR_UseOfKeywordFromStructure1, "MyBase").WithArguments("MyBase").WithLocation(21, 17) 3122Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3123Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3124Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3125Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3126Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3127Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3128Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3129Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3130Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3131Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3132Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3133Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3134Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3135Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3136Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3137Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3138Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3139Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3140Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3141Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3142Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3143Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3144Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3145Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"), 3146Diagnostic(ERRID.ERR_UndefinedType1).WithArguments("Global.System.ComponentModel.EditorBrowsable"), 3147Diagnostic(ERRID.ERR_NameNotMember2).WithArguments("ComponentModel", "System"))
CodeGen\CodeGenWinMdEvents.vb (22)
28Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), 29Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), 30Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) 56Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), 57Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), 58Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) 84Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), 85Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), 86Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) 112Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "MissingReferences.winmdobj"), 113Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj"), 114Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "MissingReferences.winmdobj")) 162Diagnostic(ERRID.ERR_MissingRuntimeHelper, "RaiseEvent E()").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.get_InvocationList")) 196Diagnostic(ERRID.WRN_UndefinedOrEmptyNamespaceOrClass1, "System.Runtime.InteropServices.WindowsRuntime").WithArguments("System.Runtime.InteropServices.WindowsRuntime"), 197Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable(Of )", "test.winmdobj"), 198Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "test.winmdobj"), 199Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", "test.winmdobj"), 200Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.AddEventHandler"), 201Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.RemoveEventHandler"), 202Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.AddEventHandler"), 203Diagnostic(ERRID.ERR_MissingRuntimeHelper, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationTokenTable`1.RemoveEventHandler"), 204Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Runtime.InteropServices.WindowsRuntime"))
CodeGen\CodeGenWithBlock.vb (5)
886VerifyDiagnostics(Diagnostic(ERRID.WRN_MutableStructureInUsing, "s = New STRUCT()").WithArguments("s")). 2311c.VerifyDiagnostics(Diagnostic(ERRID.WRN_SharedMemberThroughInstance, "Me.ARR")) 2648Diagnostic(ERRID.ERR_CannotLiftAnonymousType1, ".y").WithArguments("y"), 2649Diagnostic(ERRID.ERR_BlockLocalShadowing1, "a").WithArguments("a")) 2689Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "c").WithArguments("c"))
CodeGen\CodeGenWithEvents.vb (9)
1873Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1874Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1875Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1876Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1877Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev"), 1878Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo2", "ev")) 1915Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"), 1916Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"), 1917Diagnostic(ERRID.ERR_EventHandlerSignatureIncompatible2, "ev").WithArguments("Goo", "ev"))
CodeGen\WinRTCollectionTests.vb (1)
6298Dim compRef = verifier.Compilation.EmitToImageReference(expectedWarnings:={Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System")})
Emit\CompilationEmitTests.vb (22)
76Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("RootNamespace", """Test""").WithLocation(1, 1), 77Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("""Test.Module1""").WithLocation(1, 1)) 83Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("RootNamespace", """решения""").WithLocation(1, 1), 84Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("""решения.Module1""").WithLocation(1, 1)) 423Diagnostic(ERRID.WRN_XMLDocParseError1, "<summary>").WithArguments("Element is missing an end tag.").WithLocation(4, 9), 424Diagnostic(ERRID.WRN_XMLDocParseError1, "").WithArguments("Expected beginning '<' for an XML tag.").WithLocation(4, 40), 425Diagnostic(ERRID.WRN_XMLDocParseError1, "").WithArguments("'>' expected.").WithLocation(4, 40)) 472Diagnostic(ERRID.WRN_XMLDocCrefAttributeNotFound1, "cref=""T""").WithArguments("T").WithLocation(4, 23)) 1173refonlyDiagnostics.Verify(Diagnostic(ERRID.ERR_CryptoHashFailed)) 1179refoutDiagnostics.Verify(Diagnostic(ERRID.ERR_CryptoHashFailed)) 3158Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestOptional").WithArguments("RequestOptional", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 3159Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.RequestMinimum").WithArguments("RequestMinimum", "Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.")) 3603Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments( 3648Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 3649Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information."), 3650Diagnostic(ERRID.ERR_PermissionSetAttributeInvalidFile, "File:=""NonExistentFile.xml""").WithArguments("NonExistentFile.xml", "File"), 3651Diagnostic(ERRID.ERR_PermissionSetAttributeInvalidFile, "File:=nothing").WithArguments("<empty>", "File")) 3668Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments("Deny", "Deny is obsolete and will be removed in a future release of the .NET Framework. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.").WithLocation(3, 25), 3669Diagnostic(ERRID.ERR_PermissionSetAttributeInvalidFile, "File:=""NonExistentFile.xml""").WithArguments("NonExistentFile.xml", "File").WithLocation(3, 46)) 3762comp.VerifyDiagnostics(Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2, "SecurityAction.Deny").WithArguments( 3771Diagnostic(ERRID.WRN_UseOfObsoleteSymbol2), 3772Diagnostic(ERRID.ERR_PermissionSetAttributeFileReadError))
Emit\DynamicAnalysis\DynamicInstrumentationTests.vb (9)
1443Diagnostic(ERRID.WRN_UnusedLocal, "y").WithArguments("y").WithLocation(3, 16), 1444Diagnostic(ERRID.WRN_UnusedLocal, "o1").WithArguments("o1").WithLocation(14, 13), 1445Diagnostic(ERRID.WRN_UnusedLocal, "aa").WithArguments("aa").WithLocation(6, 17), 1446Diagnostic(ERRID.WRN_UnusedLocal, "o4").WithArguments("o4").WithLocation(14, 67), 1447Diagnostic(ERRID.WRN_UnusedLocal, "bb").WithArguments("bb").WithLocation(6, 21), 1448Diagnostic(ERRID.WRN_UnusedLocal, "cc").WithArguments("cc").WithLocation(7, 17), 1449Diagnostic(ERRID.WRN_UnusedLocal, "dd").WithArguments("dd").WithLocation(7, 32)) 1915Dim diagnostics As ImmutableArray(Of Diagnostic) = CreateCompilation(source).GetEmitDiagnostics(EmitOptions.Default.WithInstrumentationKinds(ImmutableArray.Create(InstrumentationKind.TestCoverage))) 1916For Each Diagnostic As Diagnostic In diagnostics
Emit\EditAndContinue\AssemblyReferencesTests.vb (2)
275Diagnostic(ERRID.ERR_ModuleEmitFailure).WithArguments("C", 346Diagnostic(ERRID.ERR_ModuleEmitFailure).WithArguments("C",
Emit\EditAndContinue\EditAndContinueStateMachineTests.vb (7)
8868Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol, "F").WithArguments(CodeAnalysisResources.Attribute, "System.Runtime.CompilerServices.IteratorStateMachineAttribute").WithLocation(6, 30)) 8926Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol, "F").WithArguments(CodeAnalysisResources.Attribute, "System.Runtime.CompilerServices.IteratorStateMachineAttribute").WithLocation(12, 30)) 9097Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol).WithArguments(CodeAnalysisResources.Constructor, "System.Exception..ctor(string)").WithLocation(1, 1), 9098Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol, "F").WithArguments(CodeAnalysisResources.Attribute, "System.Runtime.CompilerServices.AsyncStateMachineAttribute").WithLocation(15, 27)) 9175Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol).WithArguments(CodeAnalysisResources.Constructor, "System.Exception..ctor(string)").WithLocation(1, 1), 9176Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol, "F").WithArguments(CodeAnalysisResources.Attribute, "System.Runtime.CompilerServices.AsyncStateMachineAttribute").WithLocation(15, 27)) 9215Diagnostic(ERRID.ERR_EncUpdateFailedMissingSymbol, "F").WithArguments(CodeAnalysisResources.Attribute, "System.Runtime.CompilerServices.IteratorStateMachineAttribute").WithLocation(5, 30))
Emit\EditAndContinue\EditAndContinueTests.vb (8)
54Diagnostic(ERRID.ERR_InvalidDebugInfo, "F").WithArguments("Public Sub F()", &H6000002, "test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "bug!").WithLocation(3, 29) 104Diagnostic(ERRID.ERR_NameNotDeclared1, "Unknown").WithArguments("Unknown").WithLocation(4, 17)) 158Diagnostic(ERRID.ERR_TypeInItsInheritsClause1, "Bad").WithArguments("Bad").WithLocation(9, 12)) 6673Diagnostic(ERRID.ERR_PDBWritingFailed).WithArguments("MockSymUnmanagedWriter error message")) 6798Diagnostic(ERRID.ERR_EncReferenceToAddedMember, "X").WithArguments("X", "LibA").WithLocation(8, 14), 6799Diagnostic(ERRID.ERR_EncReferenceToAddedMember, "M").WithArguments("M", "LibA").WithLocation(3, 16)) 7219Diagnostic(ERRID.ERR_AmbiguousInImports2, "Timer").WithArguments("Timer", "System.Threading, System.Timers").WithLocation(7, 21)) 7430Diagnostic(ERRID.ERR_ModuleEmitFailure).
Emit\EmitErrorTests.vb (1)
491Diagnostic(ERRID.ERR_CircularEvaluation1, "A").WithArguments("A")
Emit\EntryPointTests.vb (57)
84Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 117Diagnostic(ERRID.ERR_MoreThanOneValidMainWasFound2).WithArguments("a", "C.Main(), C.Main(a As String())")) 179compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("N.M")) 234compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("C(Of T).D")) 285compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("C")) 288compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("D(Of T).DD")) 291compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("I")) 379CreateCompilationWithMscorlib40(source, options:=TestOptions.ReleaseExe.WithMainTypeName("A.B.C")).VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("A.B(Of T).C")) 431compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("C(Of T)")) 459compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("C")) 530Diagnostic(ERRID.ERR_MoreThanOneValidMainWasFound2).WithArguments("a", "C.Main(), C.Main(a As String())")) 544compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("a")) 645compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("D")) 665Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("C")) 669Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("D")) 673Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("I")) 719compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("C")) 722compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("D")) 725compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("E")) 728compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("F")) 731compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("G.P")) 734compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("G.P.Q")) 771Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 788Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 811Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 827Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 844Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 864Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("a")) 880Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 911Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 927Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 943Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 959Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 975Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 994Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1013Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1032Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1052Diagnostic(ERRID.ERR_MoreThanOneValidMainWasFound2).WithArguments("a", "A.main(args As String()), M1.mAIN()")) 1071Diagnostic(ERRID.ERR_MoreThanOneValidMainWasFound2).WithArguments("a", "A.mAIN(), M1.mAIN()")) 1091Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1148Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1168Diagnostic(ERRID.ERR_MoreThanOneValidMainWasFound2).WithArguments("a", "BaseClass.Main(), Derived.Main()")) 1188Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("a")) 1203Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("a")) 1219Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("Main")) 1251Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("Main")) 1285Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("B")) 1288Diagnostic(ERRID.ERR_InValidSubMainsFound1).WithArguments("Extension")) 1306Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("i1")) 1309Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("color")) 1312Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("mydelegate")) 1325Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("1")) 1339Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("<")) 1405Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("B")) 1427Diagnostic(ERRID.ERR_GenericSubMainsFound1).WithArguments("B")) 1451Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("B")) 1478Diagnostic(ERRID.ERR_StartupCodeNotFound1).WithArguments("B"))
Emit\OptionalArgumentsTests.vb (4)
482comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_OmittedArgument2, "DateTimeUsingConstantAttribute").WithArguments("i", "Public Sub DateTimeUsingConstantAttribute(i As Date)")) 681comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotDeclared1, "p").WithArguments("p")) 1248comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeMismatch2, "IntegerWithDateTimeOptionalValue()").WithArguments("Date", "Integer")) 1257Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "StringWithOptionalDateTimeValue()").WithArguments("Date", "String"),
Emit\ResourceTests.vb (13)
192result.Diagnostics.Verify(Diagnostic(ERRID.ERR_UnableToOpenResourceFile1).WithArguments("file", "bad stuff")) 197result.Diagnostics.Verify(Diagnostic(ERRID.ERR_UnableToOpenResourceFile1).WithArguments("file", CodeAnalysisResources.ResourceDataProviderShouldReturnNonNullStream)) 272Diagnostic(ERRID.ERR_UnableToOpenResourceFile1).WithArguments("another.DoTtEd.NAME", New NotSupportedException().Message)) 300Diagnostic(ERRID.ERR_UnableToOpenResourceFile1).WithArguments("some.dotted.NAME", New NotSupportedException().Message)) 392result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DuplicateResourceName1).WithArguments("A")) 678result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DuplicateResourceName1).WithArguments("A")) 688result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DuplicateResourceName1).WithArguments("A")) 715result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DuplicateResourceFileName1).WithArguments("x.goo")) 735result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DuplicateResourceFileName1).WithArguments("netModule1.netmodule")) 796Diagnostic(ERRID.ERR_DuplicateResourceName1).WithArguments("A"), 797Diagnostic(ERRID.ERR_DuplicateResourceFileName1).WithArguments("x.goo")) 809Diagnostic(ERRID.ERR_DuplicateResourceFileName1).WithArguments("x.goo"), 810Diagnostic(ERRID.ERR_DuplicateResourceName1).WithArguments("B"))
ErrorHandling.vb (43)
172compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 173Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 174Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 175Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 176Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 177Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments("")) 206compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 207Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 208Diagnostic(ERRID.ERR_ObsoleteOnGotoGosub, ""), 209Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 210Diagnostic(ERRID.ERR_ExpectedExpression, ""), 211Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 212Diagnostic(ERRID.ERR_LabelNotDefined1, "[On]").WithArguments("On"), 213Diagnostic(ERRID.ERR_LabelNotDefined1, "[goto]").WithArguments("goto"), 214Diagnostic(ERRID.ERR_LabelNotDefined1, "[Error]").WithArguments("Error"), 215Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 216Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 217Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 218Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 219Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments("")) 391compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedSpecifier, "Labels"), 392Diagnostic(ERRID.ERR_ExpectedDeclaration, "sing"), 393Diagnostic(ERRID.ERR_ExpectedEOS, "."), 394Diagnostic(ERRID.ERR_DuplicateProcDef1, "GotoLabelInDifferentMethod").WithArguments("Public Sub GotoLabelInDifferentMethod()"), 395Diagnostic(ERRID.ERR_LabelNotDefined1, "goo").WithArguments("goo"), 396Diagnostic(ERRID.ERR_LabelNotDefined1, "diffMethodLabel").WithArguments("diffMethodLabel"), 397Diagnostic(ERRID.ERR_LabelNotDefined1, "DifferentMethod").WithArguments("DifferentMethod")) 446compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_TryAndOnErrorDoNotMix, ExpectedOutput), 447Diagnostic(ERRID.ERR_TryAndOnErrorDoNotMix, "On Error GoTo goo"), 448Diagnostic(ERRID.ERR_TryAndOnErrorDoNotMix, "On Error GoTo goo"), 449Diagnostic(ERRID.ERR_TryAndOnErrorDoNotMix, ExpectedOutput2) 477compilation.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, ExpectedOutput).WithArguments("Unstructured exception handling").WithLocation(2, 9)) 506compilation.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, "a + 1").WithArguments("Late binding").WithLocation(6, 13), 507Diagnostic(ERRID.ERR_PlatformDoesntSupport, "a & ""test""").WithArguments("Late binding").WithLocation(8, 13) 533compilation.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, ExpectedOutput).WithArguments("Like operator").WithLocation(5, 21)) 554compilation.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, "Error 1").WithArguments("Unstructured exception handling").WithLocation(4, 18)) 579compilation.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, "a + 1").WithArguments("Late binding").WithLocation(6, 40)) 599compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_PlatformDoesntSupport, "My").WithArguments("My").WithLocation(3, 13)) 622compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "On Error Goto goo")) 835compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, """3""").WithArguments("String", "Integer"), 836Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "4!").WithArguments("Single", "Integer")) 866compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_LabelNotDefined1, "handler").WithArguments("handler"), 867Diagnostic(ERRID.ERR_OnErrorInSyncLock, "On Error GoTo goo"))
ExpressionTrees\CodeGenExprLambda.vb (41)
1515).VerifyDiagnostics(Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1516Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x")) 1560Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1561Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1562Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1563Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1564Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1565Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1566Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1567Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1568Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1569Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1570Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1571Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1572Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1573Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1574Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1575Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1576Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1577Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1578Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1579Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1580Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1581Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1582Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1583Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1584Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1585Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1586Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1587Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1588Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1589Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1590Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1591Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1592Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1593Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1594Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x"), 1595Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "x")}) 4533Diagnostic(ERRID.WRN_DefAsgUseNullRef, "t3").WithArguments("t3"), 4534Diagnostic(ERRID.WRN_DefAsgUseNullRef, "t1").WithArguments("t1")}) 8758Diagnostic(ERRID.ERR_ExpressionTreeNotSupported, "x.City += ""qq""").WithLocation(39, 25)
PDB\ChecksumTests.vb (9)
72Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogUs.vb"", ""{406EA660-64CF-4C82-B6F0-42D48172A788}"", ""ab007f1d23d9"")").WithArguments("bogUs.vb"), 73Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogus1.cs"", ""{406EA660-64CF-4C82-B6F0-42D48172A798}"", ""ab007f1d23d9"")").WithArguments("bogus1.cs"), 74Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogus1.cs"", ""{406EA660-64CF-4C82-B6F0-42D48172A799}"", ""ab007f1d23d8"")").WithArguments("bogus1.cs") 106Diagnostic(ERRID.WRN_BadChecksumValExtChecksum, """ab007f1d23d"""), 107Diagnostic(ERRID.WRN_BadGUIDFormatExtChecksum, """{406EA660-64CF-4C82-B6F0-42D48172A79}"""), 108Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogus1.vb"", ""{406EA660-64CF-4C82-B6F0-42D48172A799}"", ""ab007f1d23"")").WithArguments("bogus1.vb"), 109Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogus1.vb"", ""{406EA660-64CF-4C82-B6F0-42D48172A799}"", """")").WithArguments("bogus1.vb") 150Diagnostic(ERRID.WRN_MultipleDeclFileExtChecksum, "#ExternalChecksum(""bogus1.vb"", ""{406EA660-64CF-4C82-B6F0-42D48172A799}"", ""ab007f1d23"")").WithArguments("bogus1.vb") 177Diagnostic(ERRID.WRN_BadGUIDFormatExtChecksum, """{406EA660-64CF-4C82-B6F0-42D48172A79A}""")
PDB\PDBExternalSourceDirectiveTests.vb (9)
602TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_NestedExternalSource, "#ExternalSource(""bar1.vb"", 41)"), 603Diagnostic(ERRID.ERR_EndExternalSource, "#End ExternalSource")) 627TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_EndExternalSource, "#End ExternalSource"), 628Diagnostic(ERRID.ERR_EndExternalSource, "#End ExternalSource"), 629Diagnostic(ERRID.ERR_ExpectedDeclaration, "boo")) 655TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_EndExternalSource, "#End ExternalSource"), 656Diagnostic(ERRID.ERR_ExpectedEndExternalSource, "#ExternalSource(""bar1.vb"", 23)"), 657Diagnostic(ERRID.ERR_ExpectedDeclaration, "boo")) 679TestOptions.ReleaseExe).VerifyDiagnostics(Diagnostic(ERRID.ERR_NestedExternalSource, "#ExternalSource (""bar1.vb"", 23)"))
PDB\PDBNamespaceScopes.vb (4)
471Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports N.SBad"), 472Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports ZBad = N.SBad"), 473Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports NIBad = N.IBad")) 544Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports X = N.B"))
PDB\PDBTests.vb (7)
34Diagnostic(ERRID.ERR_EncodinglessSyntaxTree, "Class A : End Class").WithLocation(1, 1), 35Diagnostic(ERRID.ERR_EncodinglessSyntaxTree, "Class C : End Class").WithLocation(1, 1)) 199result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition)) 202result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition)) 205result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition)) 208result.Diagnostics.Verify(Diagnostic(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition)) 233Diagnostic(ERRID.ERR_PDBWritingFailed).WithArguments(String.Format(CodeAnalysisResources.SymWriterMetadataOverLimit, "Public Shared Sub M1()", 69328, 65504)).WithLocation(1, 1))
PDB\PDBUsingTests.vb (7)
420Diagnostic(ERRID.WRN_UndefinedOrEmptyProjectNamespaceOrClass1).WithArguments("E.F"), 421Diagnostic(ERRID.WRN_UndefinedOrEmptyProjectNamespaceOrClass1).WithArguments("Q = G.H"), 422Diagnostic(ERRID.WRN_UndefinedOrEmptyNamespaceOrClass1, "A.B").WithArguments("A.B"), 423Diagnostic(ERRID.WRN_UndefinedOrEmptyNamespaceOrClass1, "C.D").WithArguments("C.D"), 424Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports A.B"), 425Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports Z = C.D")) 453Diagnostic(ERRID.ERR_InaccessibleSymbol2))
PDB\PortablePdbTests.vb (1)
272Diagnostic(ERRID.ERR_PDBWritingFailed).WithArguments("Error!").WithLocation(1, 1))
XmlLiteralTests.vb (2)
4297VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_TypeDisallowsElements, "objArray.<output>").WithArguments("Object()"), 4298Diagnostic(ERRID.ERR_TypeDisallowsAttributes, "objArray.@someAttrib").WithArguments("Object()"))
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (2)
EvaluationContext.vb (2)
542Friend Overrides Function HasDuplicateTypesOrAssemblies(diagnostic As Diagnostic) As Boolean 556Friend Overrides Function GetMissingAssemblyIdentities(diagnostic As Diagnostic, linqLibrary As AssemblyIdentity) As ImmutableArray(Of AssemblyIdentity)
Microsoft.CodeAnalysis.VisualBasic.Features (37)
CodeFixes\GenerateType\GenerateTypeCodeFixProvider.vb (1)
48Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (8)
28Protected Overrides Function CreatePragmaRestoreDirectiveTrivia(diagnostic As Diagnostic, formatNode As Func(Of SyntaxNode, CancellationToken, SyntaxNode), needsLeadingEndOfLine As Boolean, needsTrailingEndOfLine As Boolean, cancellationToken As CancellationToken) As SyntaxTriviaList 35Protected Overrides Function CreatePragmaDisableDirectiveTrivia(diagnostic As Diagnostic, formatNode As Func(Of SyntaxNode, CancellationToken, SyntaxNode), needsLeadingEndOfLine As Boolean, needsTrailingEndOfLine As Boolean, cancellationToken As CancellationToken) As SyntaxTriviaList 42Private Shared Function GetErrorCodes(diagnostic As Diagnostic, ByRef includeTitle As Boolean) As SeparatedSyntaxList(Of IdentifierNameSyntax) 54diagnostic As Diagnostic, 120diagnostic As Diagnostic, 155diagnostic As Diagnostic) As SyntaxNode 168diagnostic As Diagnostic, 177Private Shared Function CreateAttributeArguments(targetSymbol As ISymbol, diagnostic As Diagnostic, isAssemblyAttribute As Boolean) As ArgumentListSyntax
Diagnostics\Analyzers\TypeSyntaxSimplifierWalker.vb (6)
46Private _diagnostics As ImmutableArray(Of Diagnostic).Builder 56Public ReadOnly Property Diagnostics As ImmutableArray(Of Diagnostic) 58Return If(_diagnostics?.ToImmutable(), ImmutableArray(Of Diagnostic).Empty) 62Public ReadOnly Property DiagnosticsBuilder As ImmutableArray(Of Diagnostic).Builder 65Interlocked.CompareExchange(_diagnostics, ImmutableArray.CreateBuilder(Of Diagnostic)(), Nothing) 190Dim diagnostic As Diagnostic = Nothing
Diagnostics\Analyzers\VisualBasicSimplifyTypeNamesDiagnosticAnalyzer.vb (4)
38Protected Overrides Function AnalyzeCodeBlock(context As CodeBlockAnalysisContext, root As SyntaxNode) As ImmutableArray(Of Diagnostic) 46Return ImmutableArray(Of Diagnostic).Empty 54Protected Overrides Function AnalyzeSemanticModel(context As SemanticModelAnalysisContext, root As SyntaxNode, codeBlockIntervalTree As TextSpanMutableIntervalTree) As ImmutableArray(Of Diagnostic) 57Return ImmutableArray(Of Diagnostic).Empty
RemoveSharedFromModuleMembers\VisualBasicRemoveSharedFromModuleMembersCodeFixProvider.vb (1)
62Protected Overrides Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\Analyzers\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValDiagnosticAnalyzer.vb (1)
33syntaxContext.ReportDiagnostic(Diagnostic.Create(Descriptor, modifier.GetLocation(), additionalLocations:={parameterSyntax.GetLocation()}))
src\Analyzers\VisualBasic\CodeFixes\ConvertToAsync\VisualBasicConvertToAsyncFunctionCodeFixProvider.vb (2)
35Protected Overrides Async Function GetDescriptionAsync(diagnostic As Diagnostic, node As SyntaxNode, semanticModel As SemanticModel, cancellationToken As CancellationToken) As Task(Of String) 40Protected Overrides Async Function GetRootInOtherSyntaxTreeAsync(node As SyntaxNode, semanticModel As SemanticModel, diagnostic As Diagnostic, cancellationToken As CancellationToken) As Task(Of Tuple(Of SyntaxTree, SyntaxNode))
src\Analyzers\VisualBasic\CodeFixes\GenerateConstructor\GenerateConstructorCodeFixProvider.vb (1)
58Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateEnumMember\GenerateEnumMemberCodeFixProvider.vb (1)
40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateConversionCodeFixProvider.vb (1)
40Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\GenerateParameterizedMemberCodeFixProvider.vb (1)
59Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\GenerateVariable\VisualBasicGenerateVariableCodeFixProvider.vb (1)
52Protected Overrides Function IsCandidate(node As SyntaxNode, token As SyntaxToken, diagnostic As Diagnostic) As Boolean
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicChangeToYieldCodeFixProvider.vb (1)
36Protected Overrides Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\Iterator\VisualBasicConvertToIteratorCodeFixProvider.vb (1)
38Protected Overrides Async Function GetCodeFixAsync(root As SyntaxNode, node As SyntaxNode, document As Document, diagnostics As Diagnostic, cancellationToken As CancellationToken) As Task(Of CodeAction)
src\Analyzers\VisualBasic\CodeFixes\MakeMethodAsynchronous\VisualBasicMakeMethodAsynchronousCodeFixProvider.vb (1)
34Protected Overrides Function IsSupportedDiagnostic(diagnostic As Diagnostic, cancellationToken As CancellationToken) As Boolean
src\Analyzers\VisualBasic\CodeFixes\QualifyMemberAccess\VisualBasicQualifyMemberAccessCodeFixProvider.vb (1)
27Protected Overrides Function GetNode(diagnostic As Diagnostic, cancellationToken As CancellationToken) As SimpleNameSyntax
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryByVal\VisualBasicRemoveUnnecessaryByValCodeFixProvider.vb (1)
37Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (1)
54diagnostics As ImmutableArray(Of Diagnostic),
src\Analyzers\VisualBasic\CodeFixes\SimplifyObjectCreation\VisualBasicSimplifyObjectCreationCodeFixProvider.vb (1)
35Protected Overrides Async Function FixAllAsync(document As Document, diagnostics As ImmutableArray(Of Diagnostic), editor As SyntaxEditor, cancellationToken As CancellationToken) As Task
src\Analyzers\VisualBasic\CodeFixes\UseIsNotExpression\VisualBasicUseIsNotExpressionCodeFixProvider.vb (2)
35diagnostics As ImmutableArray(Of Diagnostic), 49diagnostic As Diagnostic,
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (17)
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (1)
35Sub(c) c.ReportDiagnostic(Diagnostic.Create(Rule, c.Node.GetLocation())),
Diagnostics\Suppression\SuppressionTests.vb (16)
711context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 786context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 830context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 896context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 1018context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 1023context.ReportDiagnostic(Diagnostic.Create(_descriptor, ns.Name.GetLocation())) 1028context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.GetLocation())) 1033context.ReportDiagnostic(Diagnostic.Create(_descriptor, p.Identifier.GetLocation())) 1038context.ReportDiagnostic(Diagnostic.Create(_descriptor, f.Declarators.First().Names.First.GetLocation())) 1043context.ReportDiagnostic(Diagnostic.Create(_descriptor, e.Identifier.GetLocation())) 1734context.ReportDiagnostic(Diagnostic.Create(_descriptor, classDecl.Identifier.GetLocation())) 1739context.ReportDiagnostic(Diagnostic.Create(_descriptor, ns.Name.GetLocation())) 1744context.ReportDiagnostic(Diagnostic.Create(_descriptor, method.Identifier.GetLocation())) 1749context.ReportDiagnostic(Diagnostic.Create(_descriptor, p.Identifier.GetLocation())) 1754context.ReportDiagnostic(Diagnostic.Create(_descriptor, f.Declarators.First().Names.First.GetLocation())) 1759context.ReportDiagnostic(Diagnostic.Create(_descriptor, e.Identifier.GetLocation()))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1478)
Binding\Binder_Statements_Tests.vb (18)
1217Diagnostic(ERRID.ERR_ArrayRankLimit, "(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)"), 1218Diagnostic(ERRID.ERR_ArrayRankLimit, "(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"), 1219Diagnostic(ERRID.ERR_ArrayRankLimit, "(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)")) 3338CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "While (true)")) 3353CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "While (true)")) 3366CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "If (true)")) 3381CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "If (true)")) 3395CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Try"), 3396Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Catch")) 3412CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Try"), 3413Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Catch")) 3426CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Do")) 3441CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Do")) 3454CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Else")) 3469CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Else")) 3489Diagnostic(ERRID.ERR_CantSpecifyNullableOnBoth, "As Integer?"), 3490Diagnostic(ERRID.ERR_DuplicateLocals1, "A?").WithArguments("A")) 3505CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidUseOfCustomModifier, "Custom"))
Binding\BindingErrorTests.vb (256)
415VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "MyAttribute").WithArguments("MyAttribute")) 543</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_CantRaiseBaseEvent, "MyEvent")) 1167VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeConstructor1, "myattr1").WithArguments("M1.c1()"), 1168Diagnostic(ERRID.ERR_BadAttributeConstructor1, "myattr2").WithArguments("M1.delegate1()")) 1189Diagnostic(ERRID.ERR_ParamArrayWithOptArgs, "s")) 1234Diagnostic(ERRID.ERR_ArrayRankLimit, "(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33)")) 1964</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstExpr, "Foo.FG")) 1991</compilation>, references:={Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstExpr, "(From x In q Select x).Count()")) 2018</compilation>, references:={Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "F1")) 2046</compilation>, references:={Net40.References.SystemCore}).VerifyDiagnostics({Diagnostic(ERRID.ERR_RequiredConstExpr, "(From x In ""s"" Select x).Count()"), 2047Diagnostic(ERRID.ERR_ObjectReferenceNotSupplied, "Program.F1")}) 2330CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedQueryableSource, "list2").WithArguments("Integer()"), 2331Diagnostic(ERRID.ERR_LValueRequired, "i"), 2332Diagnostic(ERRID.ERR_LValueRequired, "i")) 3058Diagnostic(ERRID.ERR_MissingRuntimeHelper, "P").WithArguments("Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger")) 3210Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "b & c").WithArguments("String", "Byte"), 3211Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "b ^ c").WithArguments("Double", "Byte"), 3212Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "s & t").WithArguments("String", "Short"), 3213Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "s ^ t").WithArguments("Double", "Short"), 3214Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "i & j").WithArguments("String", "Integer"), 3215Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "i ^ j").WithArguments("Double", "Integer"), 3216Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "l & m").WithArguments("String", "Long"), 3217Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "l ^ m").WithArguments("Double", "Long")) 3254Diagnostic(ERRID.ERR_TypeNotExpression1, "Program").WithArguments("Program")) 3835</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_NamedParamNotFound2, "t1").WithArguments("t1", "Public Overloads Sub Foo(y1 As Integer)"), 3836Diagnostic(ERRID.ERR_OmittedArgument2, "Foo").WithArguments("y1", "Public Overloads Sub Foo(y1 As Integer)")) 4879</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeMismatch2, "at2").WithArguments("<anonymous type: f2 As String, f1 As Object>", "<anonymous type: f1 As Object, f2 As String>")) 5142CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEOS, "{"), 5143Diagnostic(ERRID.ERR_TypeMismatch2, "{1, 2, 3}").WithArguments("Integer()", "System.Collections.Generic.List(Of Integer)")) 5158CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeMismatch2, "{1, 2, 3}").WithArguments("Integer()", "System.Collections.Generic.List(Of Integer)")) 5536</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadInstanceMemberAccess, "AddressOf EventHandler")) 5580</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_NewOnAbstractClass, "New C1"), 5581Diagnostic(ERRID.ERR_CantThrowNonException, "Throw (New C1)")) 5831</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleMember3, "PriSet").WithArguments("AttrRegress001.Attr", "Public Property PriSet As Short", "Private"), 5832Diagnostic(ERRID.ERR_InaccessibleMember3, "ProSet").WithArguments("AttrRegress001.Attr", "Public Property ProSet As Short", "Protected")) 6752</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BinaryOperands3, "first = second").WithArguments("=", "<anonymous type: a As Integer, b As Integer>", "<anonymous type: a As Integer, b As Integer>"), 6753Diagnostic(ERRID.ERR_BinaryOperands3, "second <> first").WithArguments("<>", "<anonymous type: a As Integer, b As Integer>", "<anonymous type: a As Integer, b As Integer>")) 7637Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S1").WithArguments("String", "Boolean"), 7638Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S2").WithArguments("SByte", "Boolean"), 7639Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S3").WithArguments("Byte", "Boolean"), 7640Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S4").WithArguments("Short", "Boolean"), 7641Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S5").WithArguments("UShort", "Boolean"), 7642Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S6").WithArguments("Integer", "Boolean"), 7643Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S7").WithArguments("UInteger", "Boolean"), 7644Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S8").WithArguments("Long", "Boolean"), 7645Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S9").WithArguments("Short?", "Boolean?"), 7646Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "S10").WithArguments("Integer?", "Boolean?")) 7885Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "New Res()").WithArguments("Res", "T"), 7886Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "New Res()").WithArguments("Res", "T"), 7887Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "New Res()").WithArguments("Res", "T"), 7888Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "New Res()").WithArguments("Res", "T")) 8262Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8265Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8268Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8271Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "tc2").WithArguments("Prop1", <![CDATA[ 8274Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "tc2").WithArguments("Prop1", <![CDATA[ 8277Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "tc3").WithArguments("Prop1", <![CDATA[ 8280Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "tc3").WithArguments("Prop1", <![CDATA[ 8329Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8332Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8335Diagnostic(ERRID.WRN_SharedMemberThroughInstance, "sc7.E"), 8336Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Foo").WithArguments("Foo", <![CDATA[ 8389compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_NoMostSpecificOverload2, "Foo").WithArguments("Foo", <![CDATA[ 8539Diagnostic(ERRID.ERR_NoGetProperty1, "P()").WithArguments("P"), 8540Diagnostic(ERRID.ERR_NoGetProperty1, "Q()").WithArguments("Q"), 8541Diagnostic(ERRID.ERR_NoGetProperty1, "R()").WithArguments("R"), 8542Diagnostic(ERRID.ERR_NoGetProperty1, "P").WithArguments("P"), 8543Diagnostic(ERRID.ERR_NoGetProperty1, "Q").WithArguments("Q"), 8544Diagnostic(ERRID.ERR_NoGetProperty1, "R").WithArguments("R")) 9012</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ArrayInitializerTooManyDimensions, "{1, ""one""}")) 9029Diagnostic(ERRID.ERR_ArrayInitializerTooManyDimensions, "{1, 2}"), 9030Diagnostic(ERRID.ERR_ArrayInitializerTooManyDimensions, "{3, 4}"), 9031Diagnostic(ERRID.ERR_ArrayInitializerTooManyDimensions, "{5, 6}"), 9032Diagnostic(ERRID.ERR_InitializerTooManyElements1, "{{1, 2}, {3, 4}, {5, 6}}").WithArguments("1"), 9033Diagnostic(ERRID.ERR_InitializerTooFewElements1, "{{{1, 2}, {3, 4}, {5, 6}}}").WithArguments("2")) 9048</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InitializerTooFewElements1, "{4, 5}").WithArguments("1")) 10144Diagnostic(ERRID.ERR_BadAttributePropertyType1, "A").WithArguments("A"), 10145Diagnostic(ERRID.ERR_DoubleToDateConversion, "1.1"), 10146Diagnostic(ERRID.ERR_BadAttributePropertyType1, "A").WithArguments("A"), 10147Diagnostic(ERRID.ERR_DoubleToDateConversion, "1.1")) ' BC30533: Dev10 NOT report 10165</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_PropertyOrFieldNotDefined1, "NotExist").WithArguments("NotExist")) 10427</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AddOrRemoveHandlerEvent, "Nothing")) 10742CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_CannotConvertValue2, "Asc(vbnullstring)").WithArguments("", "Integer")) 11061Diagnostic(ERRID.ERR_AttributeCannotBeAbstract, "My").WithArguments("MyAttribute"), 11062Diagnostic(ERRID.ERR_BadAttributeNonPublicConstructor, "My")) 11360compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredAttributeConstConversion2, "<a/>").WithArguments("System.Xml.Linq.XElement", "Object")) 11571Diagnostic(ERRID.ERR_CircularInference1, "x").WithArguments("x") 11774compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_AmbiguousWidestType3, "i").WithArguments("i")) 12284compilation1.VerifyDiagnostics(Diagnostic(ERRID.ERR_InAccessibleCoClass3, "New Class1.IFoo(1)").WithArguments("Class1.FooImpl", "Class1.IFoo", "Friend"), 12285Diagnostic(ERRID.ERR_InAccessibleCoClass3, "New Class1.IFoo(Nothing)").WithArguments("Class1.FooImpl", "Class1.IFoo", "Friend")) 12311</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_MissingValuesForArraysInApplAttrs, "{}")) 13764Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "arr1(0)").WithArguments("Integer"), 13765Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "arr2(0)").WithArguments("Integer")) 14045Diagnostic(ERRID.ERR_NoPartialMethodInAddressOf1, "Me.Foo").WithArguments("Private Sub Foo()"), 14046Diagnostic(ERRID.ERR_TypeMismatch2, "New Action(AddressOf Me.Foo)").WithArguments("System.Action", "C1.xEventHandler"), 14047Diagnostic(ERRID.ERR_NoPartialMethodInAddressOf1, "Me.Foo").WithArguments("Private Sub Foo()"), 14048Diagnostic(ERRID.ERR_TypeMismatch2, "New Action(AddressOf Me.Foo)").WithArguments("System.Action", "C1.xEventHandler")) 14143</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeSharedProperty1, "SharedField").WithArguments("SharedField"), 14144Diagnostic(ERRID.ERR_BadAttributeSharedProperty1, "ConstField").WithArguments("ConstField")) ' Dev10: 31510 14199</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeReadOnlyProperty1, "RP").WithArguments("RP")) 14282</compilation>, s_badAttributeIl).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeReadOnlyProperty1, "PROP").WithArguments("PROP")) 14310Diagnostic(ERRID.ERR_BadAttributeNonPublicProperty1, "Field").WithArguments("Field"), 14311Diagnostic(ERRID.ERR_BadAttributeNonPublicProperty1, "Prop").WithArguments("Prop") 14692</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotDeclared1, "E").WithArguments("E"), 14693Diagnostic(ERRID.ERR_AttrAssignmentNotFieldOrProp1, "E").WithArguments("E"), 14694Diagnostic(ERRID.ERR_AttrAssignmentNotFieldOrProp1, "S").WithArguments("S"), 14695Diagnostic(ERRID.ERR_AttrAssignmentNotFieldOrProp1, "F!").WithArguments("F")) 14831</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_NamedArgAlsoOmitted2, "Y").WithArguments("Y", "Public Sub foo(X As Byte, [Y As Byte = 0], [Z As Byte = 0])")) 15845Diagnostic(ERRID.ERR_AddressOfNullableMethod, "x.GetValueOrDefault").WithArguments("Integer?", "AddressOf"), 15846Diagnostic(ERRID.ERR_AddressOfNullableMethod, "x.GetValueOrDefault").WithArguments("Integer?", "AddressOf")) 16033compilation1.VerifyDiagnostics(Diagnostic(ERRID.ERR_CopyBackTypeMismatch3, "o").WithArguments("x", "Integer", "c2")) 16054Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i = 1 To v").WithArguments("S1", "+"), 16055Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i = 1 To v").WithArguments("S1", "-"), 16056Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i = 1 To v").WithArguments("S1", "<="), 16057Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i = 1 To v").WithArguments("S1", ">="), 16058Diagnostic(ERRID.WRN_DefAsgUseNullRef, "v").WithArguments("v")) 16090Diagnostic(ERRID.ERR_UnacceptableForLoopOperator2, "For i As C1(Of Integer) = 1 To 10").WithArguments("Public Shared Operator -(p1 As M1.C1(Of Integer), p2 As M1.C1(Of Integer)) As M1.C1(Of Short)", "M1.C1(Of Integer)"), 16091Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i As C1(Of Integer) = 1 To 10").WithArguments("M1.C1(Of Integer)", "<="), 16092Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i As C1(Of Integer) = 1 To 10").WithArguments("M1.C1(Of Integer)", ">=")) 16164</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadAttributeConstructor2, "MyAttr").WithArguments("Integer")) 16724</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_DelegateBindingTypeInferenceFails, "Foo")) 16739</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AnonymousTypeNeedField, "{")) 16788</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_NamedArgAlsoOmitted3, "Y").WithArguments("Y", "Public Sub ABC([Y As Byte = 0], [Z As Byte = 0])", "M")) 16808</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_NamedArgUsedTwice3, "Y").WithArguments("Y", "Public Sub ABC(Y As Byte, [Z As Byte = 0])", "M"), 16809Diagnostic(ERRID.ERR_NamedArgUsedTwice3, "Y").WithArguments("Y", "Public Sub ABC(Y As Byte, [Z As Byte = 0])", "M")) 16838</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_QueryOperatorNotFound, "Group Join").WithArguments("GroupJoin")) 16998Diagnostic(ERRID.ERR_QueryAnonymousTypeFieldNameInference, "Nothing"), 16999Diagnostic(ERRID.ERR_ExpectedProcedure, "From x In {""""} Select x, Nothing")) ' Extra in Roslyn & NOT in vbc 17028Diagnostic(ERRID.ERR_QueryDuplicateAnonTypeMemberName1, "Bar").WithArguments("Bar")) 17237</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeCharOnAggregation, "Bar$"), 17238Diagnostic(ERRID.ERR_QueryAnonymousTypeDisallowsTypeChar, "Bar$")) 17358</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17359Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17360Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17361Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17362Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17363Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17364Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17365Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17366Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17367Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17368Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17369Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17370Diagnostic(ERRID.ERR_QueryDuplicateAnonTypeMemberName1, "implicit").WithArguments("implicit"), 17371Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17372Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17373Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17374Diagnostic(ERRID.ERR_QueryDuplicateAnonTypeMemberName1, "implicit").WithArguments("implicit"), 17375Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17376Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17377Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17378Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17379Diagnostic(ERRID.WRN_DefAsgUseNullRef, "jj").WithArguments("jj"), 17380Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17381Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17382Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17383Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17384Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17385Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17386Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17387Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17388Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17389Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17390Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17391Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17392Diagnostic(ERRID.ERR_QueryDuplicateAnonTypeMemberName1, "implicit").WithArguments("implicit"), 17393Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17394Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17395Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17396Diagnostic(ERRID.ERR_QueryDuplicateAnonTypeMemberName1, "implicit").WithArguments("implicit"), 17397Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17398Diagnostic(ERRID.ERR_QueryOperatorNotFound, "implicit").WithArguments("implicit"), 17399Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17400Diagnostic(ERRID.ERR_IterationVariableShadowLocal2, "implicit").WithArguments("implicit"), 17401Diagnostic(ERRID.WRN_DefAsgUseNullRef, "jj").WithArguments("jj"), 17402Diagnostic(ERRID.WRN_DefAsgUseNullRef, "implicit").WithArguments("implicit")) 17541Diagnostic(ERRID.ERR_CannotLiftRestrictedTypeLambda, "x").WithArguments("System.ArgIterator")) 17592Diagnostic(ERRID.ERR_LambdaParamShadowLocal1, "x").WithArguments("x") 17609Diagnostic(ERRID.ERR_StrictDisallowImplicitObjectLambda, "y") 17700Diagnostic(ERRID.ERR_DelegateBindingMismatchStrictOff2, "System.Console.Read").WithArguments("Public Shared Overloads Function Read() As Integer", "AnonymousType Function <generated method>() As String")) 17732Diagnostic(ERRID.ERR_AccessMismatch6, "PrivateType").WithArguments("name", "TestClass.PrivateType", "namespace", "<Default>", "class", "TestClass"), 17733Diagnostic(ERRID.ERR_AccessMismatch6, "PrivateType").WithArguments("prop", "TestClass.PrivateType", "namespace", "<Default>", "class", "TestClass"), 17734Diagnostic(ERRID.ERR_AccessMismatch6, "PrivateType").WithArguments("foo", "TestClass.PrivateType", "namespace", "<Default>", "class", "TestClass"), 17735Diagnostic(ERRID.ERR_InaccessibleReturnTypeOfMember2, "tc.name").WithArguments("Public TestClass.name As TestClass.PrivateType"), 17736Diagnostic(ERRID.ERR_InaccessibleReturnTypeOfMember2, "tc.foo").WithArguments("Public Function TestClass.foo() As TestClass.PrivateType"), 17737Diagnostic(ERRID.ERR_InaccessibleReturnTypeOfMember2, "tc.prop").WithArguments("Public Property TestClass.prop As TestClass.PrivateType")) 17754Diagnostic(ERRID.ERR_LocalNamedSameAsParamInLambda1, "y").WithArguments("y") 17778</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_LambdaBindingMismatch2, 17803Diagnostic(ERRID.ERR_StatementLambdaInExpressionTree, <![CDATA[Function() 17836Diagnostic(ERRID.ERR_DelegateBindingMismatchStrictOff3, "o.moo(Of Integer)").WithArguments("Public Function moo(Of Integer)(y As Integer) As String", "Delegate Function M.del1g(Of String)(x As String) As String", "m1")) 17953Diagnostic(ERRID.ERR_LambdaTooManyTypesObjectDisallowed, "Function(a As Integer)") 17969Diagnostic(ERRID.ERR_LambdaNoType, "Function()")) 18441Diagnostic(ERRID.ERR_LambdaNoTypeObjectDisallowed, "Function()"), 18442Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("<anonymous method>") 19166Diagnostic(ERRID.WRN_SharedMemberThroughInstance, "1")) 19617Diagnostic(ERRID.WRN_DuplicateCatch, "Catch ex As Exception").WithArguments("System.Exception")) 20736VerifyDiagnostics(Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "b").WithArguments("b"), 20737Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "c").WithArguments("c"), 20738Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "d").WithArguments("d"), 20739Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "e").WithArguments("e"), 20740Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "f").WithArguments("f"), 20741Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "g").WithArguments("g")) 20797VerifyDiagnostics(Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "a").WithArguments("a"), 20798Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "b").WithArguments("b"), 20799Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "c").WithArguments("c"), 20800Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "d").WithArguments("d"), 20801Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "e").WithArguments("e"), 20802Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "f").WithArguments("f"), 20803Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "g").WithArguments("g")) 20918</compilation>).VerifyDiagnostics(Diagnostic(ERRID.WRN_LambdaPassedToRemoveHandler, "Function(m As Integer) m")) 20935</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_WithEventsAsStruct, "e"), 20936Diagnostic(ERRID.ERR_WithEventsAsStruct, "e1"), 20937Diagnostic(ERRID.ERR_WithEventsAsStruct, "e2")) 21308VerifyDiagnostics(compilation, Diagnostic(ERRID.WRN_DefAsgNoRetValFuncVal1, "End Function").WithArguments("<anonymous method>")) 23593VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpectedCase, "ca"), 23594Diagnostic(ERRID.ERR_NameNotDeclared1, "ca").WithArguments("ca")) 23623VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpectedSpecifier, "MAIN()"), 23624Diagnostic(ERRID.ERR_ExpectedDeclaration, "sharSub"), 23625Diagnostic(ERRID.ERR_ExpectedDeclaration, "lists"), 23626Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "SyncLock item"), 23627Diagnostic(ERRID.ERR_EndSyncLockNoSyncLock, "End SyncLock"), 23628Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return item.ToString() = """""), 23629Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), 23630Diagnostic(ERRID.ERR_ExpectedEOS, ")"), 23631Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub"), 23632Diagnostic(ERRID.WRN_UndefinedOrEmptyNamespaceOrClass1, "System.Linq").WithArguments("System.Linq"), 23633Diagnostic(ERRID.ERR_UndefinedType1, "myattribute1").WithArguments("myattribute1"), 23634Diagnostic(ERRID.ERR_UndefinedType1, "List(Of myattribute1)").WithArguments("List"), 23635Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Linq")) 23652VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_Syntax, """"""), 23653Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return lab1"), 23654Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), 23655Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return item.ToString() = """""), 23656Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), 23657Diagnostic(ERRID.ERR_ExpectedEOS, ")"), 23658Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub")) 23682VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_CaseNoSelect, "Case ""b""")) 23707VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_CaseNoSelect, "Case ""a"""), 23708Diagnostic(ERRID.ERR_CaseNoSelect, "Case ""b""")) 23725VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return Nothing"), 23726Diagnostic(ERRID.ERR_InvalidEndSub, "End sub")) 23744Diagnostic(ERRID.ERR_CircularEvaluation1, "X").WithArguments("X"), 23745Diagnostic(ERRID.WRN_DefAsgUseNullRef, "X").WithArguments("X")) 23768Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "Z").WithArguments("Z"), 23769Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "c").WithArguments("c")) 23790Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "Z").WithArguments("Z"), 23791Diagnostic(ERRID.ERR_RequiredConstConversion2, "2").WithArguments("Integer", "Object"), 23792Diagnostic(ERRID.ERR_RequiredConstConversion2, "1").WithArguments("Integer", "Object")) 23813Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "Y").WithArguments("Y"), 23814Diagnostic(ERRID.ERR_CircularEvaluation1, "Y").WithArguments("Y"), 23815Diagnostic(ERRID.ERR_CircularEvaluation1, "Z").WithArguments("Z"), 23816Diagnostic(ERRID.WRN_DefAsgUseNullRef, "Y").WithArguments("Y"), 23817Diagnostic(ERRID.WRN_DefAsgUseNullRef, "Z").WithArguments("Z")) 24259options:=TestOptions.ReleaseDll.WithEmbedVbCoreRuntime(True)).VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeClashesWithVbCoreType4, "HideModuleNameAttribute").WithArguments("class", "HideModuleNameAttribute", "class", "HideModuleNameAttribute"), 24260Diagnostic(ERRID.ERR_UndefinedType1, "Attribute").WithArguments("Attribute"), 24261Diagnostic(ERRID.ERR_OverrideNotNeeded3, "TypeId").WithArguments("property", "TypeId"))
Binding\ForEachTests.vb (12)
1418Diagnostic(ERRID.ERR_ExpectedIn, ""), 1419Diagnostic(ERRID.ERR_Syntax, ",")) 1447Diagnostic(ERRID.ERR_ExpectedIn, ""), 1448Diagnostic(ERRID.ERR_Syntax, "=")) 3853CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "For Each i In """""), 3854Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next")) 3870CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "For Each i In """""), 3871Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next")) 3942CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "For i As Integer = 1 To 100"), 3943Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next")) 3959CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "For i As Integer = 1 To 100"), 3960Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next"))
Binding\GenericsTests.vb (5)
226compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "CScen5b").WithArguments("CScen5b")) 245compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RestrictedType1, "RuntimeArgumentHandle()").WithArguments("System.RuntimeArgumentHandle")) 267compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RecordCycle2, "enumerator").WithArguments("s2", 335compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_WithEventsAsStruct, "x2")) 399Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports Tuple = System.Tuple"))
Binding\GotoTests.vb (51)
93</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 94Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments("")) 111</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEOS, "+"), 112Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 113Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 114Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments(""), 115Diagnostic(ERRID.ERR_LabelNotDefined1, "").WithArguments("")) 132Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "GoTo Labl"), 133Diagnostic(ERRID.ERR_InvOutsideProc, "Lab1:")) 149Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "goto Labl"), 150Diagnostic(ERRID.ERR_InvOutsideProc, "Lab1:"), 151Diagnostic(ERRID.ERR_InvalidInNamespace, "const x = 1"), 152Diagnostic(ERRID.ERR_InvalidInNamespace, "const y = 2")) 164Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "goto Labl"), 165Diagnostic(ERRID.ERR_InvOutsideProc, "Lab1:")) 184</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEOS, ",")) 207</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_Syntax, "100"), 208Diagnostic(ERRID.ERR_LabelNotDefined1, "100").WithArguments("100")) 229</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_Syntax, "100"), 230Diagnostic(ERRID.ERR_LabelNotDefined1, "100").WithArguments("100")) 249</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotDeclared1, "lab2").WithArguments("lab2")) 270</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedCase, "label1:")) 288</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_LabelNotDefined1, "label1").WithArguments("label1")) 306</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_GotoIntoFor, "Label").WithArguments("Label")) 327</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_LabelNotDefined1, "label2").WithArguments("label2")) 429</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "11"), 430Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "12"), 431Diagnostic(ERRID.ERR_Syntax, "16F"), 432Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "17"), 433Diagnostic(ERRID.ERR_Syntax, "19I"), 434Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "21"), 435Diagnostic(ERRID.ERR_Syntax, "23L"), 436Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "24"), 437Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "25"), 438Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "26"), 439Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "27"), 440Diagnostic(ERRID.ERR_Syntax, "31S"), 441Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "32"), 442Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "33"), 443Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "34"), 444Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "35"), 445Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "36"), 446Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "37"), 447Diagnostic(ERRID.ERR_ObsoleteLineNumbersAreLabels, "38")) 474</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_Syntax, "14D"), 475Diagnostic(ERRID.ERR_InvalidLiteralExponent, "15E"), 476Diagnostic(ERRID.ERR_Syntax, "16F"), 477Diagnostic(ERRID.ERR_Syntax, "19I"), 478Diagnostic(ERRID.ERR_Syntax, "23L"), 479Diagnostic(ERRID.ERR_Syntax, "29R"), 480Diagnostic(ERRID.ERR_Syntax, "31S"))
Binding\ImplicitVariableTests.vb (7)
131Diagnostic(ERRID.WRN_DefAsgUseNullRef, "x").WithArguments("x"), 132Diagnostic(ERRID.WRN_DefAsgUseNullRef, "Y").WithArguments("y")) 750Diagnostic(ERRID.WRN_DefAsgUseNullRef, "y").WithArguments("y"), 751Diagnostic(ERRID.WRN_DefAsgUseNullRef, "x").WithArguments("x")) 777Diagnostic(ERRID.WRN_DefAsgUseNullRef, "y").WithArguments("y"), 778Diagnostic(ERRID.WRN_DefAsgUseNullRef, "x").WithArguments("x"), 779Diagnostic(ERRID.WRN_DefAsgUseNullRef, "z").WithArguments("z"))
Binding\SyncLockTests.vb (34)
27</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "(1.0)").WithArguments("Double"), 28Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "(x)").WithArguments("Decimal")) 69</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "x").WithArguments("T"), 70Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "x").WithArguments("T")) 107</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEOS, "As"), 108Diagnostic(ERRID.ERR_NameNotDeclared1, "d").WithArguments("d")) 145</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExitWhileNotWithinWhile, "Exit While"), 146Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("<anonymous method>")) 184</compilation>, {Net40.References.SystemCore}).VerifyDiagnostics(Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "syncroot.PrintInt()").WithArguments("Integer"), 185Diagnostic(ERRID.ERR_VoidValue, "syncroot.PrintVoid"), 186Diagnostic(ERRID.WRN_DefAsgUseNullRef, "syncroot").WithArguments("syncroot")) 209</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "p1.p1").WithArguments("Decimal")) 237</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "Me").WithArguments("S1"), 238Diagnostic(ERRID.WRN_DefAsgNoRetValPropVal1, "End Get").WithArguments("MyProperty"), 239Diagnostic(ERRID.ERR_UseOfKeywordNotInInstanceMethod1, "Me").WithArguments("Me"), 240Diagnostic(ERRID.ERR_SyncLockRequiresReferenceType1, "Value").WithArguments("Integer")) 261</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEOS, ","), 262Diagnostic(ERRID.ERR_ExpectedEOS, ","), 263Diagnostic(ERRID.ERR_ExpectedEOS, ","), 264Diagnostic(ERRID.ERR_NameNotDeclared1, "x").WithArguments("x"), 265Diagnostic(ERRID.ERR_NameNotDeclared1, "i").WithArguments("i")) 283</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedExpression, ""), 284Diagnostic(ERRID.ERR_ExpectedExpression, "")) 339Diagnostic(ERRID.ERR_CaseElseNoSelect, "Case Else"), 340Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System")) 382</compilation>).VerifyDiagnostics(Diagnostic(ERRID.WRN_DefAsgUseNullRef, "myLock").WithArguments("myLock")) 402</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedEndTry, "Try"), 403Diagnostic(ERRID.ERR_EndTryNoTry, "End Try")) 415</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "SyncLock Nothing"), 416Diagnostic(ERRID.ERR_EndSyncLockNoSyncLock, "End SyncLock")) 430</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "SyncLock New Object()"), 431Diagnostic(ERRID.ERR_EndSyncLockNoSyncLock, "End SyncLock")) 447</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ElseNoMatchingIf, "Else")) 476Diagnostic(ERRID.ERR_CaseElseNoSelect, "Case Else"))
Binding\UsingTests.vb (43)
1004VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1005Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1006Diagnostic(ERRID.ERR_ClassNotExpression1, "System.Exception").WithArguments("System.Exception"), 1007Diagnostic(ERRID.ERR_ClassNotExpression1, "M1").WithArguments("M1"), 1008Diagnostic(ERRID.ERR_NameNotDeclared1, "E1").WithArguments("E1"), 1009Diagnostic(ERRID.ERR_VoidValue, "Main()"), 1010Diagnostic(ERRID.ERR_VoidValue, "AddressOf main"), 1011Diagnostic(ERRID.ERR_NameNotDeclared1, "C1").WithArguments("C1")) 1028VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "obj").WithArguments("T")) 1054VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj = New MyManagedClass1()").WithArguments("MyManagedClass1"), 1055Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As String = ""123""").WithArguments("String")) 1084Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj").WithArguments("MyManagedClass?"), 1085Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("MyManagedClass?"), 1086Diagnostic(ERRID.WRN_MutableStructureInUsing, "mnObj1 As Nullable(Of MyManagedClass) = Nothing").WithArguments("mnObj1")) 1196VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_GotoIntoUsing, "label5").WithArguments("label5")) 1339VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), 1340Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), 1341Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), 1342Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), 1343Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) 1447VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedExpression, ""), 1448Diagnostic(ERRID.ERR_InvalidEndFunction, "End Function"), 1449Diagnostic(ERRID.ERR_StrictDisallowImplicitObjectLambda, "x"), 1450Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x) x").WithArguments("Function <generated method>(x As Object) As Object"), 1451Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function()").WithArguments("Function <generated method>() As ?"), 1452Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "Function(x As MyManagedClass) x").WithArguments("Function <generated method>(x As MyManagedClass) As MyManagedClass")) 1471VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "c = New With {Key.p1 = 10.0, Key.p2 = ""a""c}").WithArguments("<anonymous type: Key p1 As Double, Key p2 As Char>")) 1497VerifyDiagnostics(compilation, Diagnostic(ERRID.WRN_MutableGenericStructureInUsing, "t1 As T = DirectCast(Function(tt As T) x, D1(Of T))(x)").WithArguments("t1")) 1540Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), 1541Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New"), 1542Diagnostic(ERRID.ERR_InvalidConstructorCall, "MyBase.New")) 1605VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 1606Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "x, = New MyManagedClass"), 1607Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "x")) 1641VerifyDiagnostics(compilation1, Diagnostic(ERRID.ERR_ExpectedQueryableSource, "objs").WithArguments("System.Collections.Generic.List(Of MyManagedClass)"), 1642Diagnostic(ERRID.ERR_InitWithMultipleDeclarators, "goo3, goo4 = x"), 1643Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "goo3"), 1644Diagnostic(ERRID.ERR_UsingResourceVarNeedsInitializer, "goo3"), 1645Diagnostic(ERRID.ERR_UsingRequiresDisposePattern, "goo3").WithArguments("Object")) 1659</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), 1660Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using")) 1672</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using Nothing"), 1673Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using"))
Compilation\CompilationAPITests.vb (15)
505Diagnostic(ERRID.ERR_InvalidDebugInformationFormat).WithArguments("-1"), 506Diagnostic(ERRID.ERR_InvalidOutputName).WithArguments("Name cannot start with whitespace."), 507Diagnostic(ERRID.ERR_InvalidFileAlignment).WithArguments("513"), 508Diagnostic(ERRID.ERR_InvalidSubsystemVersion).WithArguments("1000000.-1000000"), 509Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("invalid hash algorithm name")) 521Diagnostic(ERRID.ERR_InvalidHashAlgorithmName).WithArguments("")) 888assembly.VerifyDiagnostics(Diagnostic(ERRID.ERR_MissingNetModuleReference).WithArguments("missing1.netmodule")) 986Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Runtime.InteropServices")})}) 2158compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) 2165entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) 2199compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) 2206entryPoint.Diagnostics.Verify(Diagnostic(ERRID.WRN_MainIgnored, "Main").WithArguments("Public Shared Sub Main()").WithLocation(3, 20)) 2463c5.VerifyDiagnostics(Diagnostic(ERRID.ERR_UndefinedType1, "C").WithArguments("C").WithLocation(1, 40)) 2477c.VerifyDiagnostics(Diagnostic(ERRID.ERR_LinkedNetmoduleMetadataMustProvideFullPEImage).WithArguments("ModuleCS00").WithLocation(1, 1)) 2674Diagnostic(ERRID.ERR_UndefinedType1, "X").WithArguments("X"))
Compilation\ReferenceManagerTests.vb (13)
493Diagnostic(ERRID.ERR_NameNotMember2, "r.Dict").WithArguments("Dict", "R"), 494Diagnostic(ERRID.ERR_SxSIndirectRefHigherThanDirectRef3, "r.Goo(Nothing, Nothing)").WithArguments("B", "2.0.0.0", "1.0.0.0")) 663Diagnostic(ERRID.ERR_DuplicateReferenceStrong).WithArguments(NetFramework.System.Display, Net20.References.System.Display)) 923Diagnostic(ERRID.ERR_UndefinedType1, "C1").WithArguments("C1")) 1016Diagnostic(ERRID.ERR_DuplicateReference2).WithArguments("Culture", "EN-US"), 1017Diagnostic(ERRID.ERR_ExpectedEOS, "a"), 1018Diagnostic(ERRID.ERR_ExpectedEOS, "b")) 1185Diagnostic(ERRID.ERR_DuplicateReferenceStrong).WithArguments("System.v4_0_30319.dll", "System.v2_0_50727.dll")) 1629Diagnostic(ERRID.ERR_BadMetaDataReference1).WithArguments("NativeApp.exe", CodeAnalysisResources.PEImageDoesntContainManagedMetadata)) 1646Diagnostic(ERRID.ERR_BadMetaDataReference1).WithArguments("Empty.dll", CodeAnalysisResources.PEImageDoesntContainManagedMetadata)) 1795Diagnostic(ERRID.ERR_UnreferencedAssembly3, "A").WithArguments("D, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "D")) 1821Diagnostic(ERRID.ERR_UnreferencedAssembly3, "A").WithArguments("B, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "D")) 1923Diagnostic(ERRID.ERR_SxSIndirectRefHigherThanDirectRef3, "A").WithArguments("B", "2.0.0.0", "1.0.0.0"))
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (4)
2115Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 2116Diagnostic(ERRID.ERR_IllegalChar, "$"), 2117Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 2118Diagnostic(ERRID.ERR_IllegalChar, "$"))
Compilation\VisualBasicCompilationOptionsTests.vb (23)
359Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 388Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 420Diagnostic(ERRID.WRN_UnusedLocal, "x").WithArguments("x"), 421Diagnostic(ERRID.WRN_UnusedLocal, "y").WithArguments("y"), 422Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z"), 423Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo")) 438Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z"), 439Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo")) 448comp.VerifyDiagnostics(Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo")) 455Diagnostic(ERRID.WRN_UnusedLocal, "x").WithArguments("x").WithWarningAsError(True), 456Diagnostic(ERRID.WRN_UnusedLocal, "y").WithArguments("y").WithWarningAsError(True), 457Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z").WithWarningAsError(True), 458Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo").WithWarningAsError(True)) 467Diagnostic(ERRID.WRN_UnusedLocal, "x").WithArguments("x"), 468Diagnostic(ERRID.WRN_UnusedLocal, "y").WithArguments("y"), 469Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z"), 470Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo").WithWarningAsError(True)) 480Diagnostic(ERRID.WRN_UnusedLocal, "x").WithArguments("x"), 481Diagnostic(ERRID.WRN_UnusedLocal, "y").WithArguments("y"), 482Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z").WithWarningAsError(True), 483Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo").WithWarningAsError(True)) 492Diagnostic(ERRID.WRN_UnusedLocalConst, "z").WithArguments("z").WithWarningAsError(True), 493Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo").WithWarningAsError(True))
Diagnostics\DiagnosticAnalyzerTests.vb (88)
59Dim diags = New Diagnostic() {noneDiag, infoDiag, warningDiag, errorDiag} 140Dim diags = New Diagnostic() {noneDiag, infoDiag, warningDiag, errorDiag} 297comp.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic("XX001", <![CDATA[Public Module ThisModule]]>)) 342compilation.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic("XX001", <![CDATA[C]]>)) 392Diagnostic("XX001", <![CDATA[N]]>), 393Diagnostic("XX001", <![CDATA[C]]>)) 458compilation.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic("CodeBlockDiagnostic", <![CDATA[Public Sub Method()]]>)) 534Diagnostic("FieldSymbolDiagnostic", <![CDATA[X]]>)) 556Diagnostic("FieldSymbolDiagnostic", <![CDATA[Field]]>)) 602Diagnostic("FieldDeclarationDiagnostic", <![CDATA[Dim x, y As Integer]]>), 603Diagnostic("FieldDeclarationDiagnostic", <![CDATA[Dim z As Integer]]>), 604Diagnostic("FieldDeclarationDiagnostic", <![CDATA[Dim x2 = 0, y2 = 0]]>), 605Diagnostic("FieldDeclarationDiagnostic", <![CDATA[Dim z2 = 0]]>)) 626Diagnostic(VisualBasicNamespaceDeclarationAnalyzer.DiagnosticId, <![CDATA[Namespace Goo.Bar.GooBar]]>)) 659Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C1()]]>), 660Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C2()]]>), 661Diagnostic(VisualBasicCodeBlockObjectCreationAnalyzer.DiagnosticDescriptor.Id, <![CDATA[New C3()]]>)) 681Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 694Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 706compilation.VerifyAnalyzerDiagnostics({analyzer}, Nothing, Nothing, Diagnostic(NotConfigurableDiagnosticAnalyzer.EnabledRule.Id)) 727Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, <![CDATA[M]]>).WithArguments("M"), 728Diagnostic(CodeBlockActionAnalyzer.CodeBlockPerCompilationRule.Id, <![CDATA[M]]>).WithArguments("M")) 749Diagnostic(CodeBlockActionAnalyzer.CodeBlockTopLevelRule.Id, <![CDATA[M]]>).WithArguments("M")) 996Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(8, 28), 997Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(9, 28), 998Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(12, 36)) 1017Diagnostic("Parameter_ID", "a").WithLocation(2, 18), 1018Diagnostic("Parameter_ID", "b").WithLocation(2, 32)) 1037Diagnostic("Parameter_ID", "a").WithLocation(2, 20), 1038Diagnostic("Parameter_ID", "b").WithLocation(2, 34)) 1062Diagnostic("Parameter_ID", "a").WithLocation(2, 34), 1063Diagnostic("Parameter_ID", "b").WithLocation(2, 48), 1064Diagnostic("Parameter_ID", "Value").WithLocation(6, 19)) 1082Diagnostic("Parameter_ID", "a").WithLocation(2, 34), 1083Diagnostic("Parameter_ID", "b").WithLocation(2, 48)) 1103Diagnostic("Parameter_ID", "h1").WithLocation(2, 36), 1104Diagnostic("Parameter_ID", "h2").WithLocation(2, 51)) 1128Diagnostic("Parameter_ID", "a").WithLocation(2, 11), 1129Diagnostic("Parameter_ID", "b").WithLocation(2, 25), 1130Diagnostic("Parameter_ID", "a").WithLocation(7, 18), 1131Diagnostic("Parameter_ID", "b").WithLocation(7, 32)) 1153Diagnostic("Parameter_ID", "a").WithLocation(2, 35), 1154Diagnostic("Parameter_ID", "b").WithLocation(2, 49)) 1317Dim diag = Diagnostic(GeneratedCodeAnalyzer.Warning.Id, squiggledText).WithArguments(arguments).WithLocation(line, column) 1320diag = Diagnostic(GeneratedCodeAnalyzer.Error.Id, squiggledText).WithArguments(arguments).WithLocation(line, column) 1330Dim diag = Diagnostic(diagnosticId, squiggledText).WithArguments(arguments).WithLocation(line, column) 1462Diagnostic("ID", "C.FieldForClass").WithArguments("FieldForClass", "1").WithLocation(16, 14), 1463Diagnostic("ID", "FieldForStruct").WithArguments("FieldForStruct", "2").WithLocation(27, 18), 1464Diagnostic("ID", "FieldForInterface").WithArguments("FieldForInterface", "3").WithLocation(31, 18), 1465Diagnostic("ID", "FieldForField").WithArguments("FieldForField", "4").WithLocation(35, 18), 1466Diagnostic("ID", "FieldForField").WithArguments("FieldForField", "4").WithLocation(35, 18), 1467Diagnostic("ID", "FieldForMethod").WithArguments("FieldForMethod", "5").WithLocation(38, 18), 1468Diagnostic("ID", "FieldForEnum").WithArguments("FieldForEnum", "6").WithLocation(43, 18), 1469Diagnostic("ID", "FieldForEnumMember").WithArguments("FieldForEnumMember", "7").WithLocation(45, 22), 1470Diagnostic("ID", "FieldForDelegateSub").WithArguments("FieldForDelegateSub", "8").WithLocation(49, 18), 1471Diagnostic("ID", "FieldForDelegateFunction").WithArguments("FieldForDelegateFunction", "9").WithLocation(52, 18), 1472Diagnostic("ID", "FieldForEventField").WithArguments("FieldForEventField", "10").WithLocation(55, 18), 1473Diagnostic("ID", "FieldForEvent").WithArguments("FieldForEvent", "11").WithLocation(58, 18), 1474Diagnostic("ID", "FieldForAddHandler").WithArguments("FieldForAddHandler", "12").WithLocation(60, 22), 1475Diagnostic("ID", "FieldForRemoveHandler").WithArguments("FieldForRemoveHandler", "13").WithLocation(63, 22), 1476Diagnostic("ID", "FieldForRaiseHandler").WithArguments("FieldForRaiseHandler", "14").WithLocation(66, 22), 1477Diagnostic("ID", "FieldForProperty").WithArguments("FieldForProperty", "15").WithLocation(71, 18), 1478Diagnostic("ID", "FieldForPropertyGetter").WithArguments("FieldForPropertyGetter", "16").WithLocation(73, 22), 1479Diagnostic("ID", "FieldForPropertySetter").WithArguments("FieldForPropertySetter", "17").WithLocation(77, 22), 1480Diagnostic("ID", "FieldForIndexer").WithArguments("FieldForIndexer", "18").WithLocation(82, 18), 1481Diagnostic("ID", "FieldForIndexerGetter").WithArguments("FieldForIndexerGetter", "19").WithLocation(84, 22), 1482Diagnostic("ID", "FieldForIndexerSetter").WithArguments("FieldForIndexerSetter", "20").WithLocation(88, 22), 1483Diagnostic("ID", "FieldForMethodParameter").WithArguments("FieldForMethodParameter", "21").WithLocation(39, 38), 1484Diagnostic("ID", "FieldForEventParameter").WithArguments("FieldForEventParameter", "22").WithLocation(56, 39), 1485Diagnostic("ID", "FieldForDelegateSubParameter").WithArguments("FieldForDelegateSubParameter", "23").WithLocation(50, 49), 1486Diagnostic("ID", "FieldForDelegateFunctionParameter").WithArguments("FieldForDelegateFunctionParameter", "24").WithLocation(53, 53), 1487Diagnostic("ID", "FieldForIndexerParameter").WithArguments("FieldForIndexerParameter", "25").WithLocation(83, 40), 1488Diagnostic("ID", "C.FieldForAssembly").WithArguments("FieldForAssembly", "26").WithLocation(3, 24), 1489Diagnostic("ID", "C.FieldForModule").WithArguments("FieldForModule", "27").WithLocation(4, 22), 1490Diagnostic("ID", "FieldForMethodReturnType").WithArguments("FieldForMethodReturnType", "28").WithLocation(39, 95), 1491Diagnostic("ID", "FieldForDelegateFunctionReturnType").WithArguments("FieldForDelegateFunctionReturnType", "29").WithLocation(53, 120), 1492Diagnostic("ID", "FieldForPropertyReturnType").WithArguments("FieldForPropertyReturnType", "30").WithLocation(72, 43), 1493Diagnostic("ID", "FieldForIndexerReturnType").WithArguments("FieldForIndexerReturnType", "31").WithLocation(83, 101)) 1591Diagnostic("ID", "0").WithArguments("Operation").WithLocation(2, 43), 1592Diagnostic("ID", "1").WithArguments("Operation").WithLocation(3, 28), 1593Diagnostic("ID", "2").WithArguments("Operation").WithLocation(3, 32)) 1598Diagnostic("ID", "0").WithArguments("OperationInOperationBlockStart").WithLocation(2, 43), 1599Diagnostic("ID", "1").WithArguments("OperationInOperationBlockStart").WithLocation(3, 28), 1600Diagnostic("ID", "2").WithArguments("OperationInOperationBlockStart").WithLocation(3, 32)) 1605Diagnostic("ID", "M").WithArguments("OperationBlock").WithLocation(2, 17)) 1610Diagnostic("ID", "M").WithArguments("OperationBlockEnd").WithLocation(2, 17)) 1646Diagnostic("SymbolStartRuleId").WithArguments("MyApplication", "Analyzer1").WithLocation(1, 1)) 1673Private Shared Sub TestAdditionalFileAnalyzer_VerifyDiagnostics(diagnostics As ImmutableArray(Of Diagnostic),
Diagnostics\GetDiagnosticsTests.vb (25)
532Diagnostic("ID0001", "Private Function M() As Integer").WithArguments("M").WithLocation(41, 5), 533Diagnostic("ID0001", "Private Sub New()").WithArguments(".ctor").WithLocation(45, 5), 534Diagnostic("ID0001", "Protected Overrides Sub Finalize()").WithArguments("Finalize").WithLocation(49, 5), 535Diagnostic("ID0001", "Public Shared Operator +(value As D) As Integer").WithArguments("op_UnaryPlus").WithLocation(53, 5)) 537Diagnostic("ID0002", "Get 540Diagnostic("ID0002", "Set(value As Integer) 543Diagnostic("ID0002", "Get 546Diagnostic("ID0002", "Set(value As Integer) 549Diagnostic("ID0002", "AddHandler(value As EventHandler) 552Diagnostic("ID0002", "RemoveHandler(value As EventHandler) 555Diagnostic("ID0002", "RaiseEvent(ByVal sender As Object, ByVal e As EventArgs) 558Diagnostic("ID0002", "Private Function M() As Integer 561Diagnostic("ID0002", "Private Sub New() 564Diagnostic("ID0002", "Protected Overrides Sub Finalize() 567Diagnostic("ID0002", "Public Shared Operator +(value As D) As Integer 572Diagnostic("ID0001", "Private Property P As Integer").WithArguments("set_P").WithLocation(7, 5), 573Diagnostic("ID0001", "Private Property P As Integer").WithArguments("get_P").WithLocation(7, 5), 574Diagnostic("ID0001", "Private Property Item(i As Char) As Integer").WithArguments("set_Item").WithLocation(17, 5), 575Diagnostic("ID0001", "Private Property Item(i As Char) As Integer").WithArguments("get_Item").WithLocation(17, 5), 576Diagnostic("ID0001", "Public Custom Event E As EventHandler").WithArguments("add_E").WithLocation(27, 5), 577Diagnostic("ID0001", "Public Custom Event E As EventHandler").WithArguments("raise_E").WithLocation(27, 5), 578Diagnostic("ID0001", "Public Custom Event E As EventHandler").WithArguments("remove_E").WithLocation(27, 5)) 655Private Sub AnalyzeNode(node As SyntaxNode, containingSymbol As ISymbol, reportDiagnostic As Action(Of Diagnostic)) 701Diagnostic("ID0001", "A1 = 0").WithLocation(4, 9), 702Diagnostic("ID0001", "A2 = 0").WithLocation(9, 5))
Diagnostics\OperationAnalyzerTests.vb (314)
49Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1) { }").WithLocation(3, 33), 50Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "{ }").WithLocation(4, 30), 51Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New C(-1) { }").WithLocation(5, 27), 52Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1)() { }").WithLocation(9, 35), 53Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer( -1)()()() { }").WithLocation(10, 39), 54Diagnostic(EmptyArrayAnalyzer.UseArrayEmptyDescriptor.Id, "New Integer(-1)(,) { }").WithLocation(12, 37)) 100Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(6, 32), 101Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v1").WithLocation(6, 39), 102Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(7, 29), 103Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "3").WithLocation(9, 21), 104Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "v3").WithLocation(12, 21), 105Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "p1").WithLocation(27, 9), 106Diagnostic(BoxingOperationAnalyzer.BoxingDescriptor.Id, "Me").WithLocation(28, 13)) 130Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz()").WithLocation(3, 9), 131Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz()").WithLocation(3, 9), 132Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Framitz").WithLocation(3, 9), 133Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Framitz").WithLocation(3, 9), 134Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley()").WithLocation(4, 28), 135Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley()").WithLocation(4, 28), 136Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "Bexley").WithLocation(4, 28), 137Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Bexley").WithLocation(4, 28), 138Diagnostic(BadStuffTestAnalyzer.InvalidExpressionDescriptor.Id, "M1(d)").WithLocation(7, 9), 139Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "M1(d)").WithLocation(7, 9), 140Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "Goto").WithLocation(8, 9), 141Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "Goto").WithLocation(8, 9), 142Diagnostic(BadStuffTestAnalyzer.InvalidStatementDescriptor.Id, "").WithLocation(8, 13), 143Diagnostic(BadStuffTestAnalyzer.IsInvalidDescriptor.Id, "").WithLocation(8, 13)) 234comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(60, 17), 235Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(68, 1), 236Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(74, 22)) 238Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(12, 21), 239Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(30, 21), 240Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(37, 21), 241Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(37, 21), 242Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(42, 21), 243Diagnostic(SwitchTestAnalyzer.OnlyDefaultSwitchDescriptor.Id, "x").WithLocation(49, 21), 244Diagnostic(SwitchTestAnalyzer.SparseSwitchDescriptor.Id, "x").WithLocation(54, 21), 245Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "x").WithLocation(54, 21)) 289Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(Nothing,)").WithArguments("b").WithLocation(25, 9), 290Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,0)").WithArguments("a").WithLocation(26, 9), 291Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("a").WithLocation(27, 9), 292Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("b").WithLocation(27, 9), 293Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(11, 21), 294Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "4").WithLocation(12, 33), 295Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(12, 21), 296Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "1").WithLocation(12, 15), 297Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(14, 9), 298Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(15, 9), 299Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "3").WithLocation(17, 21)) 363Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(6, 12), 364Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(7, 12), 365Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(10, 12)) 429Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F5").WithLocation(6, 19), 430Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F6").WithLocation(7, 19), 431Diagnostic(FieldCouldBeReadOnlyAnalyzer.FieldCouldBeReadOnlyDescriptor.Id, "F10").WithLocation(10, 19)) 483Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "e").WithLocation(10, 13), 484Diagnostic(LocalCouldBeConstAnalyzer.LocalCouldBeConstDescriptor.Id, "s").WithLocation(11, 13)) 648Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "a").WithArguments("a", "Middle").WithLocation(3, 13), 649Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "b").WithArguments("b", "Value").WithLocation(4, 13), 650Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "c").WithArguments("c", "Base").WithLocation(5, 13), 651Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "d").WithArguments("d", "Derived").WithLocation(7, 13), 652Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "e").WithArguments("e", "Middle").WithLocation(8, 13), 653Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "g").WithArguments("g", "Base").WithLocation(12, 13), 654Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "i").WithArguments("i", "Integer").WithLocation(17, 13), 655Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "k").WithArguments("k", "Derived").WithLocation(21, 13), 656Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ia").WithArguments("ia", "IMiddle").WithLocation(31, 13), 657Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ic").WithArguments("ic", "IBase1").WithLocation(32, 13), 658Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "id").WithArguments("id", "IDerived").WithLocation(34, 13), 659Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ie").WithArguments("ie", "IMiddle").WithLocation(35, 13), 660Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ig").WithArguments("ig", "IBase1").WithLocation(39, 13), 661Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "ik").WithArguments("ik", "IDerived").WithLocation(44, 13), 662Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.LocalCouldHaveMoreSpecificTypeDescriptor.Id, "im").WithArguments("im", "IDerived").WithLocation(48, 13), 663Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fa").WithArguments("Private fa As Object", "Middle").WithLocation(53, 13), 664Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fb").WithArguments("Private fb As Object", "Value").WithLocation(54, 13), 665Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fc").WithArguments("Private fc As Object", "Base").WithLocation(55, 13), 666Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fd").WithArguments("Private fd As Base", "Derived").WithLocation(56, 13), 667Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fe").WithArguments("Private fe As Base", "Middle").WithLocation(57, 13), 668Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fg").WithArguments("Private fg As Object", "Base").WithLocation(59, 13), 669Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fi").WithArguments("Private fi As Object", "Integer").WithLocation(61, 13), 670Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fk").WithArguments("Private fk As Middle", "Derived").WithLocation(63, 13), 671Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fia").WithArguments("Private fia As Object", "IMiddle").WithLocation(72, 13), 672Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fic").WithArguments("Private fic As Object", "IBase1").WithLocation(73, 13), 673Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fid").WithArguments("Private fid As IBase1", "IDerived").WithLocation(74, 13), 674Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fie").WithArguments("Private fie As IBase1", "IMiddle").WithLocation(75, 13), 675Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fig").WithArguments("Private fig As Object", "IBase1").WithLocation(77, 13), 676Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fik").WithArguments("Private fik As IMiddle", "IDerived").WithLocation(79, 13), 677Diagnostic(SymbolCouldHaveMoreSpecificTypeAnalyzer.FieldCouldHaveMoreSpecificTypeDescriptor.Id, "fim").WithArguments("Private fim As IBase2", "IDerived").WithLocation(83, 13)) 726Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(2, 71), 727Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(6, 28), 728Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(10, 16), 729Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(19, 9), 730Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(27, 40), 731Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(28, 29), 732Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "17").WithLocation(33, 42), 733Diagnostic(SeventeenTestAnalyzer.SeventeenDescriptor.Id, "M0").WithLocation(12, 9)) ' The M0 diagnostic is an artifact of the VB compiler filling in default values in the high-level bound tree, and is questionable. 770Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(13, 12), 771Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(14, 18), 772Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(15, 12), 773Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(15, 21), 774Diagnostic(NullArgumentTestAnalyzer.NullArgumentsDescriptor.Id, "Nothing").WithLocation(20, 26)) 809comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedQualifiedNameInInit, "").WithLocation(20, 32)) 811Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(14, 35), 812Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(15, 33), 813Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(16, 33), 814Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(16, 46), 815Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop2").WithLocation(17, 33), 816Diagnostic(MemberInitializerTestAnalyzer.DoNotUseFieldInitializerDescriptor.Id, "Field").WithLocation(17, 58), 817Diagnostic(MemberInitializerTestAnalyzer.DoNotUsePropertyInitializerDescriptor.Id, "Prop1").WithLocation(19, 35)) 860Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop2 = New Bar() With {.Field = True}").WithLocation(21, 32), 861Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = 10").WithLocation(14, 34), 862Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop1 = Nothing").WithLocation(15, 32), 863Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = 10").WithLocation(16, 32), 864Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop1 = Nothing").WithLocation(16, 45), 865Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Prop2 = New Bar() With {.Field = True}").WithLocation(17, 32), 866Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = True").WithLocation(17, 57), 867Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, ".Field = True").WithLocation(21, 57), 868Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f1.Field = 0").WithLocation(22, 9), 869Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f1.Prop1 = Nothing").WithLocation(23, 9), 870Diagnostic(AssignmentTestAnalyzer.DoNotUseMemberAssignmentDescriptor.Id, "f2.Field = True").WithLocation(26, 9)) 911Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(11, 34), 912Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(12, 20), 913Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(13, 27), 914Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(15, 36), 915Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(16, 37), 916Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{7, 8, 9, 10, 11, 12}").WithLocation(17, 37), 917Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(18, 30), 918Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{Nothing, Nothing, Nothing, Nothing, Nothing, Nothing}").WithLocation(19, 29), 919Diagnostic(ArrayInitializerTestAnalyzer.DoNotUseLargeListOfArrayInitializersDescriptor.Id, "{1, 2, 3, 4, 5, 6}").WithLocation(24, 25)) 955Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(11, 21), 956Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(12, 35), 957Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(12, 35), 958Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(12, 35), 959Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(12, 35), 960Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(13, 31), 961Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(13, 31), 962Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(13, 31), 963Diagnostic(ERRID.ERR_UndefinedType1, "UndefType").WithArguments("UndefType").WithLocation(13, 31)) 965Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "a1").WithLocation(5, 13), 966Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim b1 As New Integer, b2, b3, b4 As New Goo(1)").WithLocation(6, 9), 967Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b1").WithLocation(6, 13), 968Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b2").WithLocation(6, 32), 969Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b3").WithLocation(6, 36), 970Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "b4").WithLocation(6, 40), 971Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim c1, c2 As Integer, c3, c4 As Goo").WithLocation(7, 9), 972Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim e1 As Integer = 10, e2 = {1, 2, 3}, e3, e4 As C").WithLocation(9, 9), 973Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e1").WithLocation(9, 13), 974Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "e2").WithLocation(9, 33), 975Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "f1").WithLocation(10, 13), 976Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "f2").WithLocation(10, 22), 977Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim h1, h2, , h3 As Integer").WithLocation(11, 9), 978Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim i1, i2, i3, i4 As New UndefType").WithLocation(12, 9), 979Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim j1, j2, j3, j4 As UndefType").WithLocation(13, 9), 980Diagnostic(VariableDeclarationTestAnalyzer.TooManyLocalVarDeclarationsDescriptor.Id, "Dim k1 As Integer, k2, k3, k4 As New Goo(1)").WithLocation(14, 9), 981Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k2").WithLocation(14, 28), 982Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k3").WithLocation(14, 32), 983Diagnostic(VariableDeclarationTestAnalyzer.LocalVarInitializedDeclarationDescriptor.Id, "k4").WithLocation(14, 36)) 1073comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(60, 17), 1074Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(68, 1), 1075Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(74, 22)) 1077Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1080Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(8, 13), 1081Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(17, 13), 1082Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(26, 13), 1083Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1086Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(33, 13), 1087Diagnostic(CaseTestAnalyzer.MultipleCaseClausesDescriptor.Id, 1090Diagnostic(CaseTestAnalyzer.HasDefaultCaseDescriptor.Id, "Case Else").WithLocation(50, 13)) 1122Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "Me").WithLocation(3, 9), 1123Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(4, 9), 1124Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ExplicitInstanceDescriptor.Id, "MyBase").WithLocation(13, 9), 1125Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M1").WithLocation(14, 9), 1126Diagnostic(ExplicitVsImplicitInstanceAnalyzer.ImplicitInstanceDescriptor.Id, "M2").WithLocation(15, 9)) 1162Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, New MumbleEventHandler(AddressOf Mumbler)").WithLocation(7, 9), ' Bug: we are missing diagnostics of "MethodBindingDescriptor" here. https://github.com/dotnet/roslyn/issues/20095 1163Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(7, 20), 1164Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(7, 51), 1165Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, New MumbleEventHandler(Sub(s As Object, a As System.EventArgs) 1167Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(8, 20), 1168Diagnostic(MemberReferenceAnalyzer.HandlerAddedDescriptor.Id, "AddHandler Mumble, Sub(s As Object, a As System.EventArgs) 1170Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(10, 20), 1171Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(12, 20), 1172Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(14, 39), 1173Diagnostic(MemberReferenceAnalyzer.HandlerRemovedDescriptor.Id, "RemoveHandler Mumble, AddressOf Mumbler").WithLocation(16, 9), 1174Diagnostic(MemberReferenceAnalyzer.EventReferenceDescriptor.Id, "Mumble").WithLocation(16, 23), 1175Diagnostic(MemberReferenceAnalyzer.MethodBindingDescriptor.Id, "AddressOf Mumbler").WithLocation(16, 31) 1215Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5)").WithLocation(9, 9), 1216Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6)").WithLocation(10, 9), 1217Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(12, 15), 1218Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5, 6 }").WithLocation(13, 15), 1219Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "D").WithLocation(14, 30), 1220Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(15, 26)) 1248Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 44").WithLocation(2, 26), 1249Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= ""Hello""").WithLocation(3, 25), 1250Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= Goo()").WithLocation(4, 26), 1251Diagnostic(EqualsValueTestAnalyzer.EqualsValueDescriptor.Id, "= 20").WithLocation(10, 84)) 1280Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "0").WithLocation(8, 28), 1281Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "x").WithLocation(9, 28), 1282Diagnostic(OwningSymbolTestAnalyzer.ExpressionDescriptor.Id, "12").WithLocation(12, 36)) 1326Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.Id, <![CDATA[Public Sub Barney 1329Diagnostic(NoneOperationTestAnalyzer.NoneOperationDescriptor.Id, "Resume").WithLocation(23, 9)) 1379Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub() 1381Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1383Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub() 1386Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1392Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "Sub(s As Object, a As EventArgs) 1398Diagnostic(LambdaTestAnalyzer.LambdaExpressionDescriptor.Id, "Function(value As Integer) 1404Diagnostic(LambdaTestAnalyzer.TooManyStatementsInLambdaExpressionDescriptor.Id, "Function(value As Integer) 1454Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddHandler C.E, AddressOf D.Method").WithLocation(19, 9), 1455Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddressOf D.Method").WithLocation(19, 25), 1456Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "E").WithLocation(20, 20), 1457Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "C.Bar()").WithLocation(21, 9), 1458Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "AddHandler D.E, Sub() 1460Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Field").WithLocation(25, 9), 1461Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.P").WithLocation(26, 17), 1462Diagnostic(StaticMemberTestAnalyzer.StaticMemberDescriptor.Id, "D.Method()").WithLocation(27, 9)) 1485Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Wilma:").WithLocation(3, 9), 1486Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "GoTo Betty").WithLocation(4, 9), 1487Diagnostic(LabelOperationsTestAnalyzer.LabelDescriptor.Id, "Betty:").WithLocation(5, 9), 1488Diagnostic(LabelOperationsTestAnalyzer.GotoDescriptor.Id, "GoTo Wilma").WithLocation(6, 9)) 1541Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.BooleanNotDescriptor.Id, "Not b").WithLocation(33, 13), 1542Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.DoubleMultiplyDescriptor.Id, "d * 100").WithLocation(34, 13), 1543Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorAddMethodDescriptor.Id, "a1 + a2").WithLocation(35, 14), 1544Diagnostic(UnaryAndBinaryOperationsTestAnalyzer.OperatorMinusMethodDescriptor.Id, "-a2").WithLocation(36, 14)) 1689Diagnostic("BinaryUserDefinedOperator", "x + y").WithArguments("Add").WithLocation(109, 13), 1690Diagnostic("BinaryUserDefinedOperator", "x - y").WithArguments("Subtract").WithLocation(110, 13), 1691Diagnostic("BinaryUserDefinedOperator", "x * y").WithArguments("Multiply").WithLocation(111, 13), 1692Diagnostic("BinaryUserDefinedOperator", "x / y").WithArguments("Divide").WithLocation(112, 13), 1693Diagnostic("BinaryUserDefinedOperator", "x \ y").WithArguments("IntegerDivide").WithLocation(113, 13), 1694Diagnostic("BinaryUserDefinedOperator", "x Mod y").WithArguments("Remainder").WithLocation(114, 13), 1695Diagnostic("BinaryUserDefinedOperator", "x ^ y").WithArguments("Power").WithLocation(115, 13), 1696Diagnostic("BinaryUserDefinedOperator", "x = y").WithArguments("Equals").WithLocation(116, 13), 1697Diagnostic("BinaryUserDefinedOperator", "x <> y").WithArguments("NotEquals").WithLocation(117, 13), 1698Diagnostic("BinaryUserDefinedOperator", "x < y").WithArguments("LessThan").WithLocation(118, 13), 1699Diagnostic("BinaryUserDefinedOperator", "x > y").WithArguments("GreaterThan").WithLocation(119, 13), 1700Diagnostic("BinaryUserDefinedOperator", "x <= y").WithArguments("LessThanOrEqual").WithLocation(120, 13), 1701Diagnostic("BinaryUserDefinedOperator", "x >= y").WithArguments("GreaterThanOrEqual").WithLocation(121, 13), 1702Diagnostic("BinaryUserDefinedOperator", "x Like y").WithArguments("Like").WithLocation(122, 13), 1703Diagnostic("BinaryUserDefinedOperator", "x & y").WithArguments("Concatenate").WithLocation(123, 13), 1704Diagnostic("BinaryUserDefinedOperator", "x And y").WithArguments("And").WithLocation(124, 13), 1705Diagnostic("BinaryUserDefinedOperator", "x Or y").WithArguments("Or").WithLocation(125, 13), 1706Diagnostic("BinaryUserDefinedOperator", "x Xor y").WithArguments("ExclusiveOr").WithLocation(126, 13), 1707Diagnostic("BinaryUserDefinedOperator", "x << 2").WithArguments("LeftShift").WithLocation(127, 13), 1708Diagnostic("BinaryUserDefinedOperator", "x >> 3").WithArguments("RightShift").WithLocation(128, 13)) 1748comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_DuplicateProcDef1, "-", New Object() {"Public Shared Operator -(x As B2) As B2"}).WithLocation(8, 28), 1749Diagnostic(ERRID.ERR_TypeMismatch2, "10", New Object() {"Integer", "B2"}).WithLocation(23, 17), 1750Diagnostic(ERRID.ERR_NoMostSpecificOverload2, "-x", New Object() {"-", Environment.NewLine & " 'Public Shared Operator -(x As B2) As B2': Not most specific." & vbCrLf & " 'Public Shared Operator -(x As B2) As B2': Not most specific."}).WithLocation(25, 13)) 1783Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0()").WithLocation(6, 9), 1784Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1)").WithLocation(7, 9), 1785Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1, 2)").WithLocation(8, 9)) 1809Diagnostic(ERRID.ERR_EndFunctionExpected, "Public Function M1(a As Double, b as C) as Double").WithLocation(2, 5), 1810Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub").WithLocation(4, 5), 1811Diagnostic(ERRID.ERR_InvInsideEndsProc, "Public Function M2(s As C) As C").WithLocation(6, 5), 1812Diagnostic(ERRID.ERR_ClassNotExpression1, "c").WithArguments("C").WithLocation(3, 20), 1813Diagnostic(ERRID.ERR_UnaryOperand2, "-s").WithArguments("-", "C").WithLocation(7, 16)) 1815Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidBinaryDescriptor.Id, "b + c").WithLocation(3, 16), 1816Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.Id, "-s").WithLocation(7, 16)) 1846Diagnostic(ParamsArrayTestAnalyzer.InvalidConstructorDescriptor.Id, "New C.S()").WithLocation(7, 11)) 1906Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Prop").WithLocation(24, 17), 1907Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(24, 17), 1908Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.Field").WithLocation(25, 13), 1909Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(25, 13), 1910Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?(0)").WithLocation(26, 13), 1911Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(26, 13), 1912Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "p?.M0(Nothing)").WithLocation(27, 9), 1913Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "p").WithLocation(27, 9), 1914Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Prop").WithLocation(29, 13), 1915Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(29, 13), 1916Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.Field").WithLocation(30, 13), 1917Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(30, 13), 1918Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?(0)").WithLocation(31, 13), 1919Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(31, 13), 1920Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessOperationDescriptor.Id, "Field1?.M0(Nothing)").WithLocation(32, 9), 1921Diagnostic(ConditionalAccessOperationTestAnalyzer.ConditionalAccessInstanceOperationDescriptor.Id, "Field1").WithLocation(32, 9)) 1980Diagnostic(ERRID.ERR_LoopControlMustNotBeProperty, "Moo").WithLocation(38, 13), 1981Diagnostic(ERRID.ERR_LoopControlMustNotBeProperty, "Boo").WithLocation(41, 13), 1982Diagnostic(ERRID.ERR_NoGetProperty1, "Boo").WithArguments("Boo").WithLocation(41, 24), 1983Diagnostic(ERRID.ERR_NoGetProperty1, "Boo").WithArguments("Boo").WithLocation(41, 33), 1984Diagnostic(ERRID.ERR_UnacceptableForLoopOperator2, "For i As C1(Of Integer) = 1 To 10").WithArguments("Public Shared Operator -(p1 As M1.C1(Of Integer), p2 As M1.C1(Of Integer)) As M1.C1(Of Short)", "M1.C1(Of Integer)").WithLocation(19, 9), 1985Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i As C1(Of Integer) = 1 To 10").WithArguments("M1.C1(Of Integer)", "<=").WithLocation(19, 9), 1986Diagnostic(ERRID.ERR_ForLoopOperatorRequired2, "For i As C1(Of Integer) = 1 To 10").WithArguments("M1.C1(Of Integer)", ">=").WithLocation(19, 9), 1987Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System").WithLocation(1, 1)) 1989Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.Id, "Boo").WithLocation(41, 24), 1990Diagnostic(ForLoopConditionCrashVBTestAnalyzer.ForLoopConditionCrashDescriptor.Id, "10").WithLocation(19, 40)) 2044Diagnostic(ERRID.ERR_ExpectedComma, "").WithLocation(6, 39), 2045Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(6, 39), 2046Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(24, 38), 2047Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(25, 62), 2048Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(26, 34), 2049Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(27, 32), 2050Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(28, 32), 2051Diagnostic(ERRID.ERR_ExpectedExpression, "").WithLocation(37, 14), 2052Diagnostic(ERRID.ERR_TooFewGenericArguments1, "IEnumerator").WithArguments("System.Collections.Generic.IEnumerator(Of Out T)").WithLocation(31, 31), 2053Diagnostic(ERRID.ERR_TooFewGenericArguments1, "IEnumerator").WithArguments("System.Collections.Generic.IEnumerator(Of Out T)").WithLocation(33, 31), 2054Diagnostic(ERRID.ERR_TooFewGenericArguments1, "IEnumerator").WithArguments("System.Collections.Generic.IEnumerator(Of Out T)").WithLocation(36, 30), 2055Diagnostic(ERRID.ERR_AddOrRemoveHandlerEvent, "receiver?.TestEvent").WithLocation(15, 20), 2056Diagnostic(ERRID.ERR_AddOrRemoveHandlerEvent, "Function(ByVal x) x").WithLocation(6, 20), 2057Diagnostic(ERRID.ERR_BadIteratorReturn, "sub").WithLocation(24, 27), 2058Diagnostic(ERRID.ERR_BadIteratorReturn, "sub").WithLocation(25, 27), 2059Diagnostic(ERRID.ERR_BadIteratorReturn, "sub").WithLocation(25, 51), 2060Diagnostic(ERRID.ERR_BadIteratorReturn, "sub").WithLocation(27, 21), 2061Diagnostic(ERRID.ERR_BadIteratorReturn, "Sub").WithLocation(28, 21), 2062Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports System.Collections.Generic").WithLocation(2, 1)) 2064Diagnostic("HandlerAdded", "AddHandler Function(ByVal x) x").WithLocation(6, 9), 2065Diagnostic("InvalidEvent", "AddHandler Function(ByVal x) x").WithLocation(6, 9), 2066Diagnostic("HandlerAdded", "AddHandler receiver?.TestEvent, AddressOf Main").WithLocation(15, 9), 2067Diagnostic("InvalidEvent", "AddHandler receiver?.TestEvent, AddressOf Main").WithLocation(15, 9), 2068Diagnostic("HandlerAdded", "AddHandler, New Object").WithLocation(26, 24), 2069Diagnostic("InvalidEvent", "AddHandler, New Object").WithLocation(26, 24), 2070Diagnostic("EventReference", ".TestEvent").WithLocation(15, 29)) 2123Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x").WithLocation(27, 12), 2124Diagnostic(TrueFalseUnaryOperationTestAnalyzer.UnaryTrueDescriptor.Id, "x AndAlso y").WithLocation(33, 12)) 2149Diagnostic("ID", "M").WithArguments("M", "Block").WithLocation(2, 16), 2150Diagnostic("ID", "M2").WithArguments("M2", "Block").WithLocation(5, 16), 2151Diagnostic("ID", "M3").WithArguments("M3", "ParameterInitializer").WithLocation(8, 16), 2152Diagnostic("ID", "M3").WithArguments("M3", "Block").WithLocation(8, 16))
FlowAnalysis\FlowTestBase.vb (1)
23Friend Function FlowDiagnostics(compilation As VisualBasicCompilation) As ImmutableArray(Of Diagnostic)
Semantics\ArrayLiteralTests.vb (60)
97Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 98Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{{}}"), 99Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}") 167Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 168Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 169Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 170Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 171Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 172Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 173Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 174Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{""a"", New c}"), 175Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}"), 176Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{}") 341Diagnostic(ERRID.ERR_TypeMismatch2, "{1}").WithArguments("Integer()", "Module1.C"), 342Diagnostic(ERRID.ERR_TypeMismatch2, "{1}").WithArguments("Integer()", "Module1.C")) 346Diagnostic(ERRID.ERR_TypeMismatch2, "{1}").WithArguments("Integer()", "Module1.C"), 347Diagnostic(ERRID.ERR_TypeMismatch2, "{1}").WithArguments("Integer()", "Module1.C")) 463comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, """1""").WithArguments("String", "Integer")) 511Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "{1S}").WithArguments("Integer()", "Module1.C"), 512Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "{1}").WithArguments("Integer()", "Module1.C"), 513Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "{1L}").WithArguments("Integer()", "Module1.C"), 514Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "1D").WithArguments("Decimal", "Integer"), 515Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "1.0R").WithArguments("Double", "Integer")) 543Diagnostic(ERRID.ERR_RestrictedType1, "= {a}").WithArguments("System.ArgIterator"), 544Diagnostic(ERRID.ERR_RestrictedType1, "{a}").WithArguments("System.ArgIterator")) 548Diagnostic(ERRID.ERR_RestrictedType1, "= {a}").WithArguments("System.ArgIterator"), 549Diagnostic(ERRID.ERR_RestrictedType1, "{a}").WithArguments("System.ArgIterator"), 550Diagnostic(ERRID.ERR_ArrayInitTooManyTypesObjectDisallowed, "{1, 1D, ""a""}"), 551Diagnostic(ERRID.ERR_ArrayInitNoTypeObjectDisallowed, "{""a"", New c}")) 555Diagnostic(ERRID.ERR_RestrictedType1, "= {a}").WithArguments("System.ArgIterator"), 556Diagnostic(ERRID.ERR_RestrictedType1, "{a}").WithArguments("System.ArgIterator"), 557Diagnostic(ERRID.WRN_ObjectAssumed1, "{1, 1D, ""a""}").WithArguments("Cannot infer an element type because more than one type is possible; 'Object' assumed."), 558Diagnostic(ERRID.WRN_ObjectAssumed1, "{""a"", New c}").WithArguments("Cannot infer an element type; 'Object' assumed.")) 664Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "1D").WithArguments("Decimal", "Integer") 688Diagnostic(ERRID.ERR_ArrayInitNoType, "{Addressof Main}"), 689Diagnostic(ERRID.ERR_AddressOfNotDelegate1, "Addressof Main").WithArguments("Object"), 690Diagnostic(ERRID.ERR_UndefinedType1, "Action").WithArguments("Action") 695Diagnostic(ERRID.ERR_ArrayInitNoType, "{Addressof Main}"), 696Diagnostic(ERRID.ERR_AddressOfNotDelegate1, "Addressof Main").WithArguments("Object"), 697Diagnostic(ERRID.ERR_UndefinedType1, "Action").WithArguments("Action") 722Diagnostic(ERRID.ERR_ArrayInitNoType, "{Addressof Main}"), 723Diagnostic(ERRID.ERR_AddressOfNotDelegate1, "Addressof Main").WithArguments("Object") 728Diagnostic(ERRID.ERR_ArrayInitNoType, "{Addressof Main}"), 729Diagnostic(ERRID.ERR_AddressOfNotDelegate1, "Addressof Main").WithArguments("Object") 773Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "{1, 2, 3, 4, 5}").WithArguments("Integer()", "Module1.C") 891Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Test2").WithArguments("Test2", Environment.NewLine & 899Diagnostic(ERRID.ERR_NoCallableOverloadCandidates2, "Test2").WithArguments("Test2", Environment.NewLine & 923comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, """a""c").WithArguments("Short")) 927Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "1000.0").WithArguments("Double", "Short"), 928Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, """a""c").WithArguments("Short"), 929Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, """a""").WithArguments("String", "Short")) 967Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "{10S, 10, 10L}").WithArguments("Short()", "Module1.C") 1066Diagnostic(ERRID.ERR_NoNonNarrowingOverloadCandidates2, "Test2").WithArguments("Test2", Environment.NewLine & 1072Diagnostic(ERRID.ERR_NoCallableOverloadCandidates2, "Test2").WithArguments("Test2", Environment.NewLine & 1468Diagnostic(ERRID.WRN_TypeInferenceAssumed3, "{1, ""two"", GetType(String), 3.1415926}").WithArguments("T", "Friend Sub VerifyValue(Of T)(i As Integer, kind As Module1.TypedConstantKind, v As T)", "Object()"), 1469Diagnostic(ERRID.WRN_TypeInferenceAssumed3, "{}").WithArguments("T", "Friend Sub VerifyValue(Of T)(i As Integer, kind As Module1.TypedConstantKind, v As T)", "Object()")) 1565compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ArrayInitNoType, "{AddressOf Goo}")) 1568compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ArrayInitNoType, "{AddressOf Goo}")) 1820comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "({1})").WithArguments("Integer()", "Integer?()", "Integer", "Integer?")) 1823comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "({1})").WithArguments("Integer()", "Integer?()", "Integer", "Integer?"))
Semantics\BinaryOperators.vb (1)
802VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpressionOverflow1, "Integer.MaxValue + 1").WithArguments("Integer"))
Semantics\Conversions.vb (271)
2781Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2782Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2783Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2784Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2785Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2786Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2787Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2788Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2789Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2790Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2791Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2792Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2793Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2794Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2795Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2796Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2797Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2798Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2799Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2800Diagnostic(ERRID.ERR_NarrowingConversionCollection2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2801Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2802Diagnostic(ERRID.ERR_NarrowingConversionCollection2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2803Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2804Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2805Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2806Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2807Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2808Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2809Diagnostic(ERRID.ERR_NarrowingConversionDisallowed2, "10.0F").WithArguments("Single", "Decimal"), 2810Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2811Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2812Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2813Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2814Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2815Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2816Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2817Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2818Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2819Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2820Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2821Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2822Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2823Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2824Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2825Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2826Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC2Array").WithArguments("TestClass2()", "TestClass1()", "TestClass2", "TestClass1"), 2827Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 2828Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray2").WithArguments("Integer(*,*)", "Integer()"), 2829Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 2830Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TI1Array").WithArguments("TestInterface1()", "Integer()", "TestInterface1", "Integer"), 2831Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1")) 2835Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2836Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2837Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2838Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2839Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2840Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2841Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2842Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2843Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2844Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2845Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2846Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2847Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2848Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2849Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2850Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2851Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2852Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2853Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2854Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2855Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2856Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2857Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2858Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2859Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2860Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2861Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2862Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2863Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2864Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2865Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2866Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2867Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2868Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2869Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2870Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2871Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2872Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2873Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2874Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2875Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2876Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2877Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC2Array").WithArguments("TestClass2()", "TestClass1()", "TestClass2", "TestClass1"), 2878Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 2879Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray2").WithArguments("Integer(*,*)", "Integer()"), 2880Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 2881Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TI1Array").WithArguments("TestInterface1()", "Integer()", "TestInterface1", "Integer"), 2882Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1")) 2886Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2887Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 2888Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2889Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2890Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 2891Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 2892Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2893Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2894Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2895Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2896Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2897Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2898Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2899Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2900Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2901Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 2902Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 2903Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 2904Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2905Diagnostic(ERRID.WRN_ImplicitConversionSubst1, "_collection").WithArguments("Implicit conversion from '_Collection' to 'Collection'."), 2906Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2907Diagnostic(ERRID.WRN_ImplicitConversionSubst1, "collection").WithArguments("Implicit conversion from 'Collection' to '_Collection'."), 2908Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 2909Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 2910Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2911Diagnostic(ERRID.ERR_ExpressionOverflow1, "Int64.MaxValue").WithArguments("Integer"), 2912Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2913Diagnostic(ERRID.ERR_ExpressionOverflow1, "System.Double.MaxValue").WithArguments("Decimal"), 2914Diagnostic(ERRID.WRN_ImplicitConversionSubst1, "10.0F").WithArguments("Implicit conversion from 'Single' to 'Decimal'."), 2915Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2916Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 2917Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2918Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 2919Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2920Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 2921Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2922Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 2923Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2924Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 2925Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2926Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 2927Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2928Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 2929Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2930Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 2931Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC2Array").WithArguments("TestClass2()", "TestClass1()", "TestClass2", "TestClass1"), 2932Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 2933Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray2").WithArguments("Integer(*,*)", "Integer()"), 2934Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 2935Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TI1Array").WithArguments("TestInterface1()", "Integer()", "TestInterface1", "Integer"), 2936Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1")) 3052Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 3053Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3054Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3055Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3056Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3057Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3058Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3059Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3060Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3061Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3062Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3063Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 3064Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 3065Diagnostic(ERRID.ERR_TypeMismatch2, "Int64.MaxValue").WithArguments("Long", "Integer"), 3066Diagnostic(ERRID.ERR_TypeMismatch2, "System.Double.MaxValue").WithArguments("Double", "Decimal"), 3067Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 3068Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 3069Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 3070Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 3071Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 3072Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 3073Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 3074Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 3075Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 3076Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 3077Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1"), 3078Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char"), 3079Diagnostic(ERRID.ERR_TypeMismatch2, "Ch").WithArguments("Char", "String"), 3080Diagnostic(ERRID.ERR_TypeMismatch2, "ChArray").WithArguments("Char()", "String"), 3081Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char()"), 3082Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "[In]"), 3083Diagnostic(ERRID.ERR_IdentityDirectCastForFloat, "Si"), 3084Diagnostic(ERRID.ERR_IdentityDirectCastForFloat, "[Do]"), 3085Diagnostic(ERRID.ERR_TypeMismatch2, "Si").WithArguments("Single", "Double")) 3089Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 3090Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3091Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3092Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3093Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3094Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3095Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3096Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3097Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3098Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3099Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3100Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 3101Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 3102Diagnostic(ERRID.ERR_TypeMismatch2, "Int64.MaxValue").WithArguments("Long", "Integer"), 3103Diagnostic(ERRID.ERR_TypeMismatch2, "System.Double.MaxValue").WithArguments("Double", "Decimal"), 3104Diagnostic(ERRID.ERR_TypeMismatch2, "Da").WithArguments("Date", "Integer"), 3105Diagnostic(ERRID.ERR_TypeMismatch2, "[In]").WithArguments("Integer", "Date"), 3106Diagnostic(ERRID.ERR_DateToDoubleConversion, "Da"), 3107Diagnostic(ERRID.ERR_DoubleToDateConversion, "[Do]"), 3108Diagnostic(ERRID.ERR_CharToIntegralTypeMismatch1, "Ch").WithArguments("Integer"), 3109Diagnostic(ERRID.ERR_IntegralToCharTypeMismatch1, "[In]").WithArguments("Integer"), 3110Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 3111Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 3112Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 3113Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 3114Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1"), 3115Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char"), 3116Diagnostic(ERRID.ERR_TypeMismatch2, "Ch").WithArguments("Char", "String"), 3117Diagnostic(ERRID.ERR_TypeMismatch2, "ChArray").WithArguments("Char()", "String"), 3118Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char()"), 3119Diagnostic(ERRID.WRN_ObsoleteIdentityDirectCastForValueType, "[In]"), 3120Diagnostic(ERRID.ERR_IdentityDirectCastForFloat, "Si"), 3121Diagnostic(ERRID.ERR_IdentityDirectCastForFloat, "[Do]"), 3122Diagnostic(ERRID.ERR_TypeMismatch2, "Si").WithArguments("Single", "Double")) 3229Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 3230Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3231Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3232Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3233Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3234Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3235Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3236Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3237Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3238Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3239Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3240Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 3241Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 3242Diagnostic(ERRID.ERR_TryCastOfValueType1, "Int32").WithArguments("Integer"), 3243Diagnostic(ERRID.ERR_TryCastOfValueType1, "System.Decimal").WithArguments("Decimal"), 3244Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 3245Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 3246Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 3247Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 3248Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1"), 3249Diagnostic(ERRID.ERR_TryCastOfValueType1, "System.Char").WithArguments("Char"), 3250Diagnostic(ERRID.ERR_TypeMismatch2, "Ch").WithArguments("Char", "String"), 3251Diagnostic(ERRID.ERR_TypeMismatch2, "ChArray").WithArguments("Char()", "String"), 3252Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char()"), 3253Diagnostic(ERRID.ERR_TryCastOfUnconstrainedTypeParam1, "T").WithArguments("T")) 3257Diagnostic(ERRID.ERR_VoidValue, "Console.WriteLine()"), 3258Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3259Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3260Diagnostic(ERRID.ERR_NameNotDeclared1, "unknownValue").WithArguments("unknownValue"), 3261Diagnostic(ERRID.ERR_UndefinedType1, "UnknownType").WithArguments("UnknownType"), 3262Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3263Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3264Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3265Diagnostic(ERRID.ERR_RestrictedConversion1, "tr").WithArguments("System.TypedReference"), 3266Diagnostic(ERRID.ERR_RestrictedConversion1, "ai").WithArguments("System.ArgIterator"), 3267Diagnostic(ERRID.ERR_RestrictedConversion1, "ra").WithArguments("System.RuntimeArgumentHandle"), 3268Diagnostic(ERRID.WRN_InterfaceConversion2, "_collection").WithArguments("_Collection", "Microsoft.VisualBasic.Collection"), 3269Diagnostic(ERRID.WRN_InterfaceConversion2, "collection").WithArguments("Microsoft.VisualBasic.Collection", "_Collection"), 3270Diagnostic(ERRID.ERR_TryCastOfValueType1, "Int32").WithArguments("Integer"), 3271Diagnostic(ERRID.ERR_TryCastOfValueType1, "System.Decimal").WithArguments("Decimal"), 3272Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "Object()", "Integer"), 3273Diagnostic(ERRID.ERR_ConvertObjectArrayMismatch3, "InArray").WithArguments("Integer()", "System.ValueType()", "Integer"), 3274Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "TC1Array").WithArguments("TestClass1()", "TestClass2()", "TestClass1", "TestClass2"), 3275Diagnostic(ERRID.ERR_ConvertArrayRankMismatch2, "InArray").WithArguments("Integer()", "Integer(*,*)"), 3276Diagnostic(ERRID.ERR_ConvertArrayMismatch4, "InArray").WithArguments("Integer()", "TestInterface1()", "Integer", "TestInterface1"), 3277Diagnostic(ERRID.ERR_TryCastOfValueType1, "System.Char").WithArguments("Char"), 3278Diagnostic(ERRID.ERR_TypeMismatch2, "Ch").WithArguments("Char", "String"), 3279Diagnostic(ERRID.ERR_TypeMismatch2, "ChArray").WithArguments("Char()", "String"), 3280Diagnostic(ERRID.ERR_TypeMismatch2, "St").WithArguments("String", "Char()"), 3281Diagnostic(ERRID.ERR_TryCastOfUnconstrainedTypeParam1, "T").WithArguments("T")) 4225VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpressionOverflow1, "Z1").WithArguments("Byte"), 4226Diagnostic(ERRID.ERR_ExpressionOverflow1, "300").WithArguments("Byte"), 4227Diagnostic(ERRID.ERR_TypeMismatch2, "300").WithArguments("Integer", "Byte"))
Semantics\FieldInitializerBindingTests.vb (3)
652compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstExpr, "AscW(y)"), 653Diagnostic(ERRID.ERR_RequiredConstExpr, "ChrW(z)"), 654Diagnostic(ERRID.ERR_RequiredConstExpr, "z"))
Semantics\ForLoopTest.vb (1)
547vbCompilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_NoSuitableWidestType1, "i").WithArguments("i"))
Semantics\GetSemanticInfoTests.vb (7)
4202</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_LoopControlMustNotBeProperty, "prop1")) 4417Diagnostic(ERRID.ERR_ExpressionOverflow1, "Integer.MaxValue + 1").WithArguments("Integer")) 4460Diagnostic(ERRID.ERR_InvalidConstructorCall, "class1.New")) 5088Diagnostic(ERRID.ERR_InaccessibleSymbol2, "Nested").WithArguments("A.Nested", "Private")) 5131Diagnostic(ERRID.ERR_InaccessibleSymbol2, "Nested").WithArguments("A.Nested", "Private")) 5175Diagnostic(ERRID.ERR_InaccessibleSymbol2, "Nested").WithArguments("A.Nested", "Private")) 5220Diagnostic(ERRID.ERR_InaccessibleSymbol2, "A.B").WithArguments("A.B", "Private"))
Semantics\IsIsNot.vb (30)
429Diagnostic(ERRID.ERR_VoidValue, "WriteLine()"), 430Diagnostic(ERRID.ERR_NameNotDeclared1, "doesntexist").WithArguments("doesntexist"), 431Diagnostic(ERRID.ERR_NameNotDeclared1, "doesntexist").WithArguments("doesntexist"), 432Diagnostic(ERRID.ERR_VoidValue, "WriteLine()"), 433Diagnostic(ERRID.ERR_IsOperatorNullable1, "n").WithArguments("Integer?"), 434Diagnostic(ERRID.ERR_IsNotOperatorNullable1, "n").WithArguments("Integer?"), 435Diagnostic(ERRID.ERR_IsOperatorNullable1, "n").WithArguments("Integer?"), 436Diagnostic(ERRID.ERR_IsNotOperatorNullable1, "n").WithArguments("Integer?"), 437Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "De").WithArguments("Decimal"), 438Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "De").WithArguments("Decimal"), 439Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "De").WithArguments("Decimal"), 440Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "De").WithArguments("Decimal"), 441Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "De").WithArguments("Decimal"), 442Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "De").WithArguments("Decimal"), 443Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "De").WithArguments("Decimal"), 444Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "De").WithArguments("Decimal"), 445Diagnostic(ERRID.ERR_IsOperatorGenericParam1, "x").WithArguments("T"), 446Diagnostic(ERRID.ERR_IsOperatorGenericParam1, "y").WithArguments("T"), 447Diagnostic(ERRID.ERR_IsNotOperatorGenericParam1, "x").WithArguments("T"), 448Diagnostic(ERRID.ERR_IsNotOperatorGenericParam1, "y").WithArguments("T"), 449Diagnostic(ERRID.ERR_IsOperatorGenericParam1, "y").WithArguments("T"), 450Diagnostic(ERRID.ERR_IsNotOperatorGenericParam1, "y").WithArguments("T"), 451Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "x").WithArguments("T"), 452Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "x").WithArguments("T"), 453Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "x").WithArguments("T"), 454Diagnostic(ERRID.ERR_IsOperatorRequiresReferenceTypes1, "y").WithArguments("T"), 455Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "x").WithArguments("T"), 456Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "x").WithArguments("T"), 457Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "x").WithArguments("T"), 458Diagnostic(ERRID.ERR_IsNotOpRequiresReferenceTypes1, "y").WithArguments("T"))
Semantics\LambdaTests.vb (1)
1728CompilationUtils.CreateCompilationWithMscorlib40AndVBRuntime(source).VerifyDiagnostics(Diagnostic(ERRID.ERR_SubDisallowsStatement, "Dim y = 2"))
Semantics\MethodCalls.vb (8)
2811VerifyDiagnostics(Diagnostic(ERRID.WRN_ImplicitConversionCopyBack, "By").WithArguments("a", "Integer", "Byte")) 2849Diagnostic(ERRID.ERR_TypecharNoMatch2, "Goo$()").WithArguments("$", "Void"), 2850Diagnostic(ERRID.ERR_TypecharNoMatch2, "Goo$").WithArguments("$", "Void"), 2851Diagnostic(ERRID.ERR_TypecharNoMatch2, "M.Goo$()").WithArguments("$", "Void"), 2852Diagnostic(ERRID.ERR_TypecharNoMatch2, "M.Goo$").WithArguments("$", "Void"), 2853Diagnostic(ERRID.ERR_TypecharNoMatch2, "Bar%(Of Integer)()").WithArguments("%", "Void"), 2854Diagnostic(ERRID.ERR_TypecharNoMatch2, "Bar$(Of Integer)").WithArguments("$", "Void"), 2855Diagnostic(ERRID.ERR_TypecharNoMatch2, "Goo1$").WithArguments("$", "Integer"))
Semantics\MultiDimensionalTest.vb (2)
293Diagnostic(ERRID.ERR_ExpectedExpression, ""), 294Diagnostic(ERRID.ERR_InitWithExplicitArraySizes, "b5(8, )"))
Semantics\OptionalArgumentTests.vb (22)
69comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_DateToDoubleConversion, "#1/1/2001#")) 140comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_OverrideWithDefault2, "s1").WithArguments("Public Overrides Sub s1([i As Integer = 2])", "Public MustOverride Sub s1([i As Integer = 0])")) 166comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_TypeMismatch2, "1").WithArguments("Integer", "System.Guid")) 244comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstConversion2, """12""").WithArguments("String", "Integer")) 270comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_OptionalIllegal1, "Optional").WithArguments("Event"), 271Diagnostic(ERRID.ERR_OmittedArgument2, "RaiseEvent E()").WithArguments("I", "Public Event E(I As Integer)")) 290Diagnostic(ERRID.ERR_ExpectedOptional, "Z")) 309Diagnostic(ERRID.ERR_ParamArrayWithOptArgs, "Y")) 328Diagnostic(ERRID.ERR_ParamArrayMustBeLast, "Optional z As Integer = 1")) 347Diagnostic(ERRID.ERR_RequiredConstExpr, "String.Empty")) 463Diagnostic(ERRID.ERR_CircularEvaluation1, "Goo()").WithArguments("[a As Module1.C]") 491Diagnostic(ERRID.ERR_CircularEvaluation1, "Bar()").WithArguments("[f As Module1.C]"), 492Diagnostic(ERRID.ERR_RequiredConstExpr, "Goo()") 521Diagnostic(ERRID.ERR_UseOfKeywordNotInInstanceMethod1, "Me").WithArguments("Me"), 522Diagnostic(ERRID.ERR_UseOfKeywordNotInInstanceMethod1, "Me").WithArguments("Me") 696comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_OmittedArgument2, "M2").WithArguments("x", "Public Shared Sub M2(x As Object)"), 697Diagnostic(ERRID.ERR_OmittedArgument2, "M4").WithArguments("x", "Public Shared Sub M4(x As Object)"), 698Diagnostic(ERRID.ERR_OmittedArgument2, "M6").WithArguments("x", "Public Shared Sub M6(x As Object)"), 699Diagnostic(ERRID.ERR_OmittedArgument2, "M8").WithArguments("x", "Public Shared Sub M8(x As Object)")) 939comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_OmittedArgument2, "Goo1").WithArguments("x", "Public Shared Sub Goo1(x As Object)"), 940Diagnostic(ERRID.ERR_OmittedArgument2, "Goo2").WithArguments("x", "Public Shared Sub Goo2(x As String)"), 941Diagnostic(ERRID.ERR_OmittedArgument2, "Goo3").WithArguments("x", "Public Shared Sub Goo3(x As Integer)"))
Semantics\PartialMethodsTest.vb (2)
622comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1")) 940comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InterfaceNotImplemented1, "A").WithArguments("A"))
Semantics\QueryExpressions_SemanticModel.vb (1)
3812compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_QueryOperatorNotFound, "aggr4").WithArguments("aggr4"))
Semantics\ScriptSemanticsTests.vb (1)
126Diagnostic(ERRID.ERR_InvalidSwitchValue).WithArguments("ScriptClassName", "a" + ChrW(0) + "b").WithLocation(1, 1)
Semantics\UnaryOperators.vb (2)
583VerifyDiagnostics(compilation, Diagnostic(ERRID.ERR_ExpressionOverflow1, "+2147483648").WithArguments("Integer"), 584Diagnostic(ERRID.ERR_ExpressionOverflow1, "(-(-2147483648))").WithArguments("Integer"))
Semantics\UseSiteErrorTests.vb (72)
88Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 89Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 90Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "ReturnType1").WithArguments("Public Overrides Function ReturnType1() As UnavailableClass", "Public Overridable Overloads Function ReturnType1() As UnavailableClass"), 91Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "ReturnType2").WithArguments("Public Overrides Function ReturnType2() As UnavailableClass()", "Public Overridable Overloads Function ReturnType2() As UnavailableClass()")) 114Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ReturnType1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 115Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ReturnType2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass")) 137Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 138Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 139Diagnostic(ERRID.ERR_OverrideNotNeeded3, "ParameterType1").WithArguments("sub", "ParameterType1"), 140Diagnostic(ERRID.ERR_OverrideNotNeeded3, "ParameterType2").WithArguments("sub", "ParameterType2")) 161Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ParameterType1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 162Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ParameterType2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass")) 190Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 191Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 192Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 193Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 194Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceMethods.ReturnType1").WithArguments("ReturnType1", "ReturnType1", "function", "InterfaceMethods"), 195Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceMethods.ReturnType2").WithArguments("ReturnType2", "ReturnType2", "function", "InterfaceMethods"), 196Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceMethods.ParameterType1").WithArguments("ParameterType1", "ParameterType1", "sub", "InterfaceMethods"), 197Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceMethods.ParameterType2").WithArguments("ParameterType2", "ParameterType2", "sub", "InterfaceMethods"), 198Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceMethods").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 199Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceMethods").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 200Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceMethods").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 201Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceMethods").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass")) 228Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ReturnType1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 229Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ReturnType2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 230Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ParameterType1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 231Diagnostic(ERRID.ERR_UnreferencedAssembly3, "ParameterType2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass")) 284Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 285Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 286Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 287Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 288Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 289Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 290Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 291Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 292Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 293Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 294Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "Get1").WithArguments("Public Overrides ReadOnly Property Get1 As UnavailableClass", "Public Overridable Overloads ReadOnly Property Get1 As UnavailableClass"), 295Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "Get2").WithArguments("Public Overrides ReadOnly Property Get2 As UnavailableClass()", "Public Overridable Overloads ReadOnly Property Get2 As UnavailableClass()"), 296Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "Set1").WithArguments("Public Overrides WriteOnly Property Set1 As UnavailableClass", "Public Overridable Overloads WriteOnly Property Set1 As UnavailableClass"), 297Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "Set2").WithArguments("Public Overrides WriteOnly Property Set2 As UnavailableClass()", "Public Overridable Overloads WriteOnly Property Set2 As UnavailableClass()"), 298Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "GetSet1").WithArguments("Public Overrides Property GetSet1 As UnavailableClass", "Public Overridable Overloads Property GetSet1 As UnavailableClass"), 299Diagnostic(ERRID.ERR_InvalidOverrideDueToReturn2, "GetSet2").WithArguments("Public Overrides Property GetSet2 As UnavailableClass()", "Public Overridable Overloads Property GetSet2 As UnavailableClass()")) 350Diagnostic(ERRID.ERR_UnreferencedAssembly3, "Get1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 351Diagnostic(ERRID.ERR_UnreferencedAssembly3, "Get2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 352Diagnostic(ERRID.ERR_UnreferencedAssembly3, "Set1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 353Diagnostic(ERRID.ERR_UnreferencedAssembly3, "Set2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 354Diagnostic(ERRID.ERR_UnreferencedAssembly3, "GetSet1").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 355Diagnostic(ERRID.ERR_UnreferencedAssembly3, "GetSet2").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass")) 408Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 409Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 410Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 411Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 412Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 413Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 414Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 415Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 416Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 417Diagnostic(ERRID.ERR_UndefinedType1, "UnavailableClass").WithArguments("UnavailableClass"), 418Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.Get1").WithArguments("Get1", "Get1", "property", "InterfaceProperties"), 419Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.Get2").WithArguments("Get2", "Get2", "property", "InterfaceProperties"), 420Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.Set1").WithArguments("Set1", "Set1", "property", "InterfaceProperties"), 421Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.Set2").WithArguments("Set2", "Set2", "property", "InterfaceProperties"), 422Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.GetSet1").WithArguments("GetSet1", "GetSet1", "property", "InterfaceProperties"), 423Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "CSharpErrors.InterfaceProperties.GetSet2").WithArguments("GetSet2", "GetSet2", "property", "InterfaceProperties"), 424Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 425Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 426Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 427Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 428Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"), 429Diagnostic(ERRID.ERR_UnreferencedAssembly3, "CSharpErrors.InterfaceProperties").WithArguments("Unavailable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "UnavailableClass"))
Semantics\VariableTypeInference.vb (22)
485compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "a"), 486Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "b")) 506Diagnostic(ERRID.WRN_ObjectAssumedVar1, "a").WithArguments("Variable declaration without an 'As' clause; type of Object assumed."), 507Diagnostic(ERRID.WRN_ObjectAssumedVar1, "b").WithArguments("Variable declaration without an 'As' clause; type of Object assumed.")) 534compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "b")) 550compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "a"), 551Diagnostic(ERRID.ERR_StrictDisallowImplicitObject, "b")) 563compilation.VerifyDiagnostics(Diagnostic(ERRID.WRN_ObjectAssumedVar1, "b").WithArguments("Static variable declared without an 'As' clause; type of Object assumed.")) 572Diagnostic(ERRID.WRN_ObjectAssumedVar1, "a").WithArguments("Variable declaration without an 'As' clause; type of Object assumed."), 573Diagnostic(ERRID.WRN_ObjectAssumedVar1, "b").WithArguments("Static variable declared without an 'As' clause; type of Object assumed.")) 607Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "y").WithArguments("y"), 608Diagnostic(ERRID.ERR_CircularInference1, "x").WithArguments("x"), 609Diagnostic(ERRID.WRN_DefAsgUseNullRef, "x").WithArguments("x")) 634Diagnostic(ERRID.WRN_UnusedLocalConst, "bar1").WithArguments("bar1"), 635Diagnostic(ERRID.WRN_UnusedLocalConst, "bar2").WithArguments("bar2"), 636Diagnostic(ERRID.WRN_UnusedLocalConst, "bar3").WithArguments("bar3") 664Diagnostic(ERRID.ERR_ConstantWithNoValue, "bar6"), 665Diagnostic(ERRID.WRN_UnusedLocalConst, "bar1").WithArguments("bar1"), 666Diagnostic(ERRID.WRN_UnusedLocalConst, "bar2").WithArguments("bar2"), 667Diagnostic(ERRID.WRN_UnusedLocalConst, "bar3").WithArguments("bar3"), 668Diagnostic(ERRID.WRN_UnusedLocalConst, "bar4").WithArguments("bar4"), 669Diagnostic(ERRID.WRN_UnusedLocalConst, "bar5").WithArguments("bar5"))
Semantics\WithBlockErrorTests.vb (19)
31Diagnostic(ERRID.ERR_NameNotDeclared1, "o1").WithArguments("o1"), 32Diagnostic(ERRID.ERR_UseOfLocalBeforeDeclaration1, "o2").WithArguments("o2")) 57Diagnostic(ERRID.ERR_BlockLocalShadowing1, "o1").WithArguments("o1"), 58Diagnostic(ERRID.ERR_BlockLocalShadowing1, "o1").WithArguments("o1")) 83Diagnostic(ERRID.ERR_TooManyArgs1, """a""").WithArguments("Public Sub Method1()"), 84Diagnostic(ERRID.ERR_NameNotMember2, ".Property1").WithArguments("Property1", "Class2"), 85Diagnostic(ERRID.ERR_NameNotMember2, ".Method2").WithArguments("Method2", "Class2"), 86Diagnostic(ERRID.ERR_NameNotMember2, ".Method3").WithArguments("Method3", "Class2")) 222Diagnostic(ERRID.ERR_CannotLiftStructureMeLambda, "S")) 322Diagnostic(ERRID.ERR_LValueRequired, ".A"), 323Diagnostic(ERRID.ERR_LValueRequired, ".B")) 340</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_StrictDisallowsLateBinding, ".Goo")) 800Diagnostic(ERRID.WRN_DefAsgUseNullRefStr, "b").WithArguments("b")) 839Diagnostic(ERRID.WRN_DefAsgUseNullRef, ".B").WithArguments("B")) 881Diagnostic(ERRID.WRN_DefAsgUseNullRefByRef, ".B").WithArguments("B")) 916Diagnostic(ERRID.WRN_DefAsgUseNullRef, "c").WithArguments("c")) 1033Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1034Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1035Diagnostic(ERRID.ERR_InvalidConstructorCall, ".New"))
SourceGeneration\GeneratorDriverTests.vb (44)
31Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 55Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 69Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 97Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 120Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 136Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 152Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 192Diagnostic("GEN001").WithLocation(1, 1), 193Diagnostic("GEN002").WithLocation(1, 1)) 198Diagnostic("GEN002").WithLocation(1, 1)) 203Diagnostic("GEN001").WithLocation(1, 1)) 208Diagnostic("GEN001").WithLocation(1, 1).WithWarningAsError(True), 209Diagnostic("GEN002").WithLocation(1, 1)) 214Diagnostic("GEN001").WithLocation(1, 1), 215Diagnostic("GEN002").WithLocation(1, 1).WithWarningAsError(True)) 225Diagnostic("GEN001", "com").WithLocation(1, 2)) 230Diagnostic("GEN001", "com", isSuppressed:=True).WithLocation(2, 2)) 235Diagnostic("GEN001").WithLocation(1, 1)) 240Diagnostic("GEN001", "com", isSuppressed:=True).WithLocation(2, 2)) 247Diagnostic("GEN001", "ano").WithLocation(4, 2)) 261Diagnostic("GEN001", "com").WithLocation(3, 6)) 270Diagnostic("GEN001", "com", isSuppressed:=True).WithLocation(4, 6)) 279Diagnostic("GEN001").WithLocation(1, 1)) 289Diagnostic("GEN001", "com").WithLocation(4, 6), 290Diagnostic("GEN001", "ano").WithLocation(5, 6)) 317Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 349Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 378Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 409Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 439Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 470Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 499Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 529Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 559Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 588Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 603Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 621Dim outputDiagnostics As ImmutableArray(Of Diagnostic) = Nothing 655Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 662Shared Sub VerifyDiagnosticsWithSource(source As String, diag As Diagnostic, location As TextSpan, ParamArray expected As DiagnosticDescription()) 682Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 689Shared Sub VerifyDiagnosticsWithLocation(source As String, reportDiagnostics As IReadOnlyList(Of (Diagnostic As Diagnostic, Location As String)), ParamArray expected As DiagnosticDescription()) 717Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 723Shared Sub VerifyArgumentExceptionDiagnostic(diagnostic As Diagnostic, generatorName As String, message As String, parameterName As String, Optional initialization As Boolean = False) 732Shared Sub VerifyGeneratorExceptionDiagnostic(Of T As Exception)(diagnostic As Diagnostic, generatorName As String, message As String, Optional initialization As Boolean = False)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (408)
DocumentationComments\DocCommentTests.vb (1)
12123Dim diagnostics As Diagnostic()
StaticLocalDeclarationTests.vb (35)
205compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_DuplicateLocalStatic1, "x").WithArguments("x")) 235compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_DuplicateLocalStatic1, "x").WithArguments("x")) 262compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_DuplicateLocalStatic1, "x").WithArguments("x")) 292compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BlockLocalShadowing1, "y").WithArguments("y"), 293Diagnostic(ERRID.ERR_BlockLocalShadowing1, "x").WithArguments("x"), 294Diagnostic(ERRID.ERR_DuplicateLocalStatic1, "x").WithArguments("x")) 322compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadStaticLocalInGenericMethod, "Static")) 351compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadStaticLocalInStruct, "Static")) 382compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Public").WithArguments("Public"), 383Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Private").WithArguments("Private"), 384Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Protected").WithArguments("Protected"), 385Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Friend").WithArguments("Friend"), 386Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Protected").WithArguments("Protected"), 387Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Friend").WithArguments("Friend"), 388Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Shared").WithArguments("Shared"), 389Diagnostic(ERRID.WRN_UnusedLocal, "SLItem6").WithArguments("SLItem6")) 415compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BadDimFlags1, "Static").WithArguments("Static")) 449compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_VoidValue, "StaticLocalInSub"), 450Diagnostic(ERRID.ERR_VoidValue, "StaticLocalInSub2")) 481compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_BlockLocalShadowing1, "sl1").WithArguments("sl1"), 482Diagnostic(ERRID.ERR_BinaryOperands3, "sl1 &= ""InCatch""").WithArguments("&", "System.Exception", "String")) 507compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "as"), 508Diagnostic(ERRID.ERR_DuplicateSpecifier, "Static")) 535compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Static")) 568compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedExpression, ""), 569Diagnostic(ERRID.ERR_SubDisallowsStatement, "static x1 As Integer = 0")) 615compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_StaticInLambda, "static"), 616Diagnostic(ERRID.ERR_StaticInLambda, "static")) 651compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_NameNotDeclared1, "SL").WithArguments("SL")) 676compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RestrictedType1, "ArgIterator").WithArguments("System.ArgIterator"), 677Diagnostic(ERRID.WRN_UnusedLocal, "SLItem2").WithArguments("SLItem2")) 702compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_RestrictedType1, "TypedReference").WithArguments("System.TypedReference")) 733compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedQueryableSource, "{1, 2, 3}").WithArguments("Integer()"), 734Diagnostic(ERRID.ERR_IterationVariableShadowLocal1, "sl").WithArguments("sl"), 735Diagnostic(ERRID.ERR_IterationVariableShadowLocal1, "sl").WithArguments("sl"))
SymbolDisplay\SymbolDisplayTests.vb (2)
5581Diagnostic(9064, "F1").WithLocation(4, 11), 5582Diagnostic(9064, "F2").WithLocation(5, 20)
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (2)
2251Diagnostic(ERRID.ERR_NameNotMember2, "x.Goo").WithArguments("Goo", "Integer"), 2252Diagnostic(ERRID.HDN_UnusedImportStatement, "Imports Extensions"))
SymbolsTests\Metadata\MetadataMemberTests.vb (9)
800Diagnostic(ERRID.ERR_NameNotMember2, "c._VtblGap1_1").WithArguments("_VtblGap1_1", "[Class]"), 801Diagnostic(ERRID.ERR_NameNotMember2, "c.BothAccessorsAreGaps").WithArguments("BothAccessorsAreGaps", "[Class]"), 802Diagnostic(ERRID.ERR_NameNotMember2, "c.BothAccessorsAreGaps").WithArguments("BothAccessorsAreGaps", "[Class]"), 803Diagnostic(ERRID.ERR_NoGetProperty1, "c.GetterIsGap").WithArguments("GetterIsGap"), 804Diagnostic(ERRID.ERR_NoSetProperty1, "c.SetterIsGap = x").WithArguments("SetterIsGap")) 853Diagnostic(ERRID.ERR_UnimplementedMember3, "[Interface]").WithArguments("Class", "Empty", "WriteOnly Property GetterIsGap As Integer", "[Interface]"), 854Diagnostic(ERRID.ERR_UnimplementedMember3, "[Interface]").WithArguments("Class", "Empty", "ReadOnly Property SetterIsGap As Integer", "[Interface]"), 855Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "[Interface]._VtblGap1_1").WithArguments("_VtblGap1_1", "_VtblGap1_1", "sub", "[Interface]"), 856Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "[Interface].BothAccessorsAreGaps").WithArguments("BothAccessorsAreGaps", "BothAccessorsAreGaps", "property", "[Interface]"))
SymbolsTests\Metadata\PE\TypeForwarders.vb (25)
242Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Base").WithArguments("Base", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 243Diagnostic(ERRID.ERR_TypeFwdCycle2, "Base").WithArguments("Base", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")) 318Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Base").WithArguments("Base", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 319Diagnostic(ERRID.ERR_TypeFwdCycle2, "Base").WithArguments("Base", "pe3, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")) 506Diagnostic(ERRID.ERR_TypeFwdCycle2, "us.Goo()").WithArguments("Cycle", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")) 738Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Outer").WithArguments("Outer", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 739Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Outer").WithArguments("Outer", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 740Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Outer").WithArguments("Outer", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 741Diagnostic(ERRID.ERR_UndefinedType1, "Generic").WithArguments("Generic"), 742Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "Generic(Of Integer)").WithArguments("Generic", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 743Diagnostic(ERRID.ERR_UndefinedType1, "Generic(Of Integer, Integer)").WithArguments("Generic")) 779Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "upper").WithArguments("upper", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 780Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "uPPeR").WithArguments("uPPeR", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 781Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "LOWER.mixed").WithArguments("LOWER.mixed", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 782Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "lOwEr.MIXED").WithArguments("lOwEr.MIXED", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")) 909Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "t0").WithArguments("t0", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 910Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "ns.t1").WithArguments("ns.t1", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 911Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "ns.ms.t2").WithArguments("ns.ms.t2", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"), 912Diagnostic(ERRID.ERR_UndefinedType1, "ns.ms.ls.t3").WithArguments("ns.ms.ls.t3"), 913Diagnostic(ERRID.ERR_UndefinedType1, "nope").WithArguments("nope"), 914Diagnostic(ERRID.ERR_UndefinedType1, "ns.nope").WithArguments("ns.nope"), 915Diagnostic(ERRID.ERR_UndefinedType1, "ns.ms.nope").WithArguments("ns.ms.nope"), 916Diagnostic(ERRID.ERR_UndefinedType1, "ns.ms.ls.nope").WithArguments("ns.ms.ls.nope")) 973Diagnostic(ERRID.ERR_UndefinedType1, "n2.n3.t").WithArguments("n2.n3.t"), 974Diagnostic(ERRID.ERR_ForwardedTypeUnavailable3, "n1.n2.n3.t").WithArguments("n1.n2.n3.t", "TypeForwarders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", "pe2, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"))
SymbolsTests\Metadata\WinMdEventTest.vb (36)
788comp.VerifyEmitDiagnostics(Diagnostic(ERRID.ERR_WinRTEventWithoutDelegate, "E")) 1068Diagnostic(ERRID.ERR_MixingWinRTAndNETEvents, "I2.WinRT").WithArguments("Normal", "I2.WinRT", "I1.Normal"), 1069Diagnostic(ERRID.ERR_MixingWinRTAndNETEvents, "I2.Normal").WithArguments("WinRT", "I1.WinRT", "I2.Normal")) 1102Diagnostic(ERRID.ERR_MixingWinRTAndNETEvents, "I1.WinRT").WithArguments("Normal", "I1.WinRT", "I1.Normal"), 1103Diagnostic(ERRID.ERR_MixingWinRTAndNETEvents, "I2.WinRT").WithArguments("Normal", "I2.WinRT", "I1.Normal")) 1122Diagnostic(ERRID.ERR_WinRTEventWithoutDelegate, "E")) 1154Diagnostic(ERRID.ERR_WinRTEventWithoutDelegate, "E"), 1155Diagnostic(ERRID.ERR_CustomEventRequiresAs, "Public Custom Event E ' As System.Action" + Environment.NewLine), 1156Diagnostic(ERRID.ERR_ExpectedDeclaration, "AddHandler(value As System.Action)"), 1157Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return Nothing"), 1158Diagnostic(ERRID.ERR_InvalidEndAddHandler, "End AddHandler"), 1159Diagnostic(ERRID.ERR_ExpectedDeclaration, "RemoveHandler(value As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)"), 1160Diagnostic(ERRID.ERR_InvalidEndRemoveHandler, "End RemoveHandler"), 1161Diagnostic(ERRID.ERR_ExpectedDeclaration, "RaiseEvent()"), 1162Diagnostic(ERRID.ERR_InvalidEndRaiseEvent, "End RaiseEvent"), 1163Diagnostic(ERRID.ERR_InvalidEndEvent, "End Event")) 1208Diagnostic(ERRID.ERR_CustomEventRequiresAs, "Public Custom Event E2 Implements I.E2"), 1209Diagnostic(ERRID.ERR_ExpectedDeclaration, "AddHandler(value As System.Action)"), 1210Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Return Nothing"), 1211Diagnostic(ERRID.ERR_InvalidEndAddHandler, "End AddHandler"), 1212Diagnostic(ERRID.ERR_ExpectedDeclaration, "RemoveHandler(value As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)"), 1213Diagnostic(ERRID.ERR_InvalidEndRemoveHandler, "End RemoveHandler"), 1214Diagnostic(ERRID.ERR_ExpectedDeclaration, "RaiseEvent()"), 1215Diagnostic(ERRID.ERR_InvalidEndRaiseEvent, "End RaiseEvent"), 1216Diagnostic(ERRID.ERR_InvalidEndEvent, "End Event"), 1217Diagnostic(ERRID.ERR_EventImplMismatch5, "I.E2").WithArguments("Public Event E2 As ?", "Event E2 As System.Action", "I", "?", "System.Action")) 1250Diagnostic(ERRID.ERR_AddParamWrongForWinRT, "AddHandler(value As System.Action(Of Integer))")) 1282Diagnostic(ERRID.ERR_RemoveParamWrongForWinRT, "RemoveHandler(value As System.Action)")) 1316Diagnostic(ERRID.ERR_TypeRefResolutionError3, <![CDATA[AddHandler(value As System.Action) 1356Diagnostic(ERRID.ERR_EventImplRemoveHandlerParamWrong, "RemoveHandler(value As System.Action)").WithArguments("F", "E", "I")) 1397Diagnostic(ERRID.ERR_TypeRefResolutionError3, <![CDATA[AddHandler(value As System.Action) 1400Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", outputName), 1401Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken", outputName)) 1526Diagnostic(ERRID.ERR_AddRemoveParamNotEventType, "RemoveHandler(value As System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken)")) 1596Diagnostic(ERRID.WRN_DefAsgNoRetValWinRtEventVal1, "End AddHandler").WithArguments("E")) 1690Diagnostic(ERRID.ERR_NameNotDeclared1, "CustomEventEvent").WithArguments("CustomEventEvent"))
SymbolsTests\Retargeting\RetargetingTests.vb (33)
354Diagnostic(ERRID.ERR_UndefinedType1, "E").WithArguments("System.Int32"), 355Diagnostic(ERRID.ERR_UndefinedType1, <![CDATA[Public Enum E 358Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Enum", "test.dll")) 392Diagnostic(ERRID.ERR_UndefinedType1, "Short").WithArguments("System.Int16"), 393Diagnostic(ERRID.ERR_UndefinedType1, <![CDATA[Public Enum E As Short 396Diagnostic(ERRID.ERR_TypeRefResolutionError3, "E").WithArguments("System.Enum", "test.dll")) 430Diagnostic(ERRID.ERR_BadImplementsType, "Short")) 497Diagnostic(ERRID.ERR_BadImplementsType, "Short")) 598Diagnostic(ERRID.ERR_UndefinedType1, "Short").WithArguments("System.Int16")) 1547main_NoRetarget.VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1548Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1549Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1550Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1551Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1552Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1553Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1554Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestStructure").WithArguments("TestStructure", "Friend")) 1557Main_Retarget.VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1558Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1559Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1560Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1561Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1562Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1563Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestInterface").WithArguments("TestInterface", "Friend"), 1564Diagnostic(ERRID.ERR_InaccessibleSymbol2, "TestStructure").WithArguments("TestStructure", "Friend")) 2938main_NoRetarget.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "NewClass").WithArguments("NewClass", "ClassLibrary1.TestInterface"), 2939Diagnostic(ERRID.ERR_NoSuitableNewForNewConstraint2, "ClassLibrary1.TestInterface").WithArguments("ClassLibrary1.TestInterface", "t"), 2940Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "Integer").WithArguments("Integer", "ClassLibrary1.TestClass"), 2941Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "ABC").WithArguments("ABC", "ClassLibrary1.TestClass")) 2946main_NoRetarget.VerifyDiagnostics(Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "NewClass").WithArguments("NewClass", "ClassLibrary1.TestInterface"), 2947Diagnostic(ERRID.ERR_NoSuitableNewForNewConstraint2, "ClassLibrary1.TestInterface").WithArguments("ClassLibrary1.TestInterface", "t"), 2948Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "Integer").WithArguments("Integer", "ClassLibrary1.TestClass"), 2949Diagnostic(ERRID.ERR_GenericConstraintNotSatisfied2, "ABC").WithArguments("ABC", "ClassLibrary1.TestClass"))
SymbolsTests\Source\DelegateTests.vb (7)
19Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.Void"), 20Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.Void"), 21Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.IAsyncResult"), 22Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.Object"), 23Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.IntPtr"), 24Diagnostic(ERRID.ERR_UndefinedType1, "Delegate Sub A()").WithArguments("System.AsyncCallback"), 25Diagnostic(ERRID.ERR_TypeRefResolutionError3, "A").WithArguments("System.MulticastDelegate", "test.dll"))
SymbolsTests\Source\EnumTests.vb (7)
948CompilationUtils.CreateCompilationWithMscorlib40(text).VerifyDiagnostics(Diagnostic(ERRID.ERR_CircularEvaluation1, "A").WithArguments("A")) 963Diagnostic(ERRID.ERR_MissingEndEnum, "Enum E"), 964Diagnostic(ERRID.ERR_InvInsideEndsEnum, ""), 965Diagnostic(ERRID.ERR_MissingEndBrack, "[A"), 966Diagnostic(ERRID.ERR_InvalidEndEnum, "End Enum"), 967Diagnostic(ERRID.ERR_BadEmptyEnum1, "E").WithArguments("E")) 982Diagnostic(ERRID.ERR_InvInsideEnum, "goo:"))
SymbolsTests\Source\EventTests.vb (2)
1104comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_ParamArrayIllegal1, "paramarray").WithArguments("Event"), 1105Diagnostic(ERRID.ERR_ParamArrayIllegal1, "paramarray").WithArguments("Delegate"))
SymbolsTests\Source\FieldTests.vb (1)
448vbCompilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ObjectReferenceNotSupplied, "field"))
SymbolsTests\Source\ImplementsTests.vb (2)
3678Diagnostic(ERRID.ERR_IdentNotMemberOfInterface4, "IRef.P").WithArguments("P", "P", "property", "IRef"), 3679Diagnostic(ERRID.ERR_UnimplementedMember3, "IRef").WithArguments("Class", "Impl", "Property P(ByRef x As Integer) As String", "IRef"))
SymbolsTests\Source\MeMyBaseMyClassTests.vb (79)
37Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Me"), 38Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Me"), 39Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Me"), 40Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Me")) 87VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_UseOfKeywordFromModule1, "Me").WithArguments("Me")) 286VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_InaccessibleMember3, "Me.goo").WithArguments("BaseClass", "Private Sub goo()", "Private")) 662Diagnostic(ERRID.ERR_ExpectedProcedure, "Me"), 663Diagnostic(ERRID.ERR_ExpectedProcedure, "Me"), 664Diagnostic(ERRID.ERR_NameNotMember2, "Me.Me").WithArguments("Me", "Class1"), 665Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.me").WithArguments("me", "Object"), 666Diagnostic(ERRID.ERR_NameNotMember2, "Me.mybase").WithArguments("mybase", "Class1"), 667Diagnostic(ERRID.ERR_NameNotMember2, "Me.myclass").WithArguments("myclass", "Class1"), 668Diagnostic(ERRID.ERR_NameNotMember2, "MyClass.me").WithArguments("me", "Class1")) 687Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "MyBase"), 688Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "MyBase")) 702VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_UnrecognizedTypeKeyword, "")) 720Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "MyBase"), 721Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "mybase")) 743VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_InaccessibleMember3, "MyBase.goo").WithArguments("BaseClass", "Private Sub goo()", "Private")) 806Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 807Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 808Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 809Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 810Diagnostic(ERRID.ERR_MissingIsInTypeOf, ""), 811Diagnostic(ERRID.ERR_UnrecognizedType, ""), 812Diagnostic(ERRID.ERR_ExpectedRparen, ""), 813Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 814Diagnostic(ERRID.ERR_LValueRequired, "MyBase")) 842VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.mybase").WithArguments("mybase", "DerivedClass")) 859VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_UseOfKeywordFromModule1, "MyBase").WithArguments("MyBase")) 888VerifyDiagnostics(comp2, Diagnostic(ERRID.ERR_InaccessibleMember3, "MyBase.goo").WithArguments("Class1", "Friend Sub goo()", "Friend")) 910VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.goo").WithArguments("goo", "BaseClass")) 932VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.goo").WithArguments("goo", "BaseClass")) 961VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 962Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 963Diagnostic(ERRID.ERR_ExpectedProcedure, "MyBase"), 964Diagnostic(ERRID.ERR_ExpectedProcedure, "MyBase")) 990VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_InaccessibleSymbol2, "MyBase.id").WithArguments("BaseClass.ID", "Private")) 1277Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1278Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1279Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1280Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1281Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1282Diagnostic(ERRID.ERR_ExpectedProcedure, "MyBase"), 1283Diagnostic(ERRID.ERR_ExpectedProcedure, "MyBase")) 1306Diagnostic(ERRID.ERR_NameNotDeclared1, "MyBase!").WithArguments("MyBase"), 1307Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.MyBase").WithArguments("MyBase", "Object"), 1308Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.MyClass").WithArguments("MyClass", "Object"), 1309Diagnostic(ERRID.ERR_NameNotMember2, "MyClass.MyBase").WithArguments("MyBase", "C1"), 1310Diagnostic(ERRID.ERR_NameNotMember2, "Me.MyBase").WithArguments("MyBase", "C1"), 1311Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.Me").WithArguments("Me", "Object"), 1312Diagnostic(ERRID.ERR_NameNotMember2, "MyBase.Whatever").WithArguments("Whatever", "Object")) 1349Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1350Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1351Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1352Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1353Diagnostic(ERRID.ERR_MissingIsInTypeOf, ""), 1354Diagnostic(ERRID.ERR_UnrecognizedType, ""), 1355Diagnostic(ERRID.ERR_ExpectedRparen, ""), 1356Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1357Diagnostic(ERRID.ERR_LValueRequired, "MyClass")) 1381VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_NameNotMember2, "MyClass.goo").WithArguments("goo", "BaseClass")) 1568VerifyDiagnostics(comp, Diagnostic(ERRID.ERR_UseOfKeywordNotInInstanceMethod1, "MyClass").WithArguments("MyClass"), 1569Diagnostic(ERRID.WRN_DefAsgNoRetValFuncRef1, "End Function").WithArguments("goo")) 1687Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1688Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1689Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1690Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1691Diagnostic(ERRID.ERR_ExpectedDotAfterMyClass, "MyClass"), 1692Diagnostic(ERRID.ERR_ExpectedDotAfterMyBase, "MyBase"), 1693Diagnostic(ERRID.ERR_LValueRequired, "Me"), 1694Diagnostic(ERRID.ERR_LValueRequired, "MyClass"), 1695Diagnostic(ERRID.ERR_LValueRequired, "MyBase"), 1696Diagnostic(ERRID.ERR_UseOfKeywordFromModule1, "Me").WithArguments("Me"), 1697Diagnostic(ERRID.ERR_MyClassNotInClass, "MyClass").WithArguments("MyClass"), 1698Diagnostic(ERRID.ERR_UseOfKeywordFromModule1, "MyBase").WithArguments("MyBase"), 1699Diagnostic(ERRID.ERR_LValueRequired, "Me"), 1700Diagnostic(ERRID.ERR_LValueRequired, "MyClass"), 1701Diagnostic(ERRID.ERR_UseOfKeywordFromStructure1, "MyBase").WithArguments("MyBase"))
SymbolsTests\Source\OverridesTests.vb (13)
1145Diagnostic(ERRID.ERR_BadOverrideAccess2, "Set").WithArguments("Private Overrides Property Set Property1(value As Long)", "Protected Overridable Property Set Property1(value As Long)")) 1181Diagnostic(ERRID.ERR_BadOverrideAccess2, "Get").WithArguments("Protected Overrides Property Get Property1() As Long", "Public Overridable Property Get Property1() As Long")) 1366Diagnostic(ERRID.ERR_FriendAssemblyBadAccessOverride2, "P").WithArguments("Protected Friend Overrides WriteOnly Property P As Integer", "Protected Friend Overrides WriteOnly Property P As Integer"), 1367Diagnostic(ERRID.ERR_FriendAssemblyBadAccessOverride2, "Set").WithArguments("Protected Friend Overrides Property Set P(value As Integer)", "Protected Friend Overridable Overloads Property Set P(value As Integer)"), 1368Diagnostic(ERRID.ERR_OverridingPropertyKind2, "P").WithArguments("Protected Overrides WriteOnly Property P As Integer", "Public Overrides ReadOnly Property P As Integer"), 1369Diagnostic(ERRID.ERR_OverridingPropertyKind2, "P").WithArguments("Public Overrides ReadOnly Property P As Integer", "Protected Friend Overrides WriteOnly Property P As Integer"), 1370Diagnostic(ERRID.ERR_BadOverrideAccess2, "P").WithArguments("Protected Overrides ReadOnly Property P As Integer", "Public Overrides ReadOnly Property P As Integer")) 1563Diagnostic(ERRID.ERR_FriendAssemblyBadAccessOverride2, "P").WithArguments("Protected Friend Overrides WriteOnly Property P As Integer", "Protected Friend Overrides WriteOnly Property P As Integer"), 1564Diagnostic(ERRID.ERR_FriendAssemblyBadAccessOverride2, "Set").WithArguments("Protected Friend Overrides Property Set P(value As Integer)", "Protected Friend Overridable Overloads Property Set P(value As Integer)"), 1565Diagnostic(ERRID.ERR_OverridingPropertyKind2, "P").WithArguments("Protected Overrides WriteOnly Property P As Integer", "Public Overrides ReadOnly Property P As Integer"), 1566Diagnostic(ERRID.ERR_OverridingPropertyKind2, "P").WithArguments("Public Overrides ReadOnly Property P As Integer", "Protected Friend Overrides WriteOnly Property P As Integer"), 1567Diagnostic(ERRID.ERR_BadOverrideAccess2, "P").WithArguments("Protected Overrides ReadOnly Property P As Integer", "Public Overrides ReadOnly Property P As Integer")) 2617Diagnostic(ERRID.ERR_OverrideWithByref2, "P").WithArguments("Public Overrides Property P(x As Integer) As String", "Public Overridable Property P(ByRef x As Integer) As String"))
SymbolsTests\Source\PropertyTests.vb (14)
665Diagnostic(ERRID.ERR_SetValueNotPropertyType, "value")) 4781Diagnostic(ERRID.WRN_SynthMemberShadowsMember5, "Goo").WithArguments("property", "Goo", "get_Goo", "interface", "IA")) 4828Diagnostic(ERRID.ERR_NameNotMember2, "x.get_Goo").WithArguments("get_Goo", "I")) 5234Diagnostic(ERRID.ERR_VoidValue, "A.Goo")) 5260VerifyDiagnostics(Diagnostic(ERRID.ERR_AmbiguousInUnnamedNamespace1, "A(Of Integer)").WithArguments("A")) 5284Diagnostic(ERRID.ERR_NameNotMember2, "B.Goo").WithArguments("Goo", "B")) 5512Diagnostic(ERRID.ERR_NameNotMember2, "i.Instance").WithArguments("Instance", "Mismatched"), 5513Diagnostic(ERRID.ERR_NameNotMember2, "i.Instance").WithArguments("Instance", "Mismatched"), 5514Diagnostic(ERRID.ERR_UnsupportedProperty1, "StaticAndInstance").WithArguments("Signatures.StaticAndInstance"), 5515Diagnostic(ERRID.ERR_UnsupportedProperty1, "GetUsedAsSet").WithArguments("Signatures.GetUsedAsSet"), 5516Diagnostic(ERRID.ERR_NameNotMember2, "Mismatched.[Static]").WithArguments("Static", "Mismatched"), 5517Diagnostic(ERRID.ERR_NameNotMember2, "Mismatched.[Static]").WithArguments("Static", "Mismatched")) 8088Diagnostic(ERRID.ERR_SynthMemberClashesWithMember5, "A").WithArguments("property", "A", "set_A", "class", "C")) 8092Diagnostic(ERRID.ERR_SynthMemberClashesWithMember5, "A").WithArguments("property", "A", "put_A", "class", "C"))
SymbolsTests\Source\SourceSymbolTests.vb (4)
533Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 534Diagnostic(ERRID.ERR_MissingEndBrack, "[goo"), 535Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 536Diagnostic(ERRID.ERR_MissingEndBrack, "[goo"))
SymbolsTests\Source\TypeTests.vb (4)
2736Diagnostic(ERRID.ERR_NewInStruct, "new").WithLocation(2, 9) 2783Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb") 2846Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb") 2970Diagnostic(ERRID.WRN_NamespaceCaseMismatch3, "ns1").WithArguments("ns1", "NS1", "a.vb")
SymbolsTests\SymbolErrorTests.vb (132)
954</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_StrictDisallowsImplicitProc, "+"), 955Diagnostic(ERRID.WRN_DefAsgNoRetValOpRef1, "End Operator").WithArguments("+")) 1409Diagnostic(ERRID.ERR_DuplicateParamName1, "a").WithArguments("a"), 1410Diagnostic(ERRID.ERR_DuplicateParamName1, "b").WithArguments("b"), 1411Diagnostic(ERRID.ERR_DuplicateParamName1, "c").WithArguments("c")) 1465Diagnostic(ERRID.ERR_BadEventFlags1, "Overrides").WithArguments("Overrides"), 1466Diagnostic(ERRID.ERR_BadEventFlags1, "Overloads").WithArguments("Overloads"), 1467Diagnostic(ERRID.ERR_BadEventFlags1, "Overloads").WithArguments("Overloads"), 1468Diagnostic(ERRID.ERR_BadEventFlags1, "Overrides").WithArguments("Overrides"), 1469Diagnostic(ERRID.ERR_BadEventFlags1, "NotOverridable").WithArguments("NotOverridable"), 1470Diagnostic(ERRID.ERR_BadEventFlags1, "Default").WithArguments("Default"), 1471Diagnostic(ERRID.ERR_BadEventFlags1, "Static").WithArguments("Static"), 1472Diagnostic(ERRID.WRN_OverrideType5, "e1").WithArguments("event", "e1", "event", "class", "c1"), 1473Diagnostic(ERRID.WRN_OverrideType5, "e2").WithArguments("event", "e2", "event", "class", "c1")) 1493Diagnostic(ERRID.ERR_BadLocalDimFlags1, "Shared").WithArguments("Shared"), 1494Diagnostic(ERRID.WRN_UnusedLocalConst, "x").WithArguments("x")) 2167</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InterfaceCantUseEventSpecifier1, "Friend").WithArguments("Friend"), 2168Diagnostic(ERRID.ERR_InterfaceCantUseEventSpecifier1, "Protected").WithArguments("Protected"), 2169Diagnostic(ERRID.ERR_InterfaceCantUseEventSpecifier1, "Private").WithArguments("Private")) 3972comp.VerifyDiagnostics(Diagnostic(ERRID.ERR_InaccessibleSymbol2, "C.c_int").WithArguments("C.c_int", "Friend"), 3973Diagnostic(ERRID.ERR_InaccessibleSymbol2, "C.c_priv").WithArguments("C.c_priv", "Private"), 3974Diagnostic(ERRID.ERR_InaccessibleSymbol2, "D").WithArguments("D", "Friend")) 5973Diagnostic(ERRID.ERR_InvalidAssemblyAttribute1, "c1").WithArguments("c1Attribute"), 5974Diagnostic(ERRID.ERR_InvalidModuleAttribute1, "c1").WithArguments("c1Attribute")) 5991</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidModuleAttribute1, "InternalsVisibleTo").WithArguments("InternalsVisibleTo")) 6381</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_MustOverOnNotInheritPartClsMem1, "MustOverride").WithArguments("MustOverride")) 6950</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_LocalsCannotHaveAttributes, "<My(12345)>")) 6986</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "attr1").WithArguments("attr1", "Beep1"), 6987Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "attr2").WithArguments("attr2", "Beep2"), 6988Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "attr3").WithArguments("attr3", "Beep3"), 6989Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "attr4").WithArguments("attr4", "Beep4"), 6990Diagnostic(ERRID.ERR_InvalidAttributeUsage2, "attr5").WithArguments("attr5", "Beep5")) 7126</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "Assembly:clscompliant(true)").WithArguments("CLSCompliantAttribute"), 7127Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "Assembly:clscompliant(true)").WithArguments("CLSCompliantAttribute"), 7128Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "Module:clscompliant(true)").WithArguments("CLSCompliantAttribute"), 7129Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "Module:clscompliant(true)").WithArguments("CLSCompliantAttribute"), 7130Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrDelegate()").WithArguments("attrDelegate"), 7131Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrDelegate()").WithArguments("attrDelegate"), 7132Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrEnum()").WithArguments("attrEnum"), 7133Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrEnum()").WithArguments("attrEnum"), 7134Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrInterface()").WithArguments("attrInterface"), 7135Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrInterface()").WithArguments("attrInterface"), 7136Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrClass()").WithArguments("attrClass"), 7137Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrClass()").WithArguments("attrClass"), 7138Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrStruct()").WithArguments("attrStruct"), 7139Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrStruct()").WithArguments("attrStruct"), 7140Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrParameter()").WithArguments("attrParameter"), 7141Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrParameter()").WithArguments("attrParameter"), 7142Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrClass()").WithArguments("attrClass"), 7143Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrClass()").WithArguments("attrClass"), 7144Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrCtor()").WithArguments("attrCtor"), 7145Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrCtor()").WithArguments("attrCtor"), 7146Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrField()").WithArguments("attrField"), 7147Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrField()").WithArguments("attrField"), 7148Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrProperty()").WithArguments("attrProperty"), 7149Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrProperty()").WithArguments("attrProperty"), 7150Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrReturnType()").WithArguments("attrReturnType"), 7151Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrReturnType()").WithArguments("attrReturnType"), 7152Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrMethod()").WithArguments("attrMethod"), 7153Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "attrMethod()").WithArguments("attrMethod")) 7187</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1")) 7221</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1"), 7222Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1")) 7254</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1")) 7286</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1"), 7287Diagnostic(ERRID.ERR_InvalidMultipleAttributeUsage1, "A1()").WithArguments("A1")) 7791Diagnostic(ERRID.ERR_ModuleCantUseDLLDeclareSpecifier1, "Protected").WithArguments("Protected")) 7805Diagnostic(ERRID.ERR_StructCantUseDLLDeclareSpecifier1, "Protected").WithArguments("Protected")) 7924compilation1.VerifyDiagnostics(Diagnostic(ERRID.ERR_ObsoleteAsAny, "Any").WithArguments("Any")) 9554</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_SynthMemberClashesWithMember5, "obj1").WithArguments("event", "obj1", "obj1Event", "module", "M1")) 9764</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_MemberClashesWithSynth6, "ObjEvent").WithArguments("WithEvents variable", "ObjEvent", "event", "Obj", "module", "M1")) 13266</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AttributeMustInheritSysAttr, "MyAttribute").WithArguments("MyAttribute")) 13288</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AttributeCannotBeAbstract, "My").WithArguments("MyAttribute")) 13312</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AttributeCannotBeAbstract, "My").WithArguments("MyAttribute")) 13399Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, Version=1"")").WithArguments("Test, Version=1").WithLocation(11, 2), 13400Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, Version=1.*"")").WithArguments("Test, Version=1.*").WithLocation(12, 2), 13401Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, Version=1.1.*"")").WithArguments("Test, Version=1.1.*").WithLocation(13, 2), 13402Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, Version=1.1.1.*"")").WithArguments("Test, Version=1.1.1.*").WithLocation(14, 2), 13403Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, ProcessorArchitecture=MSIL"")").WithArguments("Test, ProcessorArchitecture=MSIL").WithLocation(15, 2), 13404Diagnostic(ERRID.ERR_FriendAssemblyBadArguments, "Assembly: InternalsVisibleTo(""Test, CuLTure=EN"")").WithArguments("Test, CuLTure=EN").WithLocation(16, 2)) 13428Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: InternalsVisibleTo(""\u1000000;a"")").WithArguments("\u1000000;a").WithLocation(6, 2), 13429Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: InternalsVisibleTo(""a'b'c"")").WithArguments("a'b'c").WithLocation(7, 2), 13430Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: InternalsVisibleTo(""Test, PublicKey=Null"")").WithArguments("Test, PublicKey=Null").WithLocation(8, 2), 13431Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: InternalsVisibleTo(""Test, Bar"")").WithArguments("Test, Bar").WithLocation(9, 2), 13432Diagnostic(ERRID.ERR_FriendAssemblyNameInvalid, "Assembly: InternalsVisibleTo(""Test, Version"")").WithArguments("Test, Version").WithLocation(10, 2)) 13965</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AttrCannotBeGenerics, "attributeusageattribute").WithArguments("attributeusageattribute"), 13966Diagnostic(ERRID.ERR_AttrCannotBeGenerics, "myattr").WithArguments("Test(Of attributeusageattribute).myattr"), 13967Diagnostic(ERRID.ERR_GenericClassCannotInheritAttr, "myattr")) 14184compilation1.VerifyDiagnostics(Diagnostic(ERRID.ERR_DeclaresCantBeInGeneric, "goo")) 16536</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_OperatorMustBePublic, "Private").WithArguments("Private")) 16557</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_OperatorMustBeShared, "IsFalse")) 16577</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BadOperatorFlags1, "Overridable").WithArguments("Overridable")) 16599Diagnostic(ERRID.ERR_OneParameterRequired1, "IsFalse").WithArguments("IsFalse"), 16600Diagnostic(ERRID.ERR_OneParameterRequired1, "IsTrue").WithArguments("IsTrue")) 16617</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_TwoParametersRequired1, "And").WithArguments("And")) 16634Diagnostic(ERRID.ERR_ExpectedLparen, ""), 16635Diagnostic(ERRID.ERR_ExpectedRparen, ""), 16636Diagnostic(ERRID.ERR_Syntax, "("), 16637Diagnostic(ERRID.ERR_OneOrTwoParametersRequired1, "+").WithArguments("+"), 16638Diagnostic(ERRID.WRN_DefAsgNoRetValOpRef1, "End Operator").WithArguments("+")) 16664</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConvMustBeWideningOrNarrowing, "CType")) 16678</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_InvalidSpecifierOnNonConversion1, "Widening").WithArguments("Widening")) 16693</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_UnaryParamMustBeContainingType1, "IsTrue").WithArguments("S1")) 16708</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_BinaryParamMustBeContainingType1, "And").WithArguments("S1")) 16723</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConvParamMustBeContainingType1, "CType").WithArguments("S1")) 16738</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_OperatorRequiresBoolReturnType1, "IsTrue").WithArguments("IsTrue")) 16753</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionToSameType, "CType")) 16770Diagnostic(ERRID.ERR_AccessMismatchOutsideAssembly4, "I1").WithArguments("op_Implicit", "I1", "structure", "S1"), 16771Diagnostic(ERRID.ERR_ConversionToInterfaceType, "CType")) 16789</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionToBaseType, "CType")) 16807</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionToDerivedType, "CType")) 16822</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionToObject, "CType")) 16839</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionFromInterfaceType, "CType")) 16856</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionFromBaseType, "CType")) 16873</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionFromDerivedType, "CType")) 16888</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_ConversionFromObject, "CType")) 16905</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_MatchingOperatorExpected2, "IsFalse").WithArguments("IsTrue", "Public Shared Operator IsFalse(z As S1) As Boolean")) 16919</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_OperatorRequiresIntegerParameter1, ">>").WithArguments(">>")) 17466compilation1.VerifyDiagnostics(Diagnostic(ERRID.ERR_LambdasCannotHaveAttributes, "<System.Runtime.InteropServices.InAttribute()>")) 17483</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_CantSpecifyParamsOnLambdaParamNoType, "y()")) 17496</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_AutoPropertyInitializedInStructure, "AP"), 17497Diagnostic(ERRID.ERR_NewIfNullOnGenericParam, "T")) 18760</compilation>).VerifyDiagnostics(Diagnostic(ERRID.WRN_SynthMemberShadowsMember5, "E").WithArguments("event", "E", "EEventHandler", "class", "A"), 18761Diagnostic(ERRID.WRN_SynthMemberShadowsMember5, "E").WithArguments("event", "E", "EEvent", "class", "A"), 18762Diagnostic(ERRID.WRN_SynthMemberShadowsMember5, "E").WithArguments("event", "E", "add_E", "class", "A"), 18763Diagnostic(ERRID.WRN_SynthMemberShadowsMember5, "E").WithArguments("event", "E", "remove_E", "class", "A")) 19344</compilation>).VerifyDiagnostics(Diagnostic(ERRID.WRN_ShadowingGenericParamWithParam1, "T").WithArguments("T")) 20733Dim diagnostics As ImmutableArray(Of Diagnostic) = Nothing 20989Dim err = DirectCast(errs.Single(), Diagnostic) 22484Assert.Equal(1, Enumerable.Count(Of Diagnostic)(errs)) 22485Dim err As Diagnostic = Enumerable.Single(Of Diagnostic)(errs)
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (558)
Parser\ParseAttributes.vb (11)
73Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Dim"), 74Diagnostic(ERRID.ERR_ExpectedGreater, ""), 75Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "clscompliant(true)"), 76Diagnostic(ERRID.ERR_ExpectedEOS, ">")) 174Diagnostic(ERRID.ERR_SpecifiersInvalidOnInheritsImplOpt, "<SomeAttribute()>"), 175Diagnostic(ERRID.ERR_UnrecognizedType, ""), 176Diagnostic(ERRID.ERR_ExpectedDeclaration, "IMammals")) 200]]>, Diagnostic(ERRID.ERR_FileAttributeNotAssemblyOrModule, "")) 208]]>, Diagnostic(ERRID.ERR_FileAttributeNotAssemblyOrModule, ""), 209Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 210Diagnostic(ERRID.ERR_ExpectedGreater, ""))
Parser\ParseDeclarationTests.vb (31)
241Diagnostic(ERRID.ERR_InvInsideEnum, "A:")) 248Diagnostic(ERRID.ERR_InvInsideEnum, "A:")) 496Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 497Diagnostic(ERRID.ERR_TypeParamMissingAsCommaOrRParen, ""), 498Diagnostic(ERRID.ERR_IllegalChar, "]")) 512Diagnostic(ERRID.ERR_MissingEndEnum, "Enum myenum"), 513Diagnostic(ERRID.ERR_InvInsideEndsEnum, "Shared Narrowing Operator CType(ByVal x As Integer) As c2"), 514Diagnostic(ERRID.ERR_InvalidEndEnum, "End Enum")) 553Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "VERSION 1.0 CLASS"), 554Diagnostic(ERRID.ERR_ObsoleteArgumentsNeedParens, "1.0 CLASS"), 555Diagnostic(ERRID.ERR_ArgumentSyntax, "CLASS"), 556Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "BEGIN"), 557Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "MultiUse = -1"), 558Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Persistable = 0"), 559Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "DataBindingBehavior = 0"), 560Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "DataSourceBehavior = 0"), 561Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "MTSTransactionMode = 0"), 562Diagnostic(ERRID.ERR_UnrecognizedEnd, "END"), 563Diagnostic(ERRID.ERR_ExpectedSpecifier, "VB_Name = ""Class1"""), 564Diagnostic(ERRID.ERR_ExpectedDeclaration, "Attribute"), 565Diagnostic(ERRID.ERR_ExpectedSpecifier, "VB_GlobalNameSpace = False"), 566Diagnostic(ERRID.ERR_ExpectedDeclaration, "Attribute"), 567Diagnostic(ERRID.ERR_ExpectedSpecifier, "VB_Creatable = True"), 568Diagnostic(ERRID.ERR_ExpectedDeclaration, "Attribute"), 569Diagnostic(ERRID.ERR_ExpectedSpecifier, "VB_PredeclaredId = False"), 570Diagnostic(ERRID.ERR_ExpectedDeclaration, "Attribute"), 571Diagnostic(ERRID.ERR_ExpectedSpecifier, "VB_Exposed = True"), 572Diagnostic(ERRID.ERR_ExpectedDeclaration, "Attribute"), 573Diagnostic(ERRID.ERR_ObsoleteObjectNotVariant, "Variant")) 689Diagnostic(ERRID.ERR_InvalidParameterSyntax, "anonymous1"), 690Diagnostic(ERRID.ERR_AutoPropertyCantHaveParams, <![CDATA[(
Parser\ParseDirectives.vb (105)
310Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "BlahBlah"), 311Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "BlahBlah") 491Diagnostic(ERRID.ERR_ExpectedEndIf, "If "), 492Diagnostic(ERRID.ERR_ExpectedExpression, ""), 493Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 494Diagnostic(ERRID.ERR_Syntax, "True"), 495Diagnostic(ERRID.ERR_UnrecognizedEnd, "End"), 496Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 497Diagnostic(ERRID.ERR_ExpectedEndIf, "If"), 498Diagnostic(ERRID.ERR_ExpectedExpression, ""), 499Diagnostic(ERRID.ERR_LbNoMatchingIf, "#End If")) 847Diagnostic(ERRID.WRN_BadGUIDFormatExtChecksum, """{12345678-1234-1234-1234-12345678901bc}"""), 848Diagnostic(ERRID.WRN_BadChecksumValExtChecksum, """1a2b3c4e65f617239a49b9a9c0391849d34950f923fab9484""") 865Diagnostic(ERRID.WRN_BadChecksumValExtChecksum, """1a2v""") 934Diagnostic(ERRID.ERR_ExpectedEndClass, "Class MissingEnd").WithLocation(4, 1) 1041Diagnostic(ERRID.ERR_IllegalChar, "$")) 1104]]>, Diagnostic(ERRID.ERR_IllegalChar, "$")) 1111]]>, Diagnostic(ERRID.ERR_IllegalChar, "$")) 1147Diagnostic(ERRID.ERR_ExpectedEndRegion, "#Region ""Start""")) 1162Diagnostic(ERRID.ERR_ExpectedEndRegion, "#Region ""Start"""), 1163Diagnostic(ERRID.ERR_ExpectedEndRegion, "#Region ""Tailing""")) 1229Diagnostic(ERRID.ERR_ExpectedEndRegion, "#region """""), 1230Diagnostic(ERRID.ERR_ExpectedEOS, "#")) 2783Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13)) 2789Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 2798Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 2823Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13)) 2829Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2838Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2863Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13)) 2869Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2878Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2903Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13)) 2909Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2918Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 2941Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13), 2942Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 2943Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13)) 2949Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13).WithWarningAsError(True), 2950Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 2951Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 2957Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17)) 2961Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13).WithWarningAsError(True), 2962Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17).WithWarningAsError(True), 2963Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 2986Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13), 2987Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 2988Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13)) 2994Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13).WithWarningAsError(True), 2995Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 2996Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 3002Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17)) 3006Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13).WithWarningAsError(True), 3007Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17).WithWarningAsError(True), 3008Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 3033Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17), 3034Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13)) 3040Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13).WithWarningAsError(True), 3041Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17)) 3047Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17)) 3051Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13).WithWarningAsError(True), 3052Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17).WithWarningAsError(True)) 3076Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 3077Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13)) 3083Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 3084Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 3090Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17)) 3094Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17).WithWarningAsError(True), 3095Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13).WithWarningAsError(True)) 3125Diagnostic(ERRID.WRN_UnusedLocal, "f").WithArguments("f").WithLocation(10, 13), 3126Diagnostic(ERRID.WRN_DefAsgUseNullRef, "g").WithArguments("g").WithLocation(13, 17)) 3132Diagnostic(ERRID.WRN_UnusedLocal, "f").WithArguments("f").WithLocation(10, 13).WithWarningAsError(True), 3133Diagnostic(ERRID.WRN_DefAsgUseNullRef, "g").WithArguments("g").WithLocation(13, 17)) 3139Diagnostic(ERRID.WRN_DefAsgUseNullRef, "g").WithArguments("g").WithLocation(13, 17)) 3143Diagnostic(ERRID.WRN_UnusedLocal, "f").WithArguments("f").WithLocation(10, 13).WithWarningAsError(True), 3144Diagnostic(ERRID.WRN_DefAsgUseNullRef, "g").WithArguments("g").WithLocation(13, 17).WithWarningAsError(True)) 3155Private ReadOnly _reporter As Func(Of SyntaxNode, DiagnosticDescriptor, Diagnostic) 3157Public Sub New(descriptor As DiagnosticDescriptor, kind As SyntaxKind, reporter As Func(Of SyntaxNode, DiagnosticDescriptor, Diagnostic)) 3187Return CodeAnalysis.Diagnostic.Create(d, varDecl.AsClause.GetLocation) 3256Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13), 3257Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17), 3258Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13)) 3264Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13).WithWarningAsError(True), 3265Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17), 3266Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 3272Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17)) 3276Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(5, 13).WithWarningAsError(True), 3277Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(7, 17).WithWarningAsError(True), 3278Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(9, 13).WithWarningAsError(True)) 3294Return CodeAnalysis.Diagnostic.Create(d, varDecl.AsClause.GetLocation) 3363Diagnostic(ERRID.WRN_DefAsgUseNullRef, "b").WithArguments("b").WithLocation(6, 17), 3364Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13)) 3383Diagnostic(ERRID.ERR_TypeMismatch2, "x").WithArguments("Integer", "System.Exception").WithLocation(5, 37)) 3544Diagnostic(ERRID.ERR_ExpectedWarningKeyword, "").WithLocation(3, 10), 3545Diagnostic(ERRID.ERR_ExpectedWarningKeyword, "").WithLocation(5, 9), 3546Diagnostic(ERRID.WRN_UnusedLocal, "a").WithArguments("a").WithLocation(4, 13)) 3569Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(3, 26), 3570Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(7, 17), 3571Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(8, 1), 3572Diagnostic(ERRID.WRN_DefAsgUseNullRef, "e").WithArguments("e").WithLocation(10, 17), 3573Diagnostic(ERRID.WRN_UnusedLocal, "d").WithArguments("d").WithLocation(8, 13)) 3602Diagnostic(ERRID.WRN_SharedMemberThroughInstance, "j.MaxValue").WithLocation(9, 25), 3603Diagnostic(ERRID.WRN_SharedMemberThroughInstance, "j.MaxValue").WithLocation(14, 21)) 3625Return CodeAnalysis.Diagnostic.Create(d, varDecl.AsClause.GetLocation) 3652Return CodeAnalysis.Diagnostic.Create(d, varDecl.AsClause.GetLocation)
Parser\ParseErrorTests.vb (82)
45Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True")) 59Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True Then")) 75Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True ThEn"), 76Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True TheN"), 77Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True Then")) 94Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True TheN"), 95Diagnostic(ERRID.ERR_LbExpectedEndIf, "#If True Then")) 108Diagnostic(ERRID.ERR_LbElseNoMatchingIf, "#Else"), 109Diagnostic(ERRID.ERR_LbExpectedEndIf, "")) 458Diagnostic(ERRID.ERR_ExecutableAsDeclaration, ".Dim(x131 = Sub())"), 459Diagnostic(ERRID.ERR_SubRequiresSingleStatement, "Sub()")) 543Diagnostic(ERRID.ERR_ExpectedDeclaration, "Global")) 862</compilation>).VerifyDiagnostics(Diagnostic(ERRID.ERR_RequiredConstExpr, "New Integer(1, 1) {{1, 2}, {2, 3}}"), 863Diagnostic(ERRID.ERR_OverloadWithDefault2, "goo").WithArguments("Public Sub goo([i As Integer(*,*)])", "Public Sub goo([i As Integer(*,*) = Nothing])")) 874Diagnostic(ERRID.ERR_RequiredConstConversion2, "#If Var Then").WithArguments("String", "Boolean")) 1157Diagnostic(ERRID.ERR_ExpectedNext, "For Each item As String In collectionObject"), 1158Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next"), 1159Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub")) 1298ParseAndVerify(code, Diagnostic(ERRID.ERR_UnrecognizedType, ""), 1299Diagnostic(ERRID.ERR_UnrecognizedType, "")) 1343]]>, Diagnostic(ERRID.ERR_InvOutsideProc, "File:"), 1344Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "abc")) 1356Diagnostic(ERRID.ERR_MethodMustBeFirstStatementOnLine, "Sub sub1()"), 1357Diagnostic(ERRID.ERR_ExpectedDeclaration, "Unicode")) 1808ParseAndVerify(code, Diagnostic(ERRID.ERR_ExpectedEOS, "{")) 2027ParseAndVerify(code, Diagnostic(ERRID.ERR_ExpectedEndExternalSource, "#externalsource("""",2)")) 2037Diagnostic(ERRID.ERR_InvInsideInterface, "Declare Sub Goo Lib ""My""")) 2066Diagnostic(ERRID.ERR_MissingEndEnum, "Public Enum e"), 2067Diagnostic(ERRID.ERR_InvInsideEndsEnum, "Class Goo")) 2389Diagnostic(ERRID.ERR_ExpectedEndClass, "Class C1"), 2390Diagnostic(ERRID.ERR_UnrecognizedEnd, "End")) 2404Diagnostic(ERRID.ERR_EndProp, "Public Property strProperty() as string"), 2405Diagnostic(ERRID.ERR_UnrecognizedEnd, "End"), 2406Diagnostic(ERRID.ERR_InvalidEndProperty, "End Property")) 2430Diagnostic(ERRID.ERR_ExpectedEndRegion, "#Region ""Start""")) 2438Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "On 1 Goto 1000"), 2439Diagnostic(ERRID.ERR_ObsoleteOnGotoGosub, "")) 2759Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 2760Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 2761Diagnostic(ERRID.ERR_ExpectedIdentifier, "_")) 2816Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 2817Diagnostic(ERRID.ERR_ExpectedIdentifier, "_")) 2900Diagnostic(ERRID.ERR_InvInsideEnum, "if(true,3,4)").WithLocation(5, 21)) 2914Diagnostic(ERRID.ERR_InvInsideBlock, "Class Goo").WithArguments("If")) 2927Diagnostic(ERRID.ERR_InvInsideBlock, "Function Goo").WithArguments("Do Loop")) 2940Diagnostic(ERRID.ERR_InvInsideBlock, "Sub Goo").WithArguments("While")) 2957Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2958Diagnostic(ERRID.ERR_InvalidDate, "#8/13/2002 29:14:00 PM#"), 2959Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2960Diagnostic(ERRID.ERR_InvalidDate, "#23/04/2002#"), 2961Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2962Diagnostic(ERRID.ERR_InvalidDate, "#02/29/2009#")) 3793ParseAndVerify(code, Diagnostic(ERRID.ERR_UnrecognizedType, "").WithLocation(2, 50), 3794Diagnostic(ERRID.ERR_BadConstraintSyntax, "").WithLocation(2, 50)) 3820ParseAndVerify(code, Diagnostic(ERRID.ERR_TypeParamMissingCommaOrRParen, ""), 3821Diagnostic(ERRID.ERR_TypeParamMissingCommaOrRParen, ""), 3822Diagnostic(ERRID.ERR_TypeParamMissingCommaOrRParen, "T"), 3823Diagnostic(ERRID.ERR_TypeParamMissingCommaOrRParen, "Integer")) 3838]]>, Diagnostic(ERRID.ERR_UnknownOperator, "__"), 3839Diagnostic(ERRID.ERR_UnknownOperator, "")) 4001ParseAndVerify(code, Diagnostic(ERRID.ERR_ExpectedExpression, ""), 4002Diagnostic(ERRID.ERR_ExpectedExpression, ""), 4003Diagnostic(ERRID.ERR_ExpectedExpression, "")) 4019ParseAndVerify(code, Diagnostic(ERRID.ERR_ExpectedExpression, ""), 4020Diagnostic(ERRID.ERR_ExpectedExpression, ""), 4021Diagnostic(ERRID.ERR_ExpectedExpression, ""), 4022Diagnostic(ERRID.ERR_ExpectedExpression, "")) 4076Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Using stream As New IO.MemoryStream()"), 4077Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End Using"), 4078Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "End USING")) 4512Diagnostic(ERRID.ERR_OptionStmtWrongOrder, "option Compare Binary"), 4513Diagnostic(ERRID.ERR_OptionStmtWrongOrder, "option Explicit Off"), 4514Diagnostic(ERRID.ERR_OptionStmtWrongOrder, "option Strict off"), 4515Diagnostic(ERRID.ERR_ImportsMustBeFirst, "Imports VB6 = Microsoft.VisualBasic"), 4516Diagnostic(ERRID.ERR_ImportsMustBeFirst, "Imports Microsoft.VisualBasic"), 4517Diagnostic(ERRID.ERR_ExpectedSpecifier, "x"), 4518Diagnostic(ERRID.ERR_ExpectedDeclaration, "deflng"), 4519Diagnostic(ERRID.ERR_ImplementsStmtWrongOrder, "Implements I1"), 4520Diagnostic(ERRID.ERR_InheritsStmtWrongOrder, "Inherits c2"), 4521Diagnostic(ERRID.ERR_EndSubExpected, "Sub goo()")) 4578Diagnostic(ERRID.ERR_ExpectedEndClass, "class c1"), 4579Diagnostic(ERRID.ERR_UnrecognizedEnd, "end")).VerifyNoAdjacentTriviaHaveSameKind()
Parser\ParseExpression.vb (26)
1083Diagnostic(ERRID.ERR_SubRequiresSingleStatement, "sub () select case 0 : case 0 : end select")) 1108]]>, Diagnostic(ERRID.ERR_ExpectedExpression, "")) 1129Diagnostic(ERRID.ERR_ExpectedEndModule, "Module Module1"), 1130Diagnostic(ERRID.ERR_MultilineLambdaMissingFunction, "Function()")) 2053ParseAndVerify(code, Diagnostic(ERRID.ERR_ExpectedIn, ""), 2054Diagnostic(ERRID.ERR_ExpectedEOS, "Equals"), 2055Diagnostic(ERRID.ERR_ExpectedEOS, "Class")) 2071]]>, Diagnostic(ERRID.ERR_ExpectedEndOfExpression, "Sum")) 2086]]>, Diagnostic(ERRID.ERR_ExpectedIdentifier, "")) 2099ParseAndVerify(code, Diagnostic(ERRID.ERR_UnrecognizedTypeKeyword, "")) 2113ParseAndVerify(code, Diagnostic(ERRID.ERR_UnrecognizedType, ")"), 2114Diagnostic(ERRID.ERR_UnrecognizedType, ")"), 2115Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 2116Diagnostic(ERRID.ERR_UnrecognizedType, ")")) 2149Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 2150Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 2151Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 2152Diagnostic(ERRID.ERR_ExpectedXmlName, "Name"), 2153Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " ")) 2213Diagnostic(ERRID.ERR_UnrecognizedType, ""), 2214Diagnostic(ERRID.ERR_IllegalChar, "$"), 2215Diagnostic(ERRID.ERR_ExpectedInto, "")) 2230Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2231Diagnostic(ERRID.ERR_ExpectedOn, ""), 2232Diagnostic(ERRID.ERR_ExpectedInto, ""), 2233Diagnostic(ERRID.ERR_IllegalChar, "$"))
Parser\ParseImports.vb (6)
76Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 77Diagnostic(ERRID.ERR_ExpectedGreater, "") 86Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 87Diagnostic(ERRID.ERR_ExpectedGreater, "xml")) 95Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 96Diagnostic(ERRID.ERR_ExpectedGreater, "p"))
Parser\ParseLanguageVersionTests.vb (32)
28Diagnostic(ERRID.ERR_LanguageVersion, "Async").WithArguments("9.0", "async methods or lambdas", "11").WithLocation(3, 5), 29Diagnostic(ERRID.ERR_LanguageVersion, "Async").WithArguments("9.0", "async methods or lambdas", "11").WithLocation(7, 5)) 45Diagnostic(ERRID.ERR_LanguageVersion, "Iterator").WithArguments("9.0", "iterators", "11").WithLocation(3, 13), 46Diagnostic(ERRID.ERR_LanguageVersion, "Yield").WithArguments("9.0", "iterators", "11").WithLocation(4, 9), 47Diagnostic(ERRID.ERR_LanguageVersion, "Yield").WithArguments("9.0", "iterators", "11").WithLocation(5, 9), 48Diagnostic(ERRID.ERR_LanguageVersion, "Yield").WithArguments("9.0", "iterators", "11").WithLocation(6, 9)) 62Diagnostic(ERRID.ERR_LanguageVersion, "From").WithArguments("9.0", "collection initializers", "10").WithLocation(4, 51)) 76Diagnostic(ERRID.ERR_LanguageVersion, "Out").WithArguments("9.0", "variance", "10").WithLocation(2, 23), 77Diagnostic(ERRID.ERR_LanguageVersion, "In").WithArguments("9.0", "variance", "10").WithLocation(2, 30)) 100Diagnostic(ERRID.ERR_LanguageVersion, "Async").WithArguments("9.0", "async methods or lambdas", "11").WithLocation(3, 13)) 120Diagnostic(ERRID.ERR_LanguageVersion), 121Diagnostic(ERRID.ERR_LanguageVersion)) 142Diagnostic(ERRID.ERR_LanguageVersion, "Public Property Name As String").WithArguments("9.0", "auto-implemented properties", "10").WithLocation(3, 5), 143Diagnostic(ERRID.ERR_LanguageVersion, "Public Property Owner As String = ""DefaultName""").WithArguments("9.0", "auto-implemented properties", "10").WithLocation(4, 5)) 173Diagnostic(ERRID.ERR_LanguageVersion), 174Diagnostic(ERRID.ERR_LanguageVersion), 175Diagnostic(ERRID.ERR_LanguageVersion), 176Diagnostic(ERRID.ERR_LanguageVersion), 177Diagnostic(ERRID.ERR_LanguageVersion)) 203Diagnostic(ERRID.ERR_LanguageVersion), 204Diagnostic(ERRID.ERR_LanguageVersion)) 220Diagnostic(ERRID.ERR_LanguageVersion, "NameOf").WithArguments("9.0", "'nameof' expressions", "14").WithLocation(5, 41)) 236Diagnostic(ERRID.ERR_LanguageVersion, "?").WithArguments("9.0", "null conditional operations", "14").WithLocation(4, 31), 237Diagnostic(ERRID.ERR_LanguageVersion, "?").WithArguments("9.0", "null conditional operations", "14").WithLocation(5, 22)) 256Diagnostic(ERRID.ERR_LanguageVersion, "Global").WithArguments($"{CInt(version)}.0", "declaring a Global namespace", "11").WithLocation(4, 11)) 297Diagnostic(ERRID.ERR_LanguageVersion, "Global").WithArguments($"{CInt(version)}.0", "declaring a Global namespace", "11").WithLocation(4, 11)) 320Diagnostic(ERRID.ERR_LanguageVersion, "$""world""").WithArguments("12.0", "interpolated strings", "14").WithLocation(4, 18), 321Diagnostic(ERRID.ERR_LanguageVersion, "$""hello {x1}""").WithArguments("12.0", "interpolated strings", "14").WithLocation(5, 18)) 339Diagnostic(ERRID.ERR_LanguageVersion, "(1, 2)").WithArguments("14.0", "tuples", "15").WithLocation(4, 18), 340Diagnostic(ERRID.ERR_LanguageVersion, "(A:=1, B:=2)").WithArguments("14.0", "tuples", "15").WithLocation(5, 18)) 358Diagnostic(ERRID.ERR_LanguageVersion, "(Integer, Integer)").WithArguments("14.0", "tuples", "15").WithLocation(4, 19), 359Diagnostic(ERRID.ERR_LanguageVersion, "(A As Integer, B As Integer)").WithArguments("14.0", "tuples", "15").WithLocation(5, 19))
Parser\ParseMethods.vb (5)
153Diagnostic(ERRID.ERR_InvInsideInterface, "shared operator +(i as integer, j as integer) as integer"), 154Diagnostic(ERRID.ERR_InvInsideInterface, "return 0"), 155Diagnostic(ERRID.ERR_InvInsideInterface, "end operator")) 1058Diagnostic(ERRID.ERR_ExpectedNext, "For j = 1 To 10"), 1059Diagnostic(ERRID.ERR_ExtraNextVariable, "i"))
Parser\ParserRegressionTests.vb (1)
762tree.GetDiagnostics().VerifyErrorCodes(Diagnostic(ERRID.ERR_BinaryFile))
Parser\ParseStatements.vb (137)
380Diagnostic(ERRID.ERR_ExpectedEOS, "ElseIf True Then").WithLocation(4, 18), 381Diagnostic(ERRID.ERR_ExpectedEOS, "x").WithLocation(4, 35), 382Diagnostic(ERRID.ERR_ExpectedEOS, "elseIf").WithLocation(5, 24) 407Diagnostic(ERRID.ERR_LineContWithCommentOrNoPrecSpace, "_")) 672]]>, Diagnostic(ERRID.ERR_ExpectedEndIf, "If True Then")) 848]]>, Diagnostic(ERRID.ERR_ExpectedComma, ""), 849Diagnostic(ERRID.ERR_ExpectedExpression, "") 866]]>, Diagnostic(ERRID.ERR_ExpectedComma, ""), 867Diagnostic(ERRID.ERR_ExpectedExpression, ""), 868Diagnostic(ERRID.ERR_ExpectedEQ, ""), 869Diagnostic(ERRID.ERR_ExpectedExpression, "") 882]]>, Diagnostic(ERRID.ERR_ExpectedExpression, ""), 883Diagnostic(ERRID.ERR_ExpectedEQ, ""), 884Diagnostic(ERRID.ERR_ExpectedExpression, "") 896]]>, Diagnostic(ERRID.ERR_ExpectedExpression, ""), 897Diagnostic(ERRID.ERR_ExpectedRparen, ""), 898Diagnostic(ERRID.ERR_ExpectedEQ, ""), 899Diagnostic(ERRID.ERR_ExpectedExpression, "") 2008Diagnostic(ERRID.ERR_NextNoMatchingFor, "Next.goo(GetType(Func(Of A))), """""), 2009Diagnostic(ERRID.ERR_ExtraNextVariable, ".goo(GetType(Func(Of A)))")) 2311]]>, Diagnostic(ERRID.ERR_ExpectedIn, ""), 2312Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "In"), 2313Diagnostic(ERRID.ERR_ExpectedIn, "")) 2328End Module]]>, Diagnostic(ERRID.ERR_Syntax, "100")) 3397]]>, Diagnostic(ERRID.ERR_CantCombineInitializers, "FROM {2,3}"), 3398Diagnostic(ERRID.ERR_CantCombineInitializers, "with"), 3399Diagnostic(ERRID.ERR_CantCombineInitializers, "From"), 3400Diagnostic(ERRID.ERR_CantCombineInitializers, "From {""Hello World!""}"), 3401Diagnostic(ERRID.ERR_CantCombineInitializers, "with {.a = ""goo""}")) 3419Diagnostic(ERRID.ERR_ObsoleteLetSetNotNeeded, "Let"), 3420Diagnostic(ERRID.ERR_UnrecognizedEnd, "End"), 3421Diagnostic(ERRID.ERR_ExpectedDeclaration, "Get"), 3422Diagnostic(ERRID.ERR_InvalidEndGet, "End Get"), 3423Diagnostic(ERRID.ERR_ExpectedDeclaration, "Set"), 3424Diagnostic(ERRID.ERR_InvalidEndSet, "End Set"), 3425Diagnostic(ERRID.ERR_InvalidEndProperty, "End Property")) 3439]]>, Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, Environment.NewLine), 3440Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " ")) 3456Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 3457Diagnostic(ERRID.ERR_ExpectedGreater, "xmlns"), 3458Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 3459Diagnostic(ERRID.ERR_ExpectedGreater, "xmlns"), 3460Diagnostic(ERRID.ERR_ExpectedXmlName, "ns5"), 3461Diagnostic(ERRID.ERR_ExpectedXmlns, ""), 3462Diagnostic(ERRID.ERR_ExpectedGreater, "xmlns")) 3523Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "If VarType(a1.GetValue(x)) > Variant"), 3524Diagnostic(ERRID.ERR_ObsoleteObjectNotVariant, "Variant")) 3689]]>, Diagnostic(ERRID.ERR_ExpectedEndIf, "If True"), 3690Diagnostic(ERRID.ERR_BogusWithinLineIf, "End If"), 3691Diagnostic(ERRID.ERR_ExpectedEndIf, "If True"), 3692Diagnostic(ERRID.ERR_BogusWithinLineIf, "End If") 3732Diagnostic(ERRID.ERR_InvOutsideProc, "100:"), 3733Diagnostic(ERRID.ERR_InvOutsideProc, "200:"), 3734Diagnostic(ERRID.ERR_InvOutsideProc, "300:"), 3735Diagnostic(ERRID.ERR_InvInsideEnum, "300:")) 3940]]>, Diagnostic(ERRID.ERR_ExpectedEndClass, "Class C1").WithLocation(2, 13), 3941Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Namespace").WithLocation(19, 33), 3942Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Class").WithLocation(20, 33), 3943Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "End").WithLocation(21, 23), 3944Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Namespace").WithLocation(25, 25), 3945Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "Class").WithLocation(26, 25), 3946Diagnostic(ERRID.ERR_InvalidUseOfKeyword, "End").WithLocation(27, 27), 3947Diagnostic(ERRID.ERR_NamespaceNotAtNamespace, "namespace").WithLocation(31, 21), 3948Diagnostic(ERRID.ERR_SpecifiersInvalidOnInheritsImplOpt, "dim").WithLocation(31, 17), 3949Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(31, 30), 3950Diagnostic(ERRID.ERR_EndClassNoClass, "End Class").WithLocation(37, 13), 3951Diagnostic(ERRID.ERR_SpecifiersInvalidOnInheritsImplOpt, "dim").WithLocation(40, 13), 3952Diagnostic(ERRID.ERR_ExpectedIdentifier, "").WithLocation(40, 26)) 4041Diagnostic(ERRID.ERR_ExpectedEndTry, "try"), 4042Diagnostic(ERRID.ERR_FinallyNoMatchingTry, "finally"), 4043Diagnostic(ERRID.ERR_EndTryNoTry, "end try"), 4044Diagnostic(ERRID.ERR_ExpectedEndSelect, "select case true"), 4045Diagnostic(ERRID.ERR_ExpectedCase, ""), 4046Diagnostic(ERRID.ERR_EndSelectNoSelect, "end select"), 4047Diagnostic(ERRID.ERR_ExpectedEndUsing, "using resource As New Object()"), 4048Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "end using"), 4049Diagnostic(ERRID.ERR_ExpectedEndWhile, "while true"), 4050Diagnostic(ERRID.ERR_EndWhileNoWhile, "end while"), 4051Diagnostic(ERRID.ERR_ExpectedLoop, "do while true"), 4052Diagnostic(ERRID.ERR_LoopNoMatchingDo, "loop"), 4053Diagnostic(ERRID.ERR_ExpectedEndWith, "with nothing"), 4054Diagnostic(ERRID.ERR_EndWithWithoutWith, "end with"), 4055Diagnostic(ERRID.ERR_ExpectedNext, "for each x as object in nothing"), 4056Diagnostic(ERRID.ERR_NextNoMatchingFor, "next"), 4057Diagnostic(ERRID.ERR_ExpectedNext, "for x as object = 1 to 12"), 4058Diagnostic(ERRID.ERR_NextNoMatchingFor, "next"), 4059Diagnostic(ERRID.ERR_ExpectedEndIf, "if true"), 4060Diagnostic(ERRID.ERR_EndIfNoMatchingIf, "end if"), 4061Diagnostic(ERRID.ERR_ExpectedEndSyncLock, "synclock new Object()"), 4062Diagnostic(ERRID.ERR_EndSyncLockNoSyncLock, "end synclock"), 4063Diagnostic(ERRID.ERR_ExpectedEndTry, "try"), 4064Diagnostic(ERRID.ERR_FinallyNoMatchingTry, "finally"), 4065Diagnostic(ERRID.ERR_EndTryNoTry, "end try"), 4066Diagnostic(ERRID.ERR_ExpectedEndSelect, "select case true"), 4067Diagnostic(ERRID.ERR_ExpectedCase, ""), 4068Diagnostic(ERRID.ERR_EndSelectNoSelect, "end select"), 4069Diagnostic(ERRID.ERR_ExpectedEndUsing, "using resource As New Object()"), 4070Diagnostic(ERRID.ERR_EndUsingWithoutUsing, "end using"), 4071Diagnostic(ERRID.ERR_ExpectedEndWhile, "while true"), 4072Diagnostic(ERRID.ERR_EndWhileNoWhile, "end while"), 4073Diagnostic(ERRID.ERR_ExpectedLoop, "do while true"), 4074Diagnostic(ERRID.ERR_LoopNoMatchingDo, "loop"), 4075Diagnostic(ERRID.ERR_ExpectedEndWith, "with nothing"), 4076Diagnostic(ERRID.ERR_EndWithWithoutWith, "end with"), 4077Diagnostic(ERRID.ERR_ExpectedNext, "for each x as object in nothing"), 4078Diagnostic(ERRID.ERR_NextNoMatchingFor, "next"), 4079Diagnostic(ERRID.ERR_ExpectedNext, "for x as object = 1 to 12"), 4080Diagnostic(ERRID.ERR_NextNoMatchingFor, "next"), 4081Diagnostic(ERRID.ERR_ExpectedEndIf, "if true"), 4082Diagnostic(ERRID.ERR_EndIfNoMatchingIf, "end if"), 4083Diagnostic(ERRID.ERR_ExpectedEndSyncLock, "synclock new Object()"), 4084Diagnostic(ERRID.ERR_EndSyncLockNoSyncLock, "end synclock")) 4095Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "else if "), 4096Diagnostic(ERRID.ERR_ExpectedExpression, "")) 4105]]>, Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Catch ex As Exception"), 4106Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Finally")) 4119]]>, Diagnostic(ERRID.ERR_ExpectedEOS, "Main"), 4120Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "Try"), 4121Diagnostic(ERRID.ERR_EndTryNoTry, "End Try"), 4122Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub")) 4144compilation.VerifyDiagnostics(Diagnostic(ERRID.ERR_ExpectedNext, "For j = 1 To 10"), 4145Diagnostic(ERRID.ERR_ExtraNextVariable, "i"), 4146Diagnostic(ERRID.ERR_NameNotDeclared1, "j").WithArguments("j")) 4766Diagnostic(ERRID.ERR_SubRequiresSingleStatement, "Sub() "), 4767Diagnostic(ERRID.ERR_InvalidEndSub, "End Sub")) 6288Diagnostic(ERRID.ERR_Syntax, "5").WithLocation(4, 22) 6513Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 6514Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 6515Diagnostic(ERRID.ERR_ExpectedIdentifier, "_"), 6516Diagnostic(ERRID.ERR_ExpectedIdentifier, "_")) 6873Diagnostic(ERRID.ERR_ExpectedEOS, "Else").WithLocation(4, 60)) 8169Diagnostic(ERRID.ERR_InvInsideProc, "Implements I").WithLocation(3, 37)) 8310Diagnostic(ERRID.ERR_InvInsideEndsProc, "<A> Property P").WithLocation(3, 37)) 8422Diagnostic(ERRID.ERR_LineContWithCommentOrNoPrecSpace, "_").WithLocation(4, 1) 8439Diagnostic(ERRID.ERR_LineContWithCommentOrNoPrecSpace, "_").WithLocation(6, 1) 8500Diagnostic(ERRID.ERR_CommentsAfterLineContinuationNotAvailable1, "' Comment").WithLocation(4, 36).WithArguments("16") 8516Diagnostic(ERRID.ERR_CommentsAfterLineContinuationNotAvailable1, "' Comment").WithLocation(4, 36).WithArguments("16")
Parser\ParseVarDecl.vb (24)
269]]>, Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 270Diagnostic(ERRID.ERR_MissingEndBrack, "[goo"), 271Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 272Diagnostic(ERRID.ERR_MissingEndBrack, "[goo"), 273Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 274Diagnostic(ERRID.ERR_ExpectedIdentifier, "["), 275Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 276Diagnostic(ERRID.ERR_ExpectedIdentifier, "["), 277Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 278Diagnostic(ERRID.ERR_ExpectedIdentifier, "[]"), 279Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 280Diagnostic(ERRID.ERR_ExpectedIdentifier, "[]"), 281Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 282Diagnostic(ERRID.ERR_ExpectedIdentifier, "["), 283Diagnostic(ERRID.ERR_IllegalChar, "$"), 284Diagnostic(ERRID.ERR_IllegalChar, "]"), 285Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 286Diagnostic(ERRID.ERR_ExpectedIdentifier, "["), 287Diagnostic(ERRID.ERR_IllegalChar, "%"), 288Diagnostic(ERRID.ERR_IllegalChar, "]"), 289Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 290Diagnostic(ERRID.ERR_ExpectedIdentifier, "["), 291Diagnostic(ERRID.ERR_ExpectedIdentifier, "[]"), 292Diagnostic(ERRID.ERR_IllegalChar, "]"))
Parser\ParseXml.vb (77)
64Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, Environment.NewLine), 65Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 66Diagnostic(ERRID.ERR_ExpectedXmlName, "x")) 119Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, Environment.NewLine), 120Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 121Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 122Diagnostic(ERRID.ERR_ExecutableAsDeclaration, "VB")) 145Diagnostic(ERRID.ERR_ExpectedXmlWhiteSpace, "c")) 156Diagnostic(ERRID.ERR_ExpectedXmlWhiteSpace, "a")) 449Diagnostic(ERRID.ERR_ExpectedIdentifier, ""), 450Diagnostic(ERRID.ERR_ExpectedIdentifier, "")) 1074Diagnostic(ERRID.ERR_ExpectedEndNamespace, "Namespace DynLateSetLHS010"), 1075Diagnostic(ERRID.ERR_ExpectedEndModule, "Friend Module DynLateSetLHS010mod"), 1076Diagnostic(ERRID.ERR_EndSubExpected, "Sub DynLateSetLHS010()"), 1077Diagnostic(ERRID.ERR_ExpectedExpression, ""), 1078Diagnostic(ERRID.ERR_LineContWithCommentOrNoPrecSpace, "_"), 1079Diagnostic(ERRID.ERR_StandaloneAttribute, ""), 1080Diagnostic(ERRID.ERR_LocalsCannotHaveAttributes, "<name1>"), 1081Diagnostic(ERRID.ERR_ExpectedIdentifier, "")) 1174Diagnostic(ERRID.ERR_EmbeddedExpression, "<%="), 1175Diagnostic(ERRID.ERR_ExpectedExpression, ""), 1176Diagnostic(ERRID.ERR_ExpectedXmlEndEmbedded, "")) 1356]]>, Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1357Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, Environment.NewLine), 1358Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1359Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1360Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1361Diagnostic(ERRID.ERR_ExpectedXmlName, "b"), 1362Diagnostic(ERRID.ERR_ExpectedXmlName, ""), 1363Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1364Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1365Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1366Diagnostic(ERRID.ERR_ExpectedXmlName, "b"), 1367Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1368Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " "), 1369Diagnostic(ERRID.ERR_ExpectedXmlName, "c")) 1639Diagnostic(ERRID.ERR_FullWidthAsXmlDelimiter, "<"), 1640Diagnostic(ERRID.ERR_FullWidthAsXmlDelimiter, "<"), 1641Diagnostic(ERRID.ERR_FullWidthAsXmlDelimiter, "<")) 1929Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, "< /"), 1930Diagnostic(ERRID.ERR_ExpectedLT, "")) 1954Diagnostic(ERRID.WRN_XMLDocParseError1, "</").WithArguments("XML end element must be preceded by a matching start element."), 1955Diagnostic(ERRID.WRN_XMLDocParseError1, "").WithArguments("'>' expected.")) 1998Diagnostic(ERRID.ERR_ExpectedEndModule, "Module M"), 1999Diagnostic(ERRID.ERR_MissingXmlEndTag, <![CDATA[<<%= x + 2002Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2003Diagnostic(ERRID.ERR_Syntax, "Return"), 2004Diagnostic(ERRID.ERR_ExpectedXmlEndEmbedded, ""), 2005Diagnostic(ERRID.ERR_IllegalXmlStartNameChar, "%").WithArguments("%", "&H25"), 2006Diagnostic(ERRID.ERR_ExpectedEQ, ""), 2007Diagnostic(ERRID.ERR_ExpectedLT, ""), 2008Diagnostic(ERRID.ERR_ExpectedGreater, "")) 2014Diagnostic(ERRID.ERR_ExpectedEndModule, "Module M"), 2015Diagnostic(ERRID.ERR_MissingXmlEndTag, <![CDATA[<<%= x + 2017Diagnostic(ERRID.ERR_ExpectedExpression, ""), 2018Diagnostic(ERRID.ERR_Syntax, "Return"), 2019Diagnostic(ERRID.ERR_ExpectedXmlEndEmbedded, ""), 2020Diagnostic(ERRID.ERR_ExpectedGreater, ":"), 2021Diagnostic(ERRID.ERR_IllegalXmlStartNameChar, "%").WithArguments("%", "&H25"), 2022Diagnostic(ERRID.ERR_ExpectedLT, ""), 2023Diagnostic(ERRID.ERR_ExpectedGreater, "")) 2355Diagnostic(ERRID.ERR_FullWidthAsXmlDelimiter, "<")) 3528Diagnostic(ERRID.ERR_ExpectedEndModule, "Module M"), 3529Diagnostic(ERRID.ERR_IllegalXmlWhiteSpace, " 3531Diagnostic(ERRID.ERR_ExpectedXmlName, "y"), 3532Diagnostic(ERRID.ERR_ExpectedQuote, ""), 3533Diagnostic(ERRID.ERR_ExpectedLT, ""), 3534Diagnostic(ERRID.ERR_ExpectedGreater, "") 3538tree1.GetDiagnostics().Verify(commonExpectedErrors.Concat({Diagnostic(ERRID.ERR_MissingXmlEndTag, String.Format(squiggleTemplate, "e"))}).ToArray()) 3541tree2.GetDiagnostics().Verify(commonExpectedErrors.Concat({Diagnostic(ERRID.ERR_MissingXmlEndTag, String.Format(squiggleTemplate, "ee"))}).ToArray()) 4405Diagnostic(ERRID.ERR_ExpectedXmlName, "@").WithLocation(4, 22)) 4413Diagnostic(ERRID.ERR_ExpectedXmlName, "@").WithLocation(4, 22)) 4421Diagnostic(ERRID.ERR_ExpectedXmlName, "").WithLocation(4, 27)) 4429Diagnostic(ERRID.ERR_ExpectedXmlName, "").WithLocation(4, 27)) 4533Diagnostic(ERRID.ERR_ExpectedDeclaration, "Distinct")) 4562Diagnostic(ERRID.ERR_ExpectedDeclaration, "Distinct")) 4575Diagnostic(ERRID.ERR_Syntax, "Then"))
Parser\VisualBasicParseOptionsTests.vb (13)
269options.Errors.Verify(Diagnostic(ERRID.ERR_BadSourceCodeKind).WithArguments("Interactive").WithLocation(1, 1)) 275options.Errors.Verify(Diagnostic(ERRID.ERR_BadSourceCodeKind).WithArguments("-2147483648").WithLocation(1, 1)) 316options.Errors.Verify(Diagnostic(ERRID.ERR_BadSourceCodeKind).WithArguments("Interactive").WithLocation(1, 1)) 323options.Errors.Verify(Diagnostic(ERRID.ERR_BadDocumentationMode).WithArguments("100").WithLocation(1, 1)) 330options.Errors.Verify(Diagnostic(ERRID.ERR_BadLanguageVersion).WithArguments("10000").WithLocation(1, 1)) 340options.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "1").WithLocation(1, 1)) 349options.Errors.Verify(Diagnostic(ERRID.ERR_BadSourceCodeKind).WithArguments("Interactive").WithLocation(1, 1)) 356options.Errors.Verify(Diagnostic(ERRID.ERR_BadDocumentationMode).WithArguments("100").WithLocation(1, 1)) 363options.Errors.Verify(Diagnostic(ERRID.ERR_BadLanguageVersion).WithArguments("10000").WithLocation(1, 1)) 372options.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "").WithLocation(1, 1)) 381options.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", " ").WithLocation(1, 1)) 391options.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "Bad.Symbol").WithLocation(1, 1)) 401options.Errors.Verify(Diagnostic(ERRID.ERR_ConditionalCompilationConstantNotValid).WithArguments("Identifier expected.", "Bad\\Symbol").WithLocation(1, 1))
Scanner\ScannerTests.vb (1)
2035Diagnostic(ERRID.ERR_BadCCExpression, "<!--"))
TestSyntaxNodes.vb (7)
931Private Function CompareDiagnostics(err1 As Diagnostic, err2 As Diagnostic) As Integer 943Dim errorList As New List(Of Diagnostic) 965Dim errorList As New List(Of Diagnostic) 2114Diagnostic(ERRID.ERR_ExpectedEOS, "#").WithLocation(2, 15)) 3310Diagnostic(ERRID.ERR_ModuleCantInherit, "Inherits aaa"), 3311Diagnostic(ERRID.ERR_ModuleCantImplement, "Implements Ifoo"))
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (19)
BasicTestBase.vb (1)
912Public Shared Function GetAssertTheseDiagnosticsString(allDiagnostics As ImmutableArray(Of Diagnostic), suppressInfos As Boolean) As String
CompilationTestUtils.vb (11)
740Private Sub AssertNoDiagnostics(diags As ImmutableArray(Of Diagnostic), suppressInfos As Boolean) 762Public Sub AssertNoErrors(errors As ImmutableArray(Of Diagnostic)) 763Dim diags As ImmutableArray(Of Diagnostic) = errors.WhereAsArray(Function(e) e.Severity = DiagnosticSeverity.Error) 867Public Sub AssertTheseDiagnostics(errors As ImmutableArray(Of Diagnostic), errs As XElement, Optional suppressInfos As Boolean = True) 876Public Sub AssertTheseDiagnostics(errors As ImmutableArray(Of Diagnostic), errs As XCData, Optional suppressInfos As Boolean = True) 881Private Sub AssertTheseDiagnostics(errors As ImmutableArray(Of Diagnostic), expectedText As String, suppressInfos As Boolean) 970Public Sub New(diagnostic As Diagnostic, index As Integer) 974Public ReadOnly Diagnostic As Diagnostic 978Private Function DumpAllDiagnostics(allDiagnostics As Diagnostic(), suppressInfos As Boolean) As String 982Friend Function DumpAllDiagnostics(allDiagnostics As ImmutableArray(Of Diagnostic), suppressInfos As Boolean) As String 1004Private Function ErrorText(e As Diagnostic) As String
DiagnosticExtensions.vb (1)
23Friend Function GetDiagnosticsForSyntaxTree(c As VisualBasicCompilation, stage As CompilationStage, tree As SyntaxTree, Optional filterSpan As TextSpan? = Nothing) As ImmutableArray(Of Diagnostic)
ParserTestUtilities.vb (6)
462Public Function ToXml(errors As IEnumerable(Of Diagnostic)) As XElement 473Public Function GetSyntaxErrorsNoTree(t As SyntaxToken) As IEnumerable(Of Diagnostic) 478Public Function GetSyntaxErrorsNoTree(n As SyntaxNode) As IEnumerable(Of Diagnostic) 562Friend Sub AppendSyntaxErrors(errors As IEnumerable(Of Diagnostic), output As StringBuilder) 598Private Function AreErrorsEquivalent(syntaxError As Diagnostic, xmlError As XElement) As Boolean 635Dim unmatchedErrorList As New List(Of Diagnostic)(tree.GetDiagnostics(node))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeCleanup\Providers\ReduceTokensCodeCleanupProvider.vb (2)
330Private Shared Function HasOverflow(diagnostics As IEnumerable(Of Diagnostic)) As Boolean 331Return diagnostics.Any(Function(diagnostic As Diagnostic) diagnostic.Id = "BC30036")
Workspace\LanguageServices\VisualBasicSyntaxTreeFactoryService.vb (1)
43Dim diagnostics As IEnumerable(Of Diagnostic) = Nothing
Microsoft.CodeAnalysis.Workspaces (180)
CodeFixes\CodeFix.cs (7)
17/// <see cref="Diagnostic"/>s that this <see cref="CodeAction"/> will fix. 23internal readonly ImmutableArray<Diagnostic> Diagnostics; 37/// cref="CodeFixContext.RegisterCodeFix(CodeAction, IEnumerable{Diagnostic})"/>). This could change 41internal Diagnostic PrimaryDiagnostic => Diagnostics[0]; 43internal CodeFix(Project project, CodeAction action, Diagnostic diagnostic) 50internal CodeFix(Project project, CodeAction action, ImmutableArray<Diagnostic> diagnostics) 60var diagnostic = PrimaryDiagnostic;
CodeFixes\CodeFixContext.cs (18)
21private readonly Action<CodeAction, ImmutableArray<Diagnostic>> _registerCodeFix; 60public ImmutableArray<Diagnostic> Diagnostics { get; } 75/// Additionally, the <see cref="Diagnostic.Id"/> of each diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 88ImmutableArray<Diagnostic> diagnostics, 89Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 107/// Additionally, the <see cref="Diagnostic.Id"/> of each diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 119ImmutableArray<Diagnostic> diagnostics, 120Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 138/// The <see cref="Diagnostic.Id"/> of this diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 146Diagnostic diagnostic, 147Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 163/// The <see cref="Diagnostic.Id"/> of this diagnostic must be in the set of the <see cref="CodeFixProvider.FixableDiagnosticIds"/> of the associated <see cref="CodeFixProvider"/>. 170Diagnostic diagnostic, 171Action<CodeAction, ImmutableArray<Diagnostic>> registerCodeFix, 186public void RegisterCodeFix(CodeAction action, Diagnostic diagnostic) 206public void RegisterCodeFix(CodeAction action, IEnumerable<Diagnostic> diagnostics) 221public void RegisterCodeFix(CodeAction action, ImmutableArray<Diagnostic> diagnostics) 238private static void VerifyDiagnosticsArgument(ImmutableArray<Diagnostic> diagnostics, TextSpan span)
CodeFixes\CodeFixProvider.cs (1)
30/// The context must only contain diagnostics with a <see cref="Diagnostic.Id"/> included in the <see cref="FixableDiagnosticIds"/> for the current provider.
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (5)
87private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> DetermineDiagnosticsAsync(FixAllContext fixAllContext, IProgress<CodeAnalysisProgress> progressTracker) 111ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentToDiagnostics) 138FixAllContext fixAllContext, ImmutableArray<Diagnostic> orderedDiagnostics) 146foreach (var diagnostic in orderedDiagnostics) 230private static Action<CodeAction, ImmutableArray<Diagnostic>> GetRegisterCodeFixAction(
CodeFixes\FixAllOccurrences\DocumentBasedFixAllProvider.cs (3)
20/// cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 26/// cref="FixAllAsync(FixAllContext, Document, ImmutableArray{Diagnostic})"/> for implementors to process. 58protected abstract Task<Document?> FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray<Diagnostic> diagnostics);
CodeFixes\FixAllOccurrences\FixAllContext.cs (9)
225public async Task<ImmutableArray<Diagnostic>> GetDocumentDiagnosticsAsync(Document document) 241private static async Task<ImmutableArray<Diagnostic>> GetFilteredDiagnosticsAsync( 242Task<IEnumerable<Diagnostic>> getDiagnosticsTask, 262internal async Task<ImmutableArray<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan filterSpan) 283public Task<ImmutableArray<Diagnostic>> GetProjectDiagnosticsAsync(Project project) 297public Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsAsync(Project project) 312private async Task<ImmutableArray<Diagnostic>> GetProjectDiagnosticsAsync(Project project, bool includeAllDocumentDiagnostics) 347internal Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync() 350internal Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync()
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (9)
30public abstract Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken); 35public abstract Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken); 41public abstract Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken); 43internal static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(FixAllContext fixAllContext) 50static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixWorkerAsync(FixAllContext fixAllContext) 67internal static async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync( 85return await ProducerConsumer<(Project project, ImmutableArray<Diagnostic> diagnostics)>.RunParallelAsync( 94var projectsAndDiagnostics = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 109return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty;
CodeFixes\FixAllOccurrences\FixAllContext.SpanBasedDiagnosticProvider.cs (1)
34public abstract Task<IEnumerable<Diagnostic>> GetDocumentSpanDiagnosticsAsync(Document document, TextSpan fixAllSpan, CancellationToken cancellationToken);
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (11)
21public static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 26var allDiagnostics = ImmutableArray<Diagnostic>.Empty; 40return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty.SetItem(document, documentDiagnostics); 76allDiagnostics = await ProducerConsumer<ImmutableArray<Diagnostic>>.RunParallelAsync( 86using var _2 = ArrayBuilder<Diagnostic>.GetInstance(out var builder); 102return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 108static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetSpanDiagnosticsAsync( 112var builder = PooledDictionary<Document, ArrayBuilder<Diagnostic>>.GetInstance(); 126private static async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync( 128ImmutableArray<Diagnostic> diagnostics, 131var builder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>();
CodeFixes\FixAllOccurrences\FixAllProvider.cs (6)
49/// <see cref="WellKnownFixAllProviders.BatchFixer"/> in the case where fixes for a <see cref="Diagnostic"/> 58public static FixAllProvider Create(Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync) 64/// fixes for a <see cref="Diagnostic"/> only affect the <see cref="Document"/> the diagnostic was produced in. 78Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 99Func<FixAllContext, Document, ImmutableArray<Diagnostic>, Task<Document?>> fixAllAsync, 102protected override Task<Document?> FixAllAsync(FixAllContext context, Document document, ImmutableArray<Diagnostic> diagnostics)
CodeFixes\FixAllOccurrences\FixAllState.cs (4)
65ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsToFix, 87ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsToFix, 106private static ImmutableHashSet<string> GetDiagnosticsIds(IEnumerable<ImmutableArray<Diagnostic>> diagnosticsCollection) 111foreach (var diagnostic in diagnostics)
CodeFixes\FixAllOccurrences\FixAllState.FixMultipleDiagnosticProvider.cs (16)
21public ImmutableDictionary<Document, ImmutableArray<Diagnostic>> DocumentDiagnosticsMap { get; } 22public ImmutableDictionary<Project, ImmutableArray<Diagnostic>> ProjectDiagnosticsMap { get; } 24public FixMultipleDiagnosticProvider(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> diagnosticsMap) 27ProjectDiagnosticsMap = ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 30public FixMultipleDiagnosticProvider(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> diagnosticsMap) 33DocumentDiagnosticsMap = ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 36public override Task<IEnumerable<Diagnostic>> GetAllDiagnosticsAsync(Project project, CancellationToken cancellationToken) 38var allDiagnosticsBuilder = ArrayBuilder<Diagnostic>.GetInstance(); 39ImmutableArray<Diagnostic> diagnostics; 56return Task.FromResult<IEnumerable<Diagnostic>>(allDiagnosticsBuilder.ToImmutableAndFree()); 59public override Task<IEnumerable<Diagnostic>> GetDocumentDiagnosticsAsync(Document document, CancellationToken cancellationToken) 63return Task.FromResult<IEnumerable<Diagnostic>>(diagnostics); 66return SpecializedTasks.EmptyEnumerable<Diagnostic>(); 69public override Task<IEnumerable<Diagnostic>> GetProjectDiagnosticsAsync(Project project, CancellationToken cancellationToken) 73return Task.FromResult<IEnumerable<Diagnostic>>(diagnostics); 76return SpecializedTasks.EmptyEnumerable<Diagnostic>();
CodeFixes\Supression\IConfigurationFixProvider.cs (3)
22bool IsFixableDiagnostic(Diagnostic diagnostic); 28Task<ImmutableArray<CodeFix>> GetFixesAsync(TextDocument document, TextSpan span, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken); 34Task<ImmutableArray<CodeFix>> GetFixesAsync(Project project, IEnumerable<Diagnostic> diagnostics, CancellationToken cancellationToken);
CodeFixesAndRefactorings\FixAllLogger.cs (2)
156public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentsAndDiagnosticsToFixMap) 166public static void LogDiagnosticsStats(int correlationId, ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectsAndDiagnosticsToFixMap)
CodeFixesAndRefactorings\FixAllProviderInfo.cs (4)
113public abstract bool CanBeFixed(Diagnostic diagnostic); 120public override bool CanBeFixed(Diagnostic diagnostic) 129private readonly Func<Diagnostic, bool> _canBeSuppressedOrUnsuppressed = suppressionFixer.IsFixableDiagnostic; 131public override bool CanBeFixed(Diagnostic diagnostic)
Diagnostics\AbstractDiagnosticPropertiesService.cs (2)
13public ImmutableDictionary<string, string> GetAdditionalProperties(Diagnostic diagnostic) 19Diagnostic diagnostic,
Diagnostics\DiagnosticAnalysisResultBuilder.cs (12)
38public void AddExternalSyntaxDiagnostics(DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 43public void AddExternalSemanticDiagnostics(DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 52ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, DocumentId documentId, IEnumerable<Diagnostic> diagnostics) 54foreach (var diagnostic in diagnostics) 97private void AddDocumentDiagnostic(ref Dictionary<DocumentId, List<DiagnosticData>>? map, TextDocument? document, Diagnostic diagnostic) 117public void AddSyntaxDiagnostics(SyntaxTree tree, IEnumerable<Diagnostic> diagnostics) 120public void AddDiagnosticTreatedAsLocalSemantic(Diagnostic diagnostic) 123public void AddSemanticDiagnostics(SyntaxTree tree, IEnumerable<Diagnostic> diagnostics) 126public void AddCompilationDiagnostics(IEnumerable<Diagnostic> diagnostics) 136ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, Diagnostic diagnostic) 189ref Dictionary<DocumentId, List<DiagnosticData>>? lazyLocals, SyntaxTree? tree, IEnumerable<Diagnostic> diagnostics) 191foreach (var diagnostic in diagnostics)
Diagnostics\DiagnosticData.cs (10)
149public async Task<Diagnostic> ToDiagnosticAsync(Project project, CancellationToken cancellationToken) 157public Diagnostic ToDiagnostic(Location location, ImmutableArray<Location> additionalLocations) 159return Diagnostic.Create( 189public static DiagnosticData Create(Solution solution, Diagnostic diagnostic, Project? project) 194public static DiagnosticData Create(Diagnostic diagnostic, TextDocument document) 221Diagnostic diagnostic, 248private static ImmutableDictionary<string, string?>? GetAdditionalProperties(TextDocument document, Diagnostic diagnostic) 254private static ImmutableArray<DiagnosticDataLocation> GetAdditionalLocations(TextDocument document, Diagnostic diagnostic) 305var diagnostic = Diagnostic.Create(descriptor, Location.None, effectiveSeverity, additionalLocations: null, properties: null, messageArgs: messageArguments);
Diagnostics\DocumentDiagnosticAnalyzer.cs (2)
20public abstract Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken); 22public abstract Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken);
Diagnostics\Extensions.cs (14)
24public static async Task<ImmutableArray<Diagnostic>> ToDiagnosticsAsync(this IEnumerable<DiagnosticData> diagnostics, Project project, CancellationToken cancellationToken) 26var result = ArrayBuilder<Diagnostic>.GetInstance(); 103ImmutableArray<Diagnostic> additionalPragmaSuppressionDiagnostics, 148ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>>? diagnosticsByAnalyzerMap; 239ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnosticsByAnalyzer, 257ImmutableArray<Diagnostic> diagnostics, 308public static ImmutableArray<Diagnostic> Filter( 309this ImmutableArray<Diagnostic> diagnostics, 325public static async Task<(AnalysisResult? projectAnalysisResult, AnalysisResult? hostAnalysisResult, ImmutableArray<Diagnostic> additionalDiagnostics)> GetAnalysisResultAsync( 373private static async Task<ImmutableArray<Diagnostic>> GetPragmaSuppressionAnalyzerDiagnosticsAsync( 392using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder); 402return await ProducerConsumer<Diagnostic>.RunParallelAsync( 416using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder); 434Action<Diagnostic> reportDiagnostic,
Diagnostics\IDiagnosticPropertiesService.cs (1)
14ImmutableDictionary<string, string> GetAdditionalProperties(Diagnostic diagnostic);
Diagnostics\ProjectDiagnosticAnalyzer.cs (1)
20public abstract Task<ImmutableArray<Diagnostic>> AnalyzeProjectAsync(Project project, CancellationToken cancellationToken);
Shared\Extensions\TelemetryExtensions.cs (1)
53public static string GetTelemetryDiagnosticID(this Diagnostic diagnostic)
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
11internal static bool HasAnyErrors<T>(this ImmutableArray<T> diagnostics) where T : Diagnostic
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
27Action<Diagnostic> reportDiagnostic,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\CodeFixContextExtensions.cs (2)
16internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, Diagnostic diagnostic) 27internal static void RegisterFixes(this CodeFixContext context, IEnumerable<CodeAction> actions, ImmutableArray<Diagnostic> diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (7)
35/// cref="Diagnostic.Properties"/> for that diagnostic. The diagnostic itself is not passed along as it was 36/// computed with respect to the original user document, and as such its <see cref="Diagnostic.Location"/> and <see 37/// cref="Diagnostic.AdditionalLocations"/> will not be correct. 46protected sealed override bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic) 59ImmutableArray<Diagnostic> diagnostics, 65using var _ = ArrayBuilder<(TDiagnosticNode diagnosticNode, Diagnostic diagnostic)>.GetInstance(out var originalNodes); 66foreach (var diagnostic in diagnostics)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (9)
48protected void RegisterCodeFix(CodeFixContext context, string title, string equivalenceKey, Diagnostic? diagnostic = null) 51protected void RegisterCodeFix(CodeFixContext context, string title, string equivalenceKey, CodeActionPriority priority, Diagnostic? diagnostic = null) 54protected Func<CancellationToken, Task<Document>> GetDocumentUpdater(CodeFixContext context, Diagnostic? diagnostic = null) 61Document document, ImmutableArray<Diagnostic> diagnostics, CancellationToken cancellationToken) 89Document document, ImmutableArray<Diagnostic> diagnostics, SyntaxEditor editor, CancellationToken cancellationToken); 97/// This overload differs from <see cref="IncludeDiagnosticDuringFixAll(Diagnostic)"/> in that it also passes along 103protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic, Document document, string? equivalenceKey, CancellationToken cancellationToken) 115/// cref="IFixAllState.CodeActionEquivalenceKey"/>), then <see cref="IncludeDiagnosticDuringFixAll(Diagnostic, 120protected virtual bool IncludeDiagnosticDuringFixAll(Diagnostic diagnostic)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
175public static async Task<ImmutableArray<Diagnostic>> GetErrorsAsync(this Document document, CancellationToken cancellationToken, IList<string>? ignoreErrorCode = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
48public static string? TryGetAnalyzerConfigPathForDiagnosticConfiguration(this Project project, Diagnostic diagnostic) 54private static string? TryGetAnalyzerConfigPathForProjectOrDiagnosticConfiguration(Project project, Diagnostic? diagnostic)
Workspace\Solution\DocumentState.cs (2)
572internal override Task<Diagnostic?> GetLoadDiagnosticAsync(CancellationToken cancellationToken) 576return SpecializedTasks.Null<Diagnostic>();
Workspace\Solution\Project.cs (1)
362internal ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(CancellationToken cancellationToken)
Workspace\Solution\SolutionCompilationState.cs (1)
1178public ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(
Workspace\Solution\SolutionCompilationState.ICompilationTracker.cs (1)
69ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
858public async ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync( 873using var _ = ArrayBuilder<Diagnostic>.GetInstance(capacity: driverRunResult.Diagnostics.Length, out var builder);
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (1)
272foreach (var diagnostic in emitResult.Diagnostics)
Workspace\Solution\SolutionCompilationState.WithFrozenSourceGeneratedDocumentsCompilationTracker.cs (1)
226public ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsync(
Workspace\Solution\TextAndVersion.cs (3)
34internal Diagnostic? LoadDiagnostic { get; } 36private TextAndVersion(SourceText text, VersionStamp version, string? filePath, Diagnostic? loadDiagnostic) 64internal static TextAndVersion Create(SourceText text, VersionStamp version, Diagnostic? loadDiagnostic)
Workspace\Solution\TextDocumentState.cs (1)
198internal virtual async Task<Diagnostic?> GetLoadDiagnosticAsync(CancellationToken cancellationToken)
Workspace\Solution\TextLoader.cs (1)
179Diagnostic.Create(WorkspaceDiagnosticDescriptors.ErrorReadingFileContent, location, new[] { display, message }));
Workspace\Solution\VersionSource\RecoverableTextAndVersion.cs (1)
142public readonly Diagnostic? LoadDiagnostic;
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
BatchFixAllProviderTests.cs (2)
74context.ReportDiagnostic(Diagnostic.Create(Descriptor, node.Token.GetLocation())); 97foreach (var diagnostic in context.Diagnostics)
SolutionTests\SolutionTests.cs (1)
4847var diagnostic = Assert.Single(diagnostics);
Microsoft.DotNet.CodeAnalysis (7)
Analyzers\AppContextDefaultsAnalyzer.cs (4)
76context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultNotInitializedToTrueDiagnostic, args.GetLocation(), call)); 83context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultValueDefinedOutsideIfConditionDiagnostic, args.GetLocation(), call)); 91context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultValueDefinedOutsideIfConditionDiagnostic, args.GetLocation(), call)); 98context.ReportDiagnostic(Diagnostic.Create(s_appContextDefaultUsedUnexpectedIfStatementDiagnostic, containingIfStatement.GetLocation()));
Analyzers\MembersMustExistAnalyzer.cs (1)
39context.ReportDiagnostic(Diagnostic.Create(s_memberMustExistDiagnostic, Location.None, missingAPI));
Analyzers\PinvokeAnalyzer.cs (1)
163context.ReportDiagnostic(Diagnostic.Create(InvalidPinvokeCall, synref.GetSyntax().GetLocation(), data.ModuleName + "!" + (data.EntryPointName ?? methodSymbol.Name), altMsg));
Analyzers\ResourceUsageAnalyzer.cs (1)
53context.ReportDiagnostic(Diagnostic.Create(InvalidSRFormatCall, invokeExpr.GetLocation(), invokeExpr.GetText()));
Microsoft.Extensions.Logging.Generators (3)
LoggerMessageGenerator.Parser.cs (3)
25private readonly Action<Diagnostic> _reportDiagnostic; 27public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 723_reportDiagnostic(Diagnostic.Create(desc, location, messageArgs));
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (4)
26private readonly Action<Diagnostic> _reportDiagnostic; 34Action<Diagnostic> reportDiagnostic, 866_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>())); 869_reportDiagnostic(Diagnostic.Create(desc, location, messageArgs));
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
101context.ReportDiagnostic(Diagnostic.Create(diagnostic, location: null));
Microsoft.Gen.ComplianceReports.Unit.Tests (22)
GeneratorTests.cs (2)
132var diag = Assert.Single(diags); 164private static async Task<IReadOnlyList<Diagnostic>> RunGenerator(string code, string? outputFile = null, Dictionary<string, string>? options = null)
test\Generators\Shared\RoslynTestUtils.cs (20)
134public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 151public static void AssertDiagnostics(this string text, DiagnosticDescriptor expected, IEnumerable<Diagnostic> actual) 154foreach (var d in actual) 184public static IReadOnlyList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 186var filtered = new List<Diagnostic>(); 187foreach (Diagnostic diagnostic in diagnostics) 202public static IReadOnlyList<Diagnostic> FilterOutDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 204var filtered = new List<Diagnostic>(); 205foreach (Diagnostic diagnostic in diagnostics) 229public static (IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) RunGenerator( 244public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 258public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 288public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 301public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 392public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 414private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 482foreach (var d in diags)
Microsoft.Gen.ContextualOptions (5)
Model\OptionsContextType.cs (1)
13public readonly List<Diagnostic> Diagnostics = [];
Parser.cs (4)
32.Select(modifier => Diagnostic.Create(DiagDescriptors.ContextCannotBeStatic, modifier.GetLocation(), type.Name))); 46.Select(modifier => Diagnostic.Create(DiagDescriptors.ContextCannotBeRefLike, modifier.GetLocation(), type.Name))); 57type.Definitions.Select(def => Diagnostic.Create(DiagDescriptors.ContextMustBePartial, def.Identifier.GetLocation(), type.Name))); 68type.Definitions.Select(def => Diagnostic.Create(DiagDescriptors.ContextDoesNotHaveValidProperties, def.Identifier.GetLocation(), type.Name)));
Microsoft.Gen.ContextualOptions.Unit.Tests (20)
test\Generators\Shared\RoslynTestUtils.cs (20)
134public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 151public static void AssertDiagnostics(this string text, DiagnosticDescriptor expected, IEnumerable<Diagnostic> actual) 154foreach (var d in actual) 184public static IReadOnlyList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 186var filtered = new List<Diagnostic>(); 187foreach (Diagnostic diagnostic in diagnostics) 202public static IReadOnlyList<Diagnostic> FilterOutDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 204var filtered = new List<Diagnostic>(); 205foreach (Diagnostic diagnostic in diagnostics) 229public static (IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) RunGenerator( 244public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 258public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 288public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 301public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 392public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 414private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 482foreach (var d in diags)
Microsoft.Gen.Logging (4)
Parsing\Parser.cs (4)
21private readonly Action<Diagnostic> _reportDiagnostic; 24public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 746var d = Diagnostic.Create(desc, location, messageArgs);
Microsoft.Gen.Logging.Unit.Tests (26)
AttributeParserTests.cs (1)
225private static async Task<IReadOnlyList<Diagnostic>> RunGenerator(string code)
LogParserUtilitiesTests.cs (4)
71var diagMock = new Mock<Action<Diagnostic>>(); 119var diagMock = new Mock<Action<Diagnostic>>(); 186var diagMock = new Mock<Action<Diagnostic>>(); 197diagMock.Verify(x => x.Invoke(It.Is<Diagnostic>(d => d.Id == DiagDescriptors.LogPropertiesParameterSkipped.Id)), Times.Once);
ParserTests.cs (1)
676(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) =
test\Generators\Shared\RoslynTestUtils.cs (20)
134public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 151public static void AssertDiagnostics(this string text, DiagnosticDescriptor expected, IEnumerable<Diagnostic> actual) 154foreach (var d in actual) 184public static IReadOnlyList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 186var filtered = new List<Diagnostic>(); 187foreach (Diagnostic diagnostic in diagnostics) 202public static IReadOnlyList<Diagnostic> FilterOutDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 204var filtered = new List<Diagnostic>(); 205foreach (Diagnostic diagnostic in diagnostics) 229public static (IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) RunGenerator( 244public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 258public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 288public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 301public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 392public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 414private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 482foreach (var d in diags)
Microsoft.Gen.Metrics (4)
Parser.cs (4)
47private readonly Action<Diagnostic> _reportDiagnostic; 50public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 598_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>())); 603_reportDiagnostic(Diagnostic.Create(desc, location, messageArgs));
Microsoft.Gen.Metrics.Unit.Tests (26)
ParserTests.cs (3)
404var diag = Assert.Single(d); 418var diag = Assert.Single(d); 745private static async Task<IReadOnlyList<Diagnostic>> RunGenerator(
ParserTests.Diagnostics.cs (3)
33var diag = Assert.Single(d); 63var diag = Assert.Single(d); 94var diag = Assert.Single(d);
test\Generators\Shared\RoslynTestUtils.cs (20)
134public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 151public static void AssertDiagnostics(this string text, DiagnosticDescriptor expected, IEnumerable<Diagnostic> actual) 154foreach (var d in actual) 184public static IReadOnlyList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 186var filtered = new List<Diagnostic>(); 187foreach (Diagnostic diagnostic in diagnostics) 202public static IReadOnlyList<Diagnostic> FilterOutDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 204var filtered = new List<Diagnostic>(); 205foreach (Diagnostic diagnostic in diagnostics) 229public static (IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) RunGenerator( 244public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 258public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 288public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 301public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 392public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 414private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 482foreach (var d in diags)
Microsoft.Gen.MetricsReports (5)
MetricsReportsGenerator.cs (1)
80context.ReportDiagnostic(Diagnostic.Create(diagnostic, location: null));
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
47private readonly Action<Diagnostic> _reportDiagnostic; 50public Parser(Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken) 598_reportDiagnostic(Diagnostic.Create(desc, location, Array.Empty<object?>())); 603_reportDiagnostic(Diagnostic.Create(desc, location, messageArgs));
Microsoft.Gen.MetricsReports.Unit.Tests (21)
GeneratorTests.cs (1)
145private static async Task<IReadOnlyList<Diagnostic>> RunGenerator(
test\Generators\Shared\RoslynTestUtils.cs (20)
134public static void AssertDiagnostic(this string text, int spanNum, DiagnosticDescriptor expected, Diagnostic actual) 151public static void AssertDiagnostics(this string text, DiagnosticDescriptor expected, IEnumerable<Diagnostic> actual) 154foreach (var d in actual) 184public static IReadOnlyList<Diagnostic> FilterDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 186var filtered = new List<Diagnostic>(); 187foreach (Diagnostic diagnostic in diagnostics) 202public static IReadOnlyList<Diagnostic> FilterOutDiagnostics(this IEnumerable<Diagnostic> diagnostics, params DiagnosticDescriptor[] filter) 204var filtered = new List<Diagnostic>(); 205foreach (Diagnostic diagnostic in diagnostics) 229public static (IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources) RunGenerator( 244public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 258public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 288public static Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 301public static async Task<(IReadOnlyList<Diagnostic> diagnostics, ImmutableArray<GeneratedSourceResult> generatedSources)> RunGenerator( 392public static async Task<IReadOnlyList<Diagnostic>> RunAnalyzer( 414private static IReadOnlyList<Diagnostic> Sort(ImmutableArray<Diagnostic> diags) 482foreach (var d in diags)
Microsoft.Interop.ComInterfaceGenerator (21)
Analyzers\AddGeneratedComClassFixer.cs (1)
57protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic)
Analyzers\AddMarshalAsToElementFixer.cs (1)
32foreach (var diagnostic in context.Diagnostics)
Analyzers\ConvertComImportToGeneratedComInterfaceFixer.cs (1)
43protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (4)
120Diagnostic.Create( 161Diagnostic.Create( 181Diagnostic.Create( 191Diagnostic.Create(
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (5)
97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 101private ImmutableDictionary<string, Option> GetOptionsForIndividualFix(ImmutableDictionary<string, Option> fixAllOptions, Diagnostic diagnostic) 128foreach (Diagnostic diagnostic in context.Diagnostics) 177ImmutableArray<Diagnostic> diagnosticsInScope = await fixAllContext.GetDiagnosticsInScopeAsync().ConfigureAwait(false); 186foreach (var diagnostic in diagnosticsInScope)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (3)
15public static async Task<ImmutableArray<Diagnostic>> GetDiagnosticsInScopeAsync(this FixAllContext context) 44return ImmutableArray<Diagnostic>.Empty; 61ImmutableArray<Diagnostic> diagnostics = await context.GetAllDiagnosticsAsync(project).ConfigureAwait(false);
VtableIndexStubGenerator.cs (6)
50Diagnostic? diagnostic = GetDiagnosticIfInvalidMethodForGeneration(data.Syntax, data.Symbol); 391private static Diagnostic? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax methodSyntax, IMethodSymbol method) 400return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 408return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier); 415return Diagnostic.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, methodSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString()); 421return Diagnostic.Create(GeneratorDiagnostics.InvalidAttributedMethodContainingTypeMissingUnmanagedObjectUnwrapperAttribute, methodSyntax.Identifier.GetLocation(), method.Name);
Microsoft.Interop.JavaScript.JSImportGenerator (10)
JSExportGenerator.cs (5)
48Diagnostic? diagnostic = GetDiagnosticIfInvalidMethodForGeneration(data.Syntax, data.Symbol); 335private static Diagnostic? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax methodSyntax, IMethodSymbol method) 344return Diagnostic.Create(GeneratorDiagnostics.InvalidExportAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 352return Diagnostic.Create(GeneratorDiagnostics.InvalidExportAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier); 359return Diagnostic.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, methodSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
JSImportGenerator.cs (5)
46Diagnostic? diagnostic = GetDiagnosticIfInvalidMethodForGeneration(data.Syntax, data.Symbol); 214private static Diagnostic? GetDiagnosticIfInvalidMethodForGeneration(MethodDeclarationSyntax methodSyntax, IMethodSymbol method) 223return Diagnostic.Create(GeneratorDiagnostics.InvalidImportAttributedMethodSignature, methodSyntax.Identifier.GetLocation(), method.Name); 231return Diagnostic.Create(GeneratorDiagnostics.InvalidImportAttributedMethodContainingTypeMissingModifiers, methodSyntax.Identifier.GetLocation(), method.Name, typeDecl.Identifier); 238return Diagnostic.Create(GeneratorDiagnostics.ReturnConfigurationNotSupported, methodSyntax.Identifier.GetLocation(), "ref return", method.ToDisplayString());
Microsoft.Interop.LibraryImportGenerator (21)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (2)
32List<Diagnostic> fixedDiagnostics = new(context.Diagnostics.Where(IsRequiresDiableRuntimeMarshallingDiagnostic)); 46static bool IsRequiresDiableRuntimeMarshallingDiagnostic(Diagnostic diagnostic)
Analyzers\ConvertToLibraryImportFixer.cs (1)
56protected override ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic)
Analyzers\CustomMarshallerAttributeFixer.cs (7)
31ImmutableArray<Diagnostic> diagnostics = await GetAllDiagnosticsInScope(fixAllContext).ConfigureAwait(false); 34foreach (Diagnostic diagnostic in diagnostics) 87private static async Task<ImmutableArray<Diagnostic>> GetAllDiagnosticsInScope(FixAllContext context) 130private static (HashSet<string> missingMembers, List<Diagnostic> fixedDiagnostics) GetRequiredShapeMissingMemberNames(IEnumerable<Diagnostic> diagnostics) 133List<Diagnostic> requiredShapeDiagnostics = new(); 134foreach (var diagnostic in diagnostics)
Analyzers\DiagnosticReporter.cs (1)
19public static DiagnosticReporter CreateForLocation(Location location, Action<Diagnostic> reportDiagnostic) => new((descriptor, properties, args) => reportDiagnostic(location.CreateDiagnosticInfo(descriptor, properties, args).ToDiagnostic()));
Analyzers\ShapeBreakingDiagnosticSuppressor.cs (2)
24foreach (var diagnostic in context.ReportedDiagnostics) 33private static void SuppressMarkMethodsAsStaticDiagnosticIfNeeded(SuppressionAnalysisContext context, Diagnostic diagnostic)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (5)
97protected abstract ImmutableDictionary<string, Option> ParseOptionsFromDiagnostic(Diagnostic diagnostic); 101private ImmutableDictionary<string, Option> GetOptionsForIndividualFix(ImmutableDictionary<string, Option> fixAllOptions, Diagnostic diagnostic) 128foreach (Diagnostic diagnostic in context.Diagnostics) 177ImmutableArray<Diagnostic> diagnosticsInScope = await fixAllContext.GetDiagnosticsInScopeAsync().ConfigureAwait(false); 186foreach (var diagnostic in diagnosticsInScope)
src\libraries\System.Runtime.InteropServices\gen\Common\FixAllContextExtensions.cs (3)
15public static async Task<ImmutableArray<Diagnostic>> GetDiagnosticsInScopeAsync(this FixAllContext context) 44return ImmutableArray<Diagnostic>.Empty; 61ImmutableArray<Diagnostic> diagnostics = await context.GetAllDiagnosticsAsync(project).ConfigureAwait(false);
Microsoft.Interop.SourceGeneration (18)
DiagnosticExtensions.cs (12)
12public static Diagnostic CreateDiagnostic( 20public static Diagnostic CreateDiagnostic( 29public static Diagnostic CreateDiagnostic( 42public static Diagnostic CreateDiagnostic( 56public static Diagnostic CreateDiagnostic( 64public static Diagnostic CreateDiagnostic( 88Diagnostic.Create(descriptor, Location.None, properties: properties, args) : 89Diagnostic.Create(descriptor, firstLocation, additionalLocations: additionalLocations, properties: properties, messageArgs: args); 92public static Diagnostic CreateDiagnostic( 97return Diagnostic.Create( 103public static Diagnostic CreateDiagnostic( 109return Diagnostic.Create(
DiagnosticInfo.cs (2)
19public Diagnostic ToDiagnostic() => Diagnostic.Create(
DiagnosticOr.cs (3)
147/// Filters the <see cref="IncrementalValuesProvider{TValue}"/> by whether or not the is a <see cref="Diagnostic"/>, reports the diagnostics, and returns the values. 157/// Filters both <see cref="IncrementalValuesProvider{TValue}"/> by whether or not the value in <paramref name="diagnosticOrValues"/> is a <see cref="Diagnostic"/>, reports the diagnostics, and returns the values. 170/// Filters each inner <see cref="IEnumerable{T}"/> of <see cref="DiagnosticOr{T}"/> by whether the elements are <see cref="Diagnostic"/>s, reports the diagnostics, and returns the values.
IncrementalGeneratorInitializationContextExtensions.cs (1)
61public static void RegisterDiagnostics(this IncrementalGeneratorInitializationContext context, IncrementalValuesProvider<Diagnostic> diagnostics)
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\RelaxTestNamingTest.cs (1)
133context.ReportDiagnostic(Diagnostic.Create(Rule, method.Locations[0]));
Microsoft.ML.InternalCodeAnalyzer (23)
BaseTestClassAnalyzer.cs (1)
78context.ReportDiagnostic(Diagnostic.Create(Rule, namedType.Locations[0], namedType));
BestFriendAnalyzer.cs (2)
110var diagnostic = Diagnostic.Create(Rule, node.GetLocation(), symbol.Name);
BestFriendOnPublicDeclarationsAnalyzer.cs (2)
66var diagnostic = Diagnostic.Create(Rule, attribute.ApplicationSyntaxReference.GetSyntax().GetLocation(), context.Symbol.Name);
ContractsCheckAnalyzer.cs (4)
211context.ReportDiagnostic(Diagnostic.Create( 231context.ReportDiagnostic(Diagnostic.Create( 238context.ReportDiagnostic(Diagnostic.Create( 243context.ReportDiagnostic(Diagnostic.Create(
ContractsCheckNameofFixProvider.cs (1)
36var diagnostic = context.Diagnostics.FirstOrDefault(d => d.Id == Id);
InstanceInitializerAnalyzer.cs (4)
59var diagnostic = Diagnostic.Create(Rule, symbol.Locations[0], symbol.Name, "field"); 75var diagnostic = Diagnostic.Create(Rule, symbol.Locations[0], symbol.Name, "property");
NameAnalyzer.cs (5)
32internal static Diagnostic CreateDiagnostic(DiagnosticDescriptor rule, SyntaxToken identifier, NameType desired, params object[] args) 38return Diagnostic.Create(rule, identifier.GetLocation(), props, text); 42return Diagnostic.Create(rule, identifier.GetLocation(), props, newArgs); 172var diagnostic = Diagnostic.Create(PrivateFieldName.Rule, identifier.GetLocation(), name);
NameFixProvider.cs (1)
51var diagnostic = context.Diagnostics[0];
RelaxTestNamingSuppressor.cs (1)
33foreach (var diagnostic in context.ReportedDiagnostics)
SingleVariableDeclarationAnalyzer.cs (2)
47var diagnostic = Diagnostic.Create(Rule, context.Node.GetLocation(), jointVariableNames);
Microsoft.VisualStudio.LanguageServices (18)
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (18)
241? ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty 422private static ImmutableDictionary<Document, ImmutableArray<Diagnostic>> GetDocumentDiagnosticsMappedToNewSolution(ImmutableDictionary<Document, ImmutableArray<Diagnostic>> documentDiagnosticsToFixMap, Solution newSolution, string language) 424ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Builder? builder = null; 433builder ??= ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 438return builder != null ? builder.ToImmutable() : ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 441private static ImmutableDictionary<Project, ImmutableArray<Diagnostic>> GetProjectDiagnosticsMappedToNewSolution(ImmutableDictionary<Project, ImmutableArray<Diagnostic>> projectDiagnosticsToFixMap, Solution newSolution, string language) 443ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Builder? projectDiagsBuilder = null; 452projectDiagsBuilder ??= ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>(); 457return projectDiagsBuilder != null ? projectDiagsBuilder.ToImmutable() : ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 460private static CodeFixProvider? GetSuppressionFixer(IEnumerable<Diagnostic> diagnostics, string language, ICodeFixService codeFixService) 466private async Task<ImmutableDictionary<Document, ImmutableArray<Diagnostic>>> GetDocumentDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 484return ImmutableDictionary<Document, ImmutableArray<Diagnostic>>.Empty; 487var finalBuilder = ImmutableDictionary.CreateBuilder<Document, ImmutableArray<Diagnostic>>(); 558private async Task<ImmutableDictionary<Project, ImmutableArray<Diagnostic>>> GetProjectDiagnosticsToFixAsync(IEnumerable<DiagnosticData> diagnosticsToFix, Func<Project, bool> shouldFixInProject, bool filterStaleDiagnostics, CancellationToken cancellationToken) 576return ImmutableDictionary<Project, ImmutableArray<Diagnostic>>.Empty; 579var finalBuilder = ImmutableDictionary.CreateBuilder<Project, ImmutableArray<Diagnostic>>();
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
111c.ReportDiagnostic(Diagnostic.Create(descriptor, c.Tree.GetLocation(TextSpan.FromBounds(0, 0))));
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ProjectSystemShim\VisualBasicProject.OptionsProcessor.vb (1)
231Dim errors As IEnumerable(Of Diagnostic) = Nothing
Microsoft.VisualStudio.LanguageServices.Xaml (6)
Diagnostics\Analyzers\IXamlDocumentAnalyzerService.cs (2)
17Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken); 19Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken);
Diagnostics\Analyzers\XamlDocumentDiagnosticAnalyzer.cs (4)
27public override async Task<ImmutableArray<Diagnostic>> AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken) 31return ImmutableArray<Diagnostic>.Empty; 37public override async Task<ImmutableArray<Diagnostic>> AnalyzeSemanticsAsync(Document document, CancellationToken cancellationToken) 41return ImmutableArray<Diagnostic>.Empty;
Mvc.Api.Analyzers.Test (2)
Infrastructure\MvcDiagnosticAnalyzerRunner.cs (2)
20public Task<Diagnostic[]> GetDiagnosticsAsync(string source) 46public Task<Diagnostic[]> GetDiagnosticsAsync(Project project)
Roslyn.VisualStudio.Next.UnitTests (2)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (2)
276c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1)))); 294c.ReportDiagnostic(Diagnostic.Create(_supportedDiagnostics[0], c.Tree.GetLocation(TextSpan.FromBounds(0, 1))));
System.Private.CoreLib.Generators (9)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (9)
332context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 343context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 356context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 365context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 373context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, expressionToDecompose.GetLocation())); 546context.ReportDiagnostic(Diagnostic.Create(RuleAttributeNotSpecificEnough, operation.Syntax.GetLocation(), attributeExplicitlyAllowsRelatedSymbol.ToDisplayString())); 613context.ReportDiagnostic(Diagnostic.Create(RuleCantParse, operation.Syntax.GetLocation())); 686context.ReportDiagnostic(Diagnostic.Create(Rule, operation.Syntax.GetLocation(), symbol.ContainingSymbol.ToDisplayString())); 688context.ReportDiagnostic(Diagnostic.Create(RuleHelper, operation.Syntax.GetLocation(), symbol.ToDisplayString()));
System.Text.Json.SourceGeneration (2)
src\libraries\Common\src\SourceGenerators\DiagnosticInfo.cs (2)
37public Diagnostic CreateDiagnostic() 38=> Diagnostic.Create(Descriptor, Location, MessageArgs);
System.Text.RegularExpressions.Generator (6)
RegexGenerator.cs (3)
357/// <summary>Create a <see cref="Diagnostic"/> from the data.</summary> 358public Diagnostic ToDiagnostic() => Diagnostic.Create(descriptor, location, arg is null ? [] : [arg]);
UpgradeToGeneratedRegexAnalyzer.cs (2)
113context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.UseRegexSourceGeneration, syntaxNodeForDiagnostic.GetLocation())); 145context.ReportDiagnostic(Diagnostic.Create(DiagnosticDescriptors.UseRegexSourceGeneration, syntaxNodeForDiagnostic.GetLocation()));
UpgradeToGeneratedRegexCodeFixer.cs (1)
66/// Takes a <see cref="Document"/> and a <see cref="Diagnostic"/> and returns a new <see cref="Document"/> with the replaced
System.Windows.Forms.Analyzers (2)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (2)
66context.ReportDiagnostic(Diagnostic.Create(SharedDiagnosticDescriptors.s_cSharpMigrateHighDpiSettings, 73context.ReportDiagnostic(Diagnostic.Create(SharedDiagnosticDescriptors.s_visualBasicMigrateHighDpiSettings,
System.Windows.Forms.Analyzers.CodeFixes.CSharp (1)
System\Windows\Forms\CSharp\CodeFixes\AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.cs (1)
38Diagnostic diagnostic = context.Diagnostics.First();
System.Windows.Forms.Analyzers.CodeFixes.VisualBasic (1)
AddDesignerSerializationVisibility\AddDesignerSerializationVisibilityCodeFixProvider.vb (1)
44Dim diagnostic As Diagnostic = context.Diagnostics.First()
System.Windows.Forms.Analyzers.CSharp (16)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (2)
69Diagnostic diagnostic = Diagnostic.Create(
System\Windows\Forms\CSharp\Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationAnalyzer.cs (2)
72var diagnostic = Diagnostic.Create(
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (4)
20Diagnostic? applicationConfigDiagnostics) 43context.ReportDiagnostic(Diagnostic.Create( 81IncrementalValueProvider<(ApplicationConfig? ApplicationConfig, Diagnostic? Diagnostic)> globalConfig 84IncrementalValueProvider<(OutputKind OutputKind, Collections.Immutable.ImmutableArray<string?> ProjectNamespaces, ApplicationConfig? ApplicationConfig, Diagnostic? ApplicationConfigDiagnostics)> inputs
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.cs (8)
14public static IncrementalValueProvider<(ApplicationConfig? ApplicationConfig, Diagnostic? Diagnostic)> ReadApplicationConfig(IncrementalValueProvider<AnalyzerConfigOptionsProvider> configOptionsProvider) => 20out bool enableVisualStyles, out Diagnostic? diagnostic) 39private static bool TryReadBool(AnalyzerConfigOptionsProvider configOptions, string propertyName, bool defaultValue, out bool value, out Diagnostic? diagnostic) 53diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue, 65private static bool TryReadFont(AnalyzerConfigOptionsProvider configOptions, out FontDescriptor? font, out Diagnostic? diagnostic) 89diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValueWithReason, 99private static bool TryReadHighDpiMode(AnalyzerConfigOptionsProvider configOptions, out HighDpiMode highDpiMode, out Diagnostic? diagnostic) 114diagnostic = Diagnostic.Create(CSharpDiagnosticDescriptors.s_propertyCantBeSetToValue,
System.Windows.Forms.Analyzers.CSharp.Tests (10)
Generators\ProjectFileReaderTests.cs (10)
21private static bool TryReadBool(AnalyzerConfigOptionsProvider configOptions, string propertyName, bool defaultValue, out bool value, out Diagnostic? diagnostic) 24private static bool TryReadFont(AnalyzerConfigOptionsProvider configOptions, out FontDescriptor? font, out Diagnostic? diagnostic) 27private static bool TryReadHighDpiMode(AnalyzerConfigOptionsProvider configOptions, out HighDpiMode highDpiMode, out Diagnostic? diagnostic) 52bool result = TryReadBool(provider, "myvalue", defaultValue: false, out bool returnedValue, out Diagnostic? diagnostic); 78bool result = TryReadBool(provider, "myvalue", defaultValue: true, out bool returnedValue, out Diagnostic? diagnostic); 116bool result = TryReadFont(provider, out FontDescriptor? returnedValue, out Diagnostic? diagnostic); 153bool result = TryReadFont(provider, out _, out Diagnostic? diagnostic); 175bool result = TryReadHighDpiMode(provider, out HighDpiMode returnedValue, out Diagnostic? diagnostic); 195bool result = TryReadHighDpiMode(provider, out HighDpiMode returnedValue, out Diagnostic? diagnostic); 213bool result = TryReadHighDpiMode(provider, out HighDpiMode returnedValue, out Diagnostic? diagnostic);
System.Windows.Forms.Analyzers.VisualBasic (2)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (1)
82Dim diagnostic As Diagnostic = Diagnostic.Create(
Analyzers\MissingPropertySerializationConfiguration\MissingPropertySerializationConfigurationDiagnosticAnalyzer.vb (1)
74Dim diagnostic As Diagnostic = Diagnostic.Create(
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
191context.ReportDiagnostic(Diagnostic.Create("EV1", nameof(EnumValidationGenerator), $"Can't validate an enum that has no elements", DiagnosticSeverity.Error, DiagnosticSeverity.Error, true, 4));
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
308driver.RunGeneratorsAndUpdateCompilation(compilation, out Compilation outputCompilation, out ImmutableArray<Diagnostic> diagnostics);
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
60warningLevel: Diagnostic.MaxWarningLevel,