313 references to None
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (1)
39RecordDiagnostic(DiagnosticDescriptors.LanguageVersionNotSupported, trimmedLocation: Location.None);
ILLink.RoslynAnalyzer (3)
DynamicallyAccessedMembersAnalyzer.cs (2)
85 return Location.None; 87 return locations.Value.Length > 0 ? locations.Value[0] : Location.None;
TrimAnalysis\TrimAnalysisVisitor.cs (1)
294 HandleCall (operation, OwningSymbol, calledMethod, instance, arguments, Location.None, null, _multiValueLattice, out MultiValue methodReturnValue);
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
90if (diag.Location == Location.None || diag.Location.IsInMetadata)
DiagnosticVerifier.cs (1)
113if (diag.Location == Location.None || diag.Location.IsInMetadata)
Microsoft.AspNetCore.App.Analyzers (1)
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
29var location = Location.None;
Microsoft.AspNetCore.Components.Analyzers (2)
InternalUsageAnalyzer.cs (2)
168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Components.Analyzers.Tests (3)
Helpers\DiagnosticVerifier.Helper.cs (1)
66if (diag.Location == Location.None || diag.Location.IsInMetadata)
Verifiers\DiagnosticVerifier.cs (2)
126if (actual.Location != Location.None) 252if (location == Location.None)
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
InternalUsageAnalyzer.cs (2)
168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (3)
Helpers\DiagnosticVerifier.Helper.cs (1)
66if (diag.Location == Location.None || diag.Location.IsInMetadata)
Verifiers\DiagnosticVerifier.cs (2)
126if (actual.Location != Location.None) 252if (location == Location.None)
Microsoft.AspNetCore.Mvc.Analyzers (2)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
140return syntax?.GetLocation() ?? Location.None;
TopLevelParameterNameAnalyzer.cs (1)
71Location.None;
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedExceptionFactory.cs (1)
148if (diagnostic.Location == Location.None)
Microsoft.CodeAnalysis (70)
CodeGen\LocalDefinition.cs (1)
101return Location.None;
CodeGen\SignatureOnlyLocalDefinition.cs (1)
70public Location Location => Location.None;
CommandLine\AnalyzerConfigSet.cs (3)
434Location.None, 505Location.None, 528Location.None,
CommandLine\CommandLineArguments.cs (1)
437var diagnostic = PortableExecutableReference.ExceptionToDiagnostic(e, messageProviderOpt!, Location.None, cmdReference.Reference, cmdReference.Properties.Kind);
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (1)
129diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_CantOpenFileWrite, Location.None, _filePath, message));
CommandLine\CommonCompiler.cs (4)
1295diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.FTL_InvalidInputFileName, Location.None, finalPdbFilePath)); 1674diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_ErrorBuildingWin32Resource, Location.None, ex.Message)); 1708diagnostics.Add(messageProvider.CreateDiagnostic(errorCode, Location.None, fullPath, ex.Message)); 1719diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.FTL_InvalidInputFileName, Location.None, path ?? ""));
Compilation\Compilation.cs (16)
2021diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message)); 2026diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message)); 2031diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message)); 2052diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_BadWin32Resource, Location.None, ex.Message)); 2145diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceNotUnique, Location.None, resource.ResourceName)); 2152diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceFileNameNotUnique, Location.None, fileName)); 2160diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceFileNameNotUnique, Location.None, fileName)); 2171diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceNotUnique, Location.None, name)); 3171diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_ResourceInModule, Location.None)); 3306diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PdbWritingFailed, Location.None, ex.Message)); 3311diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? "")); 3316diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_CantReadResource, Location.None, e.Message, e.InnerException?.Message ?? "")); 3321diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PermissionSetAttributeFileReadError, Location.None, e.FileName, e.PropertyName, e.Message)); 3483diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PdbWritingFailed, Location.None, e.Message)); 3488diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PeWritingFailure, Location.None, e.InnerException?.ToString() ?? "")); 3493diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_PermissionSetAttributeFileReadError, Location.None, e.FileName, e.PropertyName, e.Message));
Compilation\CompilationOptions.cs (5)
571Location.None, nameof(CryptoPublicKey), nameof(CryptoKeyFile))); 577Location.None, nameof(CryptoPublicKey), nameof(CryptoKeyContainer))); 586Location.None, nameof(CryptoKeyFile))); 592Location.None, nameof(PublicSign), nameof(CryptoKeyContainer))); 598Location.None, nameof(PublicSign), nameof(DelaySign)));
Compilation\ParseOptions.cs (2)
84builder.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_BadSourceCodeKind, Location.None, SpecifiedKind.ToString())); 89builder.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_BadDocumentationMode, Location.None, DocumentationMode.ToString()));
Diagnostic\CommonMessageProvider.cs (1)
257diagnostics.Add(CreateDiagnostic(ERR_OutputWriteFailed, Location.None, filePath, e.Message));
Diagnostic\Diagnostic.cs (11)
43/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 58/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 79/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 100/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 127/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 159location: location ?? Location.None, 178/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 228/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 277severity, defaultSeverity, isEnabledByDefault, warningLevel, location ?? Location.None, additionalLocations, customTags, properties, isSuppressed); 292return new DiagnosticWithInfo(info, Location.None); 390/// Gets the primary location of the diagnostic, or <see cref="Location.None"/> if no primary location.
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
49_location = location ?? Location.None;
Diagnostic\DiagnosticDescriptor.cs (1)
244var effectiveDiagnostic = compilationOptions.FilterDiagnostic(Diagnostic.Create(this, Location.None), CancellationToken.None);
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
1252return Diagnostic.Create(descriptor, Location.None, messageArguments); 1299return Diagnostic.Create(descriptor, Location.None, messageArguments);
Emit\EmitOptions.cs (6)
336diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidDebugInformationFormat, Location.None, (int)DebugInformationFormat)); 348diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidInstrumentationKind, Location.None, (int)instrumentationKind)); 359diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidFileAlignment, Location.None, FileAlignment)); 364diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidSubsystemVersion, Location.None, SubsystemVersion.ToString())); 375diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidHashAlgorithmName, Location.None, PdbChecksumAlgorithm.ToString())); 380diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_InvalidHashAlgorithmName, Location.None, ""));
MetadataReader\MetadataHelpers.cs (2)
974messageProvider.CreateDiagnostic(code, Location.None, 985messageProvider.CreateDiagnostic(code, Location.None,
PEWriter\Members.cs (1)
359/// Use <see cref="Location.None"/> rather than null.
PEWriter\MetadataWriter.cs (1)
1457return symbolOpt != null && !symbolOpt.Locations.IsDefaultOrEmpty ? symbolOpt.Locations[0] : Location.None;
PEWriter\TypeNameSerializer.cs (1)
86context.Location ?? Location.None));
ReferenceManager\CommonReferenceManager.Binding.cs (1)
294var existingReference = TryAddAssembly(resolvedAssemblyIdentity, resolvedReference, index, resolutionDiagnostics, Location.None, assemblyReferencesBySimpleName, supersedeLowerVersions);
ReferenceManager\CommonReferenceManager.Resolution.cs (3)
277location = Location.None; 547var metadata = GetMetadata(peReference, MessageProvider, Location.None, diagnostics); 559diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotAssembly, Location.None, peReference.Display ?? ""));
SourceGeneration\GeneratorDriver.cs (1)
416return Diagnostic.Create(descriptor, Location.None, generator.GetGeneratorType().Name, e.GetType().Name, e.Message, e.CreateDiagnosticDescription());
StrongName\StrongNameKeys.cs (3)
98return new StrongNameKeys(messageProvider.CreateDiagnostic(messageProvider.ERR_BadCompilationOptionValue, Location.None, 219return messageProvider.CreateDiagnostic(messageProvider.ERR_PublicKeyContainerFailure, Location.None, name, message); 224return messageProvider.CreateDiagnostic(messageProvider.ERR_PublicKeyFileFailure, Location.None, path, message);
Syntax\SyntaxToken.cs (1)
647? Location.None
Microsoft.CodeAnalysis.CodeStyle (9)
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (4)
25/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 72/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 136/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 240/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param>
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
657return Location.None; 689return Location.None; 715return Location.None;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
32locations.Add(element.Locations.FirstOrDefault() ?? Location.None);
Microsoft.CodeAnalysis.CSharp (39)
Binder\InMethodBinder.cs (1)
248Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.GetRoot().ContainsDiagnostics == true,
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
3601bool result = !_binder.MethodIsCompatibleWithDelegateOrFunctionPointer(node.ReceiverOpt, conv.IsExtensionMethod, conv.Method, delegateType, Location.None, BindingDiagnosticBag.Discarded);
CommandLine\CSharpCommandLineParser.cs (1)
1540new CSharpRequiredLanguageVersion(MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())), Location.None));
Compilation\CSharpCompilation.cs (4)
530diagnostics.Add(ErrorCode.ERR_DebugEntryPointNotSourceMethodDefinition, Location.None); 2976new CSharpRequiredLanguageVersion(MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())), Location.None)); 4194var location = memberLocations.IsDefault ? Location.None : memberLocations[i]; 4199var descriptor = new AnonymousTypeDescriptor(fields.ToImmutableAndFree(), Location.None);
Compiler\DocumentationCommentCompiler.cs (1)
112diagnostics.Add(ErrorCode.ERR_DocFileGen, Location.None, e.Message);
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (1)
286diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_EncNoPIAReference, embeddedType.AdaptedSymbol), Location.None);
Emitter\Model\PEAssemblyBuilder.cs (7)
368Compilation.CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes.NullablePublicOnlyAttribute, diagnostics, Location.None)) 374Compilation.CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes.RefSafetyRulesAttribute, diagnostics, Location.None)) 611Binder.ReportUseSite(result, diagnostics, Location.None); 618Binder.ReportUseSite(result, diagnostics, Location.None); 625Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__ctor, diagnostics, Location.None); 626Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__AllowMultiple, diagnostics, Location.None); 627Binder.GetWellKnownTypeMember(compilation, WellKnownMember.System_AttributeUsageAttribute__Inherited, diagnostics, Location.None);
Errors\MessageProvider.cs (2)
95return new CSDiagnostic(info, Location.None); 128Location.None,
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (2)
680if (linqToArrayMethod.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, Location.None, BindingDiagnosticBag.Discarded)) 862if (spanOfElementType.CheckConstraints(new ConstraintsHelper.CheckConstraintsArgs(_compilation, _compilation.Conversions, Location.None, BindingDiagnosticBag.Discarded)))
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (4)
463var fields = key.Fields.SelectAsArray(f => new AnonymousTypeField(f.Name, Location.None, typeWithAnnotations: default, refKind: RefKind.None, ScopedKind.None)); 464var typeDescr = new AnonymousTypeDescriptor(fields, Location.None); 833else if (x == Location.None) 837else if (y == Location.None)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (3)
38: base(manager, Location.None) // Location is not needed since NameAndIndex is set explicitly below. 103Debug.Assert(SmallestLocation != Location.None); 163Debug.Assert(SmallestLocation != Location.None);
Symbols\MethodSymbol.cs (2)
1161if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None)) 1171if (type.Type.ContainsTupleNames() && compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None))
Symbols\Source\SourceAssemblySymbol.cs (1)
2218diagnostics.Add(useSiteInfo, useSiteInfo.DiagnosticInfo is object ? GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt) : Location.None))
Symbols\Source\SourceMemberContainerSymbol.cs (1)
1868ReportReservedTypeName(identifier?.Text, this.DeclaringCompilation, diagnostics.DiagnosticBag, identifier?.GetLocation() ?? Location.None);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
777diagnostics.Add(useSiteInfo.Diagnostics.IsNullOrEmpty() ? Location.None : (FindBaseRefSyntax(declaredBase) ?? GetFirstLocation()), useSiteInfo);
Symbols\Symbol.cs (1)
432=> TryGetFirstLocation() ?? Location.None;
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
62compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && 74compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) &&
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
47Location.None,
Symbols\Synthesized\SynthesizedParameterSymbol.cs (2)
156if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && compilation.CanEmitBoolean()) 172compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) &&
Symbols\Tuples\TupleTypeSymbol.cs (1)
504diagnostics.Add(useSiteInfo, static syntax => syntax?.Location ?? Location.None, syntax);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (6)
CommandLineTests.cs (6)
12577new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.None).GetMessage(CultureInfo.InvariantCulture), 12617new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_EmptySwitch), Location.None).GetMessage(CultureInfo.InvariantCulture), 12673new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_UnreferencedField, "C.f"), Location.None).GetMessage(CultureInfo.InvariantCulture), 12741new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_PrecedenceInversion, "from"), Location.None).GetMessage(CultureInfo.InvariantCulture), 12841new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture), 12951new CSDiagnostic(new CSDiagnosticInfo(ErrorCode.WRN_SequentialOnPartialClass, "MyPartialStruct"), Location.None).GetMessage(CultureInfo.InvariantCulture),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (16)
Diagnostics\DiagnosticAnalyzerTests.cs (16)
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); 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); 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)); 895compilationContext.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(UnsupportedDescriptor, Location.None)); 2336var diagnostic = CodeAnalysis.Diagnostic.Create(Summary, Location.None, sortedCallbackEntityNames.Join(","));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
49var location = _reportDiagnosticsWithoutLocation ? Location.None : classDecl.Identifier.GetLocation();
Diagnostics\Suppression\SuppressionTests.cs (1)
2461=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
SourceGeneration\GeneratorDriverTests.cs (7)
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);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Compilation\CompilationAPITests.cs (4)
2535memberLocations: ImmutableArray.Create(Location.None))); 2559memberLocations: ImmutableArray.Create(Location.None, null))); 2614loc => Assert.Equal(loc, Location.None)); 2650loc => Assert.Equal(loc, Location.None));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (4)
Parsing\ParserErrorMessageTests.cs (1)
2634Assert.Equal("error CS1029: #error: '\u0444\u0430\u0439\u043B'", CSharpDiagnosticFormatter.Instance.Format(error.WithLocation(Location.None), EnsureEnglishUICulture.PreferredOrNull));
Syntax\SyntaxFactoryTests.cs (3)
425Assert.Equal(Location.None, literal.GetLocation()); 439Assert.Equal(Location.None, literal.GetLocation()); 477Assert.Equal(Location.None, token.GetLocation());
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
EditAndContinue\EditAndContinueLanguageServiceTests.cs (1)
164var projectDiagnostic = CodeAnalysis.Diagnostic.Create(diagnosticDescriptor1, Location.None, ["proj", "error 2"]);
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticServiceTests.vb (2)
1750context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None)) 1789context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None, _symbolNames.Count))
Microsoft.CodeAnalysis.Features (10)
EditAndContinue\DebuggingSession.cs (2)
275return (Mvid: Guid.Empty, Error: Diagnostic.Create(descriptor, Location.None, [outputs.AssemblyDisplayPath, e.Message])); 416diagnostics = [Diagnostic.Create(descriptor, Location.None, [fileBeingRead, e.Message])];
EditAndContinue\EditSession.cs (2)
140return Diagnostic.Create(descriptor, Location.None); 208yield return Location.None;
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
107Location.None,
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (4)
25/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 72/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 136/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 240/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param>
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None));
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\RemoteEditAndContinueServiceTests.cs (1)
200var projectDiagnostic = Diagnostic.Create(diagnosticDescriptor1, Location.None, new[] { "proj", "some error" });
EditAndContinue\TraceLogTests.cs (1)
20var diagnostic = Diagnostic.Create(EditAndContinueDiagnosticDescriptors.GetDescriptor(EditAndContinueErrorCode.ErrorReadingFile), Location.None, "file", "error");
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (1)
72return Diagnostic.Create(descriptor, Location.None, analyzerName, e.GetType(), e.Message);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\EditAndContinue\RemoteEditAndContinueService.cs (1)
172var diagnostic = Diagnostic.Create(descriptor, Location.None, [e.Message]);
Microsoft.CodeAnalysis.Remote.Workspaces (1)
EditAndContinue\ManagedHotReloadLanguageService.cs (1)
304Location.None,
Microsoft.CodeAnalysis.Scripting (1)
Script.cs (1)
286diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_MetadataFileNotFound, Location.None, unresolved.Reference));
Microsoft.CodeAnalysis.Test.Utilities (22)
Diagnostics\CommonDiagnosticAnalyzers.cs (21)
77context.ReportDiagnostic(Diagnostic.Create(Descriptor2, Location.None, s_properties))); 564compilationContext.ReportDiagnostic(Diagnostic.Create(EnabledRule, Location.None)); 567compilationContext.ReportDiagnostic(Diagnostic.Create(DisabledRule, Location.None)); 825compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 856compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 877compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None))); 953Diagnostic.Create(Descriptor, Location.None, additionalLocations: new[] { _invalidLocation }) : 1653var diagnostic = Diagnostic.Create(rule, Location.None, args); 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); 2034compilationEndContext.ReportDiagnostic(Diagnostic.Create(SymbolStartedEndedDifferRule, Location.None, symbolsStartedStr, symbolsEndedStr, _analyzerId)); 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)); 2455Diagnostic.Create(_rule, Location.None, GetSortedSymbolCallbacksString()))); 2486compilationContext.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None)));
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
43context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, Location.None, messageArgs: Id));
Microsoft.CodeAnalysis.UnitTests (3)
Diagnostics\DiagnosticCreationTests.cs (1)
20var diagnostic = Diagnostic.Create(descriptor, Location.None, effectiveSeverity, additionalLocations: null, properties: null);
Diagnostics\DiagnosticLocalizationTests.cs (1)
87var localizableDiagnostic = Diagnostic.Create(descriptor, Location.None);
Diagnostics\SarifErrorLoggerTests.cs (1)
82logger.LogDiagnostic(Diagnostic.Create(descriptor, Location.None), null);
Microsoft.CodeAnalysis.VisualBasic (26)
Binding\Binder_Invocation.vb (1)
1901Dim msg = VisualBasicDiagnosticFormatter.Instance.Format(iDiagnostic.WithLocation(Location.None))
CodeGen\EmitStatement.vb (1)
1262If(local.Locations.FirstOrDefault(), Location.None),
CommandLine\CommandLineDiagnosticFormatter.vb (2)
44If diagnostic.Location <> Location.None Then 45diagnostic = diagnostic.WithLocation(Location.None)
CommandLine\VisualBasicCommandLineParser.vb (9)
1891Location.None)) 1915Location.None)) 1944Location.None)) 1961Location.None)) 2013diagnosticBuilder.Add(New DiagnosticWithInfo(ErrorFactory.ErrorInfo(ERRID.ERR_ConditionalCompilationConstantNotValid, diag, parsedTokensAsString.ToString), Location.None)) 2025Location.None)) 2046Location.None)) 2068Location.None)) 2078Location.None))
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
85diagnostics.Add(ERRID.ERR_DocFileGen, Location.None, ex.Message)
Compilation\MethodCompiler.vb (1)
1994diagnostics.Add(If(locations.IsDefaultOrEmpty, Location.None, locations(0)), useSiteInfo)
Compilation\VisualBasicCompilation.vb (3)
482diagnostics.Add(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition, Location.None) 2933Dim loc = If(memberLocations.IsDefault, Location.None, memberLocations(i)) 2939fields.ToImmutableAndFree(), Location.None, isImplicitlyDeclared:=False)
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
265diagnostics.Add(ErrorFactory.ErrorInfo(ERRID.ERR_EncNoPIAReference, embeddedType.AdaptedNamedTypeSymbol), Location.None)
Errors\MessageProvider.vb (2)
93Return New VBDiagnostic(info, Location.None) 121Location.None,
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (4)
166Dim names = key.Fields.SelectAsArray(Function(f) New AnonymousTypeField(f.Name, Location.None, f.IsKey)) 167Return New AnonymousTypeDescriptor(names, Location.None, True) 337ElseIf x = Location.None Then 339ElseIf y = Location.None Then
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionConstructorSymbol.vb (1)
72Location.None,
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
9794New VBDiagnostic(ErrorFactory.ErrorInfo(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "C"), Location.None).GetMessage(CultureInfo.InvariantCulture), 9851New VBDiagnostic(ErrorFactory.ErrorInfo(ERRID.WRN_UseOfObsoleteSymbolNoMessage1, "C"), Location.None).GetMessage(CultureInfo.InvariantCulture),
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
SyntaxHelpers.vb (1)
142diagnostics.Add(ERRID.ERR_InvalidFormatSpecifier, Location.None, token)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (15)
Compilation\CompilationAPITests.vb (5)
1578memberLocations:=ImmutableArray.Create(Location.None)) 1594Sub(loc) Assert.Equal(loc, Location.None)) 1641Sub(loc) Assert.Equal(loc, Location.None)) 1656Sub(loc) Assert.Equal(loc, Location.None)) 1670Sub(loc) Assert.Equal(loc, Location.None))
Diagnostics\DiagnosticAnalyzerTests.vb (10)
54Dim noneDiag = Microsoft.CodeAnalysis.Diagnostic.Create(noneDiagDescriptor, Location.None) 55Dim infoDiag = Microsoft.CodeAnalysis.Diagnostic.Create(infoDiagDescriptor, Location.None) 56Dim warningDiag = Microsoft.CodeAnalysis.Diagnostic.Create(warningDiagDescriptor, Location.None) 57Dim errorDiag = Microsoft.CodeAnalysis.Diagnostic.Create(errorDiagDescriptor, Location.None) 135Dim noneDiag = Microsoft.CodeAnalysis.Diagnostic.Create(noneDiagDescriptor, Location.None) 136Dim infoDiag = Microsoft.CodeAnalysis.Diagnostic.Create(infoDiagDescriptor, Location.None) 137Dim warningDiag = Microsoft.CodeAnalysis.Diagnostic.Create(warningDiagDescriptor, Location.None) 138Dim errorDiag = Microsoft.CodeAnalysis.Diagnostic.Create(errorDiagDescriptor, Location.None) 188Dim disabledDiag = CodeAnalysis.Diagnostic.Create(disabledDiagDescriptor, Location.None) 189Dim enabledDiag = CodeAnalysis.Diagnostic.Create(enabledDiagDescriptor, Location.None)
Microsoft.CodeAnalysis.Workspaces (13)
CodeFixes\FixAllOccurrences\FixAllContext.cs (1)
174/// Use this overload when applying fix all to a diagnostic with no source location, i.e. <see cref="Location.None"/>.
Diagnostics\DiagnosticData.cs (1)
305var diagnostic = Diagnostic.Create(descriptor, Location.None, effectiveSeverity, additionalLocations: null, properties: null, messageArgs: messageArguments);
Diagnostics\Extensions.cs (3)
42return Location.None; 47return Location.None; 63return Location.None;
FindSymbols\ReferenceLocation.cs (2)
60/// Otherwise, <see cref="Location.None"/>. 90: this(document, alias, location, isImplicit, symbolUsageInfo, additionalProperties, candidateReason, containingStringLocation: Location.None)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
296else if (location.ContainingStringLocation != Location.None)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (3)
657return Location.None; 689return Location.None; 715return Location.None;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
32locations.Add(element.Locations.FirstOrDefault() ?? Location.None);
Workspace\Solution\TextLoader.cs (1)
167location = Location.None;
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\MembersMustExistAnalyzer.cs (1)
39context.ReportDiagnostic(Diagnostic.Create(s_memberMustExistDiagnostic, Location.None, missingAPI));
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Gen.Logging.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Gen.MetricsReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Interop.ComInterfaceGenerator (1)
ComInterfaceInfo.cs (1)
166Location.None)
Microsoft.Interop.SourceGeneration (11)
DiagnosticExtensions.cs (10)
37: Location.None; 51: Location.None; 88Diagnostic.Create(descriptor, Location.None, properties: properties, args) : 99location: location.IsInSource ? location : Location.None, 111location: location.IsInSource ? location : Location.None, 141: Location.None; 155: Location.None; 192DiagnosticInfo.Create(descriptor, Location.None, properties: properties, args) : 203location: location.IsInSource ? location : Location.None, 215location: location.IsInSource ? location : Location.None,
TypePositionInfo.cs (1)
108return Location.None;
Microsoft.VisualStudio.LanguageServices (1)
Diagnostics\VisualStudioVenusSpanMappingService.cs (1)
38if (location == Location.None)
System.Windows.Forms.Analyzers (2)
System\Windows\Forms\Analyzers\AppManifestAnalyzer.cs (2)
67Location.None, 74Location.None,
System.Windows.Forms.Analyzers.CSharp (4)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (1)
45Location.None, nameof(OutputKind.WindowsApplication)));
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ProjectFileReader.cs (3)
54Location.None, 90Location.None, 115Location.None,