67 references to Add
Microsoft.CodeAnalysis (67)
Binding\BindingDiagnosticBag.cs (1)
55
DiagnosticBag?.
Add
(diag);
CommandLine\AnalyzerConfigSet.cs (2)
503
diagnostics.
Add
(Diagnostic.Create(
526
diagnostics.
Add
(Diagnostic.Create(
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (2)
45
diagnostics.
Add
(messageProvider.CreateDiagnostic(diagnosticInfo));
129
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_CantOpenFileWrite, Location.None, _filePath, message));
CommandLine\CommonCompiler.cs (8)
325
diagnostics.
Add
(Diagnostic.Create(
379
diagnostics.
Add
(Diagnostic.Create(ToFileReadDiagnostics(MessageProvider, e, filePath)));
419
diagnostics.
Add
(MessageProvider.CreateDiagnostic(ToFileReadDiagnostics(this.MessageProvider, e, filePath)));
1295
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.FTL_InvalidInputFileName, Location.None, finalPdbFilePath));
1531
analyzerExceptionDiagnostics.
Add
,
1674
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_ErrorBuildingWin32Resource, Location.None, ex.Message));
1708
diagnostics.
Add
(messageProvider.CreateDiagnostic(errorCode, Location.None, fullPath, ex.Message));
1719
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.FTL_InvalidInputFileName, Location.None, path ?? ""));
Compilation.EmitStream.cs (3)
127
diagnostics.
Add
(StrongNameKeys.GetError(
193
diagnostics.
Add
(StrongNameKeys.GetError(_strongNameKeys.KeyFilePath, _strongNameKeys.KeyContainer,
199
diagnostics.
Add
(StrongNameKeys.GetError(_strongNameKeys.KeyFilePath, _strongNameKeys.KeyContainer, ex.Message, messageProvider));
Compilation\Compilation.cs (21)
1904
accumulator.
Add
(filtered);
2021
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message));
2026
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message));
2031
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message));
2052
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message));
2102
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, NoLocation.Singleton, CodeAnalysisResources.UnrecognizedResourceFileFormat));
2107
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, NoLocation.Singleton, ex.Message));
2120
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, NoLocation.Singleton, CodeAnalysisResources.UnrecognizedResourceFileFormat));
2145
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceNotUnique, Location.None, resource.ResourceName));
2152
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceFileNameNotUnique, Location.None, fileName));
2160
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceFileNameNotUnique, Location.None, fileName));
2171
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceNotUnique, Location.None, name));
2499
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_EncodinglessSyntaxTree, tree.GetRoot().GetLocation()));
3171
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceInModule, Location.None));
3306
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PdbWritingFailed, Location.None, ex.Message));
3311
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? ""));
3316
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_CantReadResource, Location.None, e.Message, e.InnerException?.Message ?? ""));
3321
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PermissionSetAttributeFileReadError, Location.None, e.FileName, e.PropertyName, e.Message));
3483
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PdbWritingFailed, Location.None, e.Message));
3488
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? ""));
3493
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PermissionSetAttributeFileReadError, Location.None, e.FileName, e.PropertyName, e.Message));
Diagnostic\CommonMessageProvider.cs (1)
257
diagnostics.
Add
(CreateDiagnostic(ERR_OutputWriteFailed, Location.None, filePath, e.Message));
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
884
allDiagnostics.
Add
(diagnostic);
Emit\EditAndContinue\DeltaMetadataWriter.cs (1)
844
Context.Diagnostics.
Add
(messageProvider.CreateDiagnostic(
Emit\EmitOptions.cs (6)
336
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidDebugInformationFormat, Location.None, (int)DebugInformationFormat));
348
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidInstrumentationKind, Location.None, (int)instrumentationKind));
359
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidFileAlignment, Location.None, FileAlignment));
364
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidSubsystemVersion, Location.None, SubsystemVersion.ToString()));
375
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidHashAlgorithmName, Location.None, PdbChecksumAlgorithm.ToString()));
380
diagnostics.
Add
(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidHashAlgorithmName, Location.None, ""));
MetadataReader\MetadataHelpers.cs (1)
973
diagnostics.
Add
(
PEWriter\MetadataWriter.cs (7)
1357
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.ERR_MetadataNameTooLong, location, name));
1366
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.ERR_MetadataNameTooLong, location, path));
1390
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.ERR_MetadataNameTooLong, location, namespaceName + "." + mangledTypeName));
1400
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.WRN_PdbUsingNameTooLong, location, usingString));
1412
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.WRN_PdbLocalNameTooLong, localDefinition.Location, name));
3169
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.ERR_TooManyUserStrings, NoLocation.Singleton));
3187
this.Context.Diagnostics.
Add
(this.messageProvider.CreateDiagnostic(this.messageProvider.ERR_TooManyUserStrings, NoLocation.Singleton));
PEWriter\TypeNameSerializer.cs (1)
84
context.Diagnostics.
Add
(messageProvider.CreateDiagnostic(
ReferenceManager\CommonReferenceManager.Resolution.cs (8)
363
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotAssembly, location, peReference.Display ?? ""));
378
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_LinkedNetmoduleMetadataMustProvideFullPEImage, location, peReference.Display ?? ""));
385
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotModule, location, peReference.Display ?? ""));
518
diagnostics.
Add
(newDiagnostic);
535
diagnostics.
Add
((Diagnostic)existing);
559
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotAssembly, Location.None, peReference.Display ?? ""));
807
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataReferencesNotSupported, referenceDirective.Location));
822
diagnostics.
Add
(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotFound, referenceDirective.Location, referenceDirective.File));
SourceGeneration\GeneratorContexts.cs (1)
108
_diagnostics.
Add
(diagnostic);
SourceGeneration\GeneratorDriver.cs (2)
393
diagnosticBag?.
Add
(filtered);
434
driverDiagnostics?.
Add
(effective);
SourceGeneration\IncrementalContexts.cs (1)
184
Diagnostics.
Add
(diagnostic);