6 types derived from Location
Microsoft.CodeAnalysis (5)
Diagnostic\ExternalFileLocation.cs (1)
14internal sealed class ExternalFileLocation : Location, IEquatable<ExternalFileLocation?>
Diagnostic\MetadataLocation.cs (1)
15internal sealed class MetadataLocation : Location, IEquatable<MetadataLocation?>
Diagnostic\NoLocation.cs (1)
11internal sealed class NoLocation : Location
Diagnostic\SourceLocation.cs (1)
15internal sealed class SourceLocation : Location, IEquatable<SourceLocation?>
Diagnostic\XmlLocation.cs (1)
16internal class XmlLocation : Location, IEquatable<XmlLocation?>
Microsoft.CodeAnalysis.VisualBasic (1)
Locations\VBLocation.vb (1)
13Inherits Location
2651 references to Location
ConfigurationSchemaGenerator (10)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (2)
39RecordDiagnostic(DiagnosticDescriptors.LanguageVersionNotSupported, trimmedLocation: Location.None); 929private void RecordDiagnostic(DiagnosticDescriptor descriptor, Location trimmedLocation, params object?[]? messageArgs)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (2)
14private BinderInvocation(IInvocationOperation operation, Location location) 21public Location Location { get; }
RuntimeSource\SourceGenerators\DiagnosticInfo.cs (6)
19public Location? Location { get; private init; } 21public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location? location, object?[]? messageArgs) 23Location? trimmedLocation = location is null ? null : GetTrimmedLocation(location); 33static Location GetTrimmedLocation(Location location) 34=> Location.Create(location.SourceTree?.FilePath ?? "", location.SourceSpan, location.GetLineSpan().Span);
ILLink.RoslynAnalyzer (46)
DynamicallyAccessedMembersAnalyzer.cs (16)
83 internal static Location GetPrimaryLocation (ImmutableArray<Location>? locations) { 85 return Location.None; 87 return locations.Value.Length > 0 ? locations.Value[0] : Location.None; 123 var location = GetPrimaryLocation (type.Locations); 152 var location = GetPrimaryLocation (member.Locations); 186 Location attributableSymbolLocation = GetPrimaryLocation (attributableMethod.Locations); 189 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource 208 Location attributableSymbolLocation = attributableMethod.GetParameter (overrideParam.Index).Location!; 211 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource 232 Location attributableSymbolLocation = GetPrimaryLocation (attributableSymbol.Locations); 235 (Location[]? sourceLocation, Dictionary<string, string?>? DAMArgs) = (!attributableSymbolLocation.IsInSource 317 private static (Location[]?, Dictionary<string, string?>?) CreateArguments (Location attributableSymbolLocation, DynamicallyAccessedMemberTypes mismatchedArgument) 320 Location[]? sourceLocation = new Location[] { attributableSymbolLocation };
DynamicallyAccessedMembersTypeHierarchy.cs (1)
15 public static void ApplyDynamicallyAccessedMembersToTypeHierarchy (Location typeLocation, INamedTypeSymbol type, Action<Diagnostic> reportDiagnostic)
TrimAnalysis\DiagnosticContext.cs (5)
15 public readonly Location Location { get; } 19 public DiagnosticContext (Location location, Action<Diagnostic>? reportDiagnostic) 62 Location[]? sourceLocation; 75 Location symbolLocation; 78 sourceLocation = new Location[] { symbolLocation };
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) 36 Location location,
TrimAnalysis\HandleCallAction.cs (1)
31 Location location,
TrimAnalysis\ParameterProxy.cs (1)
44 public Location? Location => ParameterSymbol?.Locations[0];
TrimAnalysis\ReflectionAccessAnalyzer.cs (13)
27 internal void GetReflectionAccessDiagnostics (Location location, ITypeSymbol typeSymbol, DynamicallyAccessedMemberTypes requiredMemberTypes, bool declaredOnly = false) 56 internal void GetReflectionAccessDiagnosticsForEventsOnTypeHierarchy (Location location, ITypeSymbol typeSymbol, string name, BindingFlags? bindingFlags) 62 internal void GetReflectionAccessDiagnosticsForFieldsOnTypeHierarchy (Location location, ITypeSymbol typeSymbol, string name, BindingFlags? bindingFlags) 68 internal void GetReflectionAccessDiagnosticsForPropertiesOnTypeHierarchy (Location location, ITypeSymbol typeSymbol, string name, BindingFlags? bindingFlags) 74 internal void GetReflectionAccessDiagnosticsForConstructorsOnType (Location location, ITypeSymbol typeSymbol, BindingFlags? bindingFlags, int? parameterCount) 80 internal void GetReflectionAccessDiagnosticsForPublicParameterlessConstructor (Location location, ITypeSymbol typeSymbol) 86 void ReportRequiresUnreferencedCodeDiagnostic (Location location, AttributeData requiresAttributeData, ISymbol member) 94 internal void GetReflectionAccessDiagnosticsForMethod (Location location, IMethodSymbol methodSymbol) 108 internal void GetTypeHierarchyReflectionAccessDiagnostics (Location location, ISymbol member) 151 internal void GetDiagnosticsForReflectionAccessToDAMOnMethod (Location location, IMethodSymbol methodSymbol) 166 internal void GetReflectionAccessDiagnosticsForProperty (Location location, IPropertySymbol propertySymbol) 174 void GetDiagnosticsForEvent (Location location, IEventSymbol eventSymbol) 184 void GetDiagnosticsForField (Location location, IFieldSymbol fieldSymbol)
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (1)
51 var location = Operation.Syntax.GetLocation ();
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (1)
74 var location = Operation.Syntax.GetLocation ();
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (1)
48 var location = Operation.Syntax.GetLocation ();
TrimAnalysis\TrimAnalysisVisitor.cs (2)
294 HandleCall (operation, OwningSymbol, calledMethod, instance, arguments, Location.None, null, _multiValueLattice, out MultiValue methodReturnValue); 323 Location location,
Microsoft.Analyzers.Extra (1)
CallAnalysis\Arrays.cs (1)
105static void HandleSuspectType(OperationAnalysisContext context, INamedTypeSymbol type, Location loc)
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
468var location = detected[i].Location;
Microsoft.AspNetCore.Analyzer.Testing (3)
Assert.cs (1)
11public static void DiagnosticLocation(DiagnosticLocation expected, Location actual)
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 (16)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
228private static void AddDiagnosticInformation(OperationAnalysisContext context, Location location)
Http\HeaderDictionaryAddAnalyzer.cs (1)
72private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location)
Http\HeaderDictionaryIndexerAnalyzer.cs (1)
169private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location, string headerName, string propertyName)
Http\RequestDelegateReturnTypeAnalyzer.cs (1)
76private static void AddDiagnosticWarning(OperationAnalysisContext context, Location location, ITypeSymbol returnType)
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (2)
62Location.Create(context.SemanticModel.SyntaxTree, diag.Span), 105Location.Create(context.SemanticModel.SyntaxTree, unusedParameter.Span),
RouteHandlers\AtMostOneFromBodyAttribute.cs (1)
53var location = syntax.GetLocation();
RouteHandlers\DetectMismatchedParameterOptionality.cs (1)
35var location = parameter.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation();
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
41var location = lambda.Syntax.GetLocation();
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (2)
29var location = Location.None;
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (2)
48var location = syntax.GetLocation(); 97static bool ReportFromAttributeDiagnostic(OperationAnalysisContext context, WellKnownType fromMetadataInterfaceType, WellKnownTypes wellKnownTypes, IParameterSymbol parameter, INamedTypeSymbol parameterTypeSymbol, Location location)
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (3)
258var location = operation.Syntax.GetLocation(); 292var methodLocation = methodName.GetLocation(); 301location = Location.Create(operation.Syntax.SyntaxTree, targetSpan);
Microsoft.AspNetCore.Components.Analyzers (3)
ComponentParameterAnalyzer.cs (1)
76var propertyLocation = property.Locations.FirstOrDefault();
InternalUsageAnalyzer.cs (2)
168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Components.Analyzers.Tests (5)
Helpers\DiagnosticVerifier.Helper.cs (1)
66if (diag.Location == Location.None || diag.Location.IsInMetadata)
Verifiers\DiagnosticVerifier.cs (4)
126if (actual.Location != Location.None) 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 251var location = diagnostics[i].Location; 252if (location == Location.None)
Microsoft.AspNetCore.Components.SdkAnalyzers (3)
ComponentParameterAnalyzer.cs (1)
70var propertyLocation = property.Locations.FirstOrDefault();
InternalUsageAnalyzer.cs (2)
168symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None, 178symbolForDiagnostic.DeclaringSyntaxReferences.FirstOrDefault()?.GetSyntax().GetLocation() ?? Location.None,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (5)
Helpers\DiagnosticVerifier.Helper.cs (1)
66if (diag.Location == Location.None || diag.Location.IsInMetadata)
Verifiers\DiagnosticVerifier.cs (4)
126if (actual.Location != Location.None) 190private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) 251var location = diagnostics[i].Location; 252if (location == Location.None)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (7)
RequestDelegateGeneratorSuppressor.cs (1)
45var location = diagnostic.AdditionalLocations.Count > 0
StaticRouteHandlerModel\Emitters\DiagnosticEmitter.cs (2)
12public static void EmitRequiredDiagnostics(this EndpointResponse response, List<Diagnostic> diagnostics, Location location) 30public static void EmitRequiredDiagnostics(this IParameterSymbol parameterSymbol, List<Diagnostic> diagnostics, Location location)
StaticRouteHandlerModel\EndpointParameter.cs (4)
115var location = endpoint.Operation.Syntax.GetLocation(); 151var location = endpoint.Operation.Syntax.GetLocation(); 164var location = endpoint.Operation.Syntax.GetLocation(); 462var location = endpoint.Operation.Syntax.GetLocation();
Microsoft.AspNetCore.Mvc.Analyzers (9)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (5)
87var location = GetAttributeLocation(context, attribute); 101var location = GetAttributeLocation(context, attribute); 115var location = GetAttributeLocation(context, attribute); 137private static Location GetAttributeLocation(SymbolAnalysisContext context, AttributeData attribute) 140return syntax?.GetLocation() ?? Location.None;
TagHelpersInCodeBlocksAnalyzer.cs (2)
43var capturedDiagnosticLocations = new HashSet<Location>(); 94foreach (var location in capturedDiagnosticLocations)
TopLevelParameterNameAnalyzer.cs (2)
69var location = parameter.Locations.Length != 0 ? 71Location.None;
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
ApiConventionAnalyzer.cs (1)
53var location = actualMetadata.ReturnOperation.ReturnedValue.Syntax.GetLocation();
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedExceptionFactory.cs (1)
148if (diagnostic.Location == Location.None)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
CompilerFailedExceptionFactoryTest.cs (3)
240Location.Create( 246Location.Create( 252Location.Create(
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.SourceGenerationSpec.cs (1)
28public Location CallSite;
HubServerProxyGenerator.SourceGenerationSpec.cs (1)
29public Location CallSite;
Microsoft.CodeAnalysis (210)
Binding\BindingDiagnosticBag.cs (10)
217internal bool Add(Location location, CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo) 220internal bool AddDiagnostics(Location location, CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo) 223internal bool AddDiagnostics<TData>(CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo, Func<TData, Location> getLocation, TData data) 230var location = getLocation(data); 259internal bool Add<TData>(CompoundUseSiteInfo<TAssemblySymbol> useSiteInfo, Func<TData, Location> getLocation, TData data) 271protected abstract bool ReportUseSiteDiagnostic(DiagnosticInfo diagnosticInfo, DiagnosticBag diagnosticBag, Location location); 276internal bool Add(UseSiteInfo<TAssemblySymbol> useSiteInfo, Location location) 282internal bool Add<TData>(UseSiteInfo<TAssemblySymbol> info, Func<TData, Location> getLocation, TData data) 293internal bool ReportUseSiteDiagnostic(DiagnosticInfo? info, Location location) 296internal bool ReportUseSiteDiagnostic<TData>(DiagnosticInfo? info, Func<TData, Location> getLocation, TData data)
CodeGen\LocalConstantDefinition.cs (2)
21Location location, 38public Location Location { get; }
CodeGen\LocalDefinition.cs (3)
89public Location Location 95ImmutableArray<Location> locations = _symbolOpt.Locations; 101return Location.None;
CodeGen\SignatureOnlyLocalDefinition.cs (2)
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 ?? ""));
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (3)
66public override Location Location => _originalDiagnostic.Location; 67public override IReadOnlyList<Location> AdditionalLocations => _originalDiagnostic.AdditionalLocations; 94internal override Diagnostic WithLocation(Location location)
CommandLine\SarifErrorLogger.cs (2)
39protected abstract void WritePhysicalLocation(Location diagnosticLocation); 118protected static bool HasPath(Location location)
CommandLine\SarifV1ErrorLogger.cs (4)
91private void WriteLocations(Location location, IReadOnlyList<Location> additionalLocations) 114foreach (var additionalLocation in additionalLocations) 136protected override void WritePhysicalLocation(Location location)
CommandLine\SarifV2ErrorLogger.cs (4)
130private void WriteLocations(Location location, IReadOnlyList<Location> additionalLocations) 153foreach (var additionalLocation in additionalLocations) 170protected override void WritePhysicalLocation(Location diagnosticLocation)
Compilation\Compilation.cs (30)
1298ImmutableArray<Location?> elementLocations = default, 1339ImmutableArray<Location?> elementLocations) 1389ImmutableArray<Location?> elementLocations) 1403ImmutableArray<Location?> elementLocations, 1415ImmutableArray<Location?> elementLocations = default, 1435ImmutableArray<Location?> elementLocations) 1443ImmutableArray<Location?> elementLocations, 1456ImmutableArray<Location> memberLocations = default, 1525ImmutableArray<Location> memberLocations) 1533ImmutableArray<Location> memberLocations, 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)); 3588internal abstract int CompareSourceLocations(Location loc1, Location loc2); 3606where TLocation : Location 3622where TLocation : Location
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 (5)
80public Diagnostic CreateDiagnostic(int code, Location location) 93public abstract Diagnostic CreateDiagnostic(int code, Location location, params object[] args); 210public abstract void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity); 211public abstract void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity); 257diagnostics.Add(CreateDiagnostic(ERR_OutputWriteFailed, Location.None, filePath, e.Message));
Diagnostic\Diagnostic.cs (28)
43/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 48Location? location, 58/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 68Location? location, 79/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 89Location? location, 90IEnumerable<Location>? additionalLocations, 100/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 115Location? location, 116IEnumerable<Location>? additionalLocations, 127/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 143Location? location, 145IEnumerable<Location>? additionalLocations, 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> 205Location? location = null, 206IEnumerable<Location>? additionalLocations = null, 228/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 256Location? location = null, 257IEnumerable<Location>? additionalLocations = null, 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. 392public abstract Location Location { get; } 398public abstract IReadOnlyList<Location> AdditionalLocations { get; } 453internal abstract Diagnostic WithLocation(Location location); 506foreach (var location in AdditionalLocations) 516static bool isLocationWithinSpan(Location location, SyntaxTree tree, TextSpan? filterSpan)
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (3)
71public override Location Location 76public override IReadOnlyList<Location> AdditionalLocations 108internal override Diagnostic WithLocation(Location location)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (13)
24private readonly Location _location; 25private readonly IReadOnlyList<Location> _additionalLocations; 34Location location, 35IEnumerable<Location>? additionalLocations, 49_location = location ?? Location.None; 50_additionalLocations = additionalLocations?.ToImmutableArray() ?? SpecializedCollections.EmptyReadOnlyList<Location>(); 60Location location, 61IEnumerable<Location>? additionalLocations, 71bool isEnabledByDefault, int warningLevel, Location location, 72IEnumerable<Location>? additionalLocations, IEnumerable<string>? customTags, 130public override Location Location 135public override IReadOnlyList<Location> AdditionalLocations 179internal override Diagnostic WithLocation(Location location)
Diagnostic\DiagnosticDescriptor.cs (1)
244var effectiveDiagnostic = compilationOptions.FilterDiagnostic(Diagnostic.Create(this, Location.None), CancellationToken.None);
Diagnostic\DiagnosticInfo.cs (2)
290public virtual IReadOnlyList<Location> AdditionalLocations 294return SpecializedCollections.EmptyReadOnlyList<Location>();
Diagnostic\DiagnosticWithInfo.cs (5)
21private readonly Location _location; 24internal DiagnosticWithInfo(DiagnosticInfo info, Location location, bool isSuppressed = false) 33public override Location Location 38public override IReadOnlyList<Location> AdditionalLocations 195internal override Diagnostic WithLocation(Location location)
Diagnostic\Location.cs (11)
122public static bool operator ==(Location? left, Location? right) 132public static bool operator !=(Location? left, Location? right) 153public static Location None { get { return NoLocation.Singleton; } } 156/// Creates an instance of a <see cref="Location"/> for a span in a <see cref="SyntaxTree"/>. 158public static Location Create(SyntaxTree syntaxTree, TextSpan textSpan) 169/// Creates an instance of a <see cref="Location"/> for a span in a file. 171public static Location Create(string filePath, TextSpan textSpan, LinePositionSpan lineSpan) 182/// Creates an instance of a <see cref="Location"/> for a span in a file with a mapped file and span. 184public static Location Create(string filePath, TextSpan textSpan, LinePositionSpan lineSpan, string mappedFilePath, LinePositionSpan mappedLineSpan)
Diagnostic\NoLocation.cs (1)
13public static readonly Location Singleton = new NoLocation();
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1245private bool IsInGeneratedCode(Location location, Compilation compilation, CancellationToken cancellationToken)
DiagnosticAnalyzer\AnalyzerExecutor.cs (3)
1252return Diagnostic.Create(descriptor, Location.None, messageArguments); 1299return Diagnostic.Create(descriptor, Location.None, messageArguments); 1514foreach (var location in symbol.Locations)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
908foreach (var location in symbolDeclaredEvent.Symbol.Locations)
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (5)
54private static bool IsSourceLocation(Location location) 62Func<Location, bool> locationFilter, 97public override Location Location => _original.Location; 98public override IReadOnlyList<Location> AdditionalLocations => _original.AdditionalLocations; 122internal override Diagnostic WithLocation(Location location)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (2)
1641/// A diagnostic in a non-source document should be created with a non-source <see cref="Location"/>, 1642/// which can be created using <see cref="Location.Create(string, TextSpan, LinePositionSpan)"/> API.
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (2)
81foreach (var location in diagnostic.AdditionalLocations) 88private static void VerifyDiagnosticLocationInCompilation(string id, Location location, Compilation compilation)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
153var location = diagnostic.Location;
Emit\Context.cs (1)
23public Location? Location => _syntaxNode?.Location ?? SyntaxReference?.GetLocation();
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,
MetadataReference\PortableExecutableReference.cs (1)
186internal static Diagnostic ExceptionToDiagnostic(Exception e, CommonMessageProvider messageProvider, Location location, string display, MetadataImageKind kind)
MetadataReference\ReferenceDirective.cs (2)
16public readonly Location? Location; 18public ReferenceDirective(string file, Location location)
PEWriter\Members.cs (2)
359/// Use <see cref="Location.None"/> rather than null. 361Location Location { get; }
PEWriter\MetadataWriter.cs (7)
1356Location location = GetNamedEntityLocation(errorEntity); 1365Location location = GetNamedEntityLocation(errorEntity); 1389Location location = GetNamedEntityLocation(errorEntity); 1399Location location = GetNamedEntityLocation(errorEntity); 1439private static Location GetNamedEntityLocation(INamedEntity errorEntity) 1455protected static Location GetSymbolLocation(ISymbolInternal symbolOpt) 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 (12)
221ImmutableArray<Location> referenceDirectiveLocations; 269Location location; 277location = Location.None; 475private Metadata? GetMetadata(PortableExecutableReference peReference, CommonMessageProvider messageProvider, Location location, DiagnosticBag diagnostics) 547var metadata = GetMetadata(peReference, MessageProvider, Location.None, diagnostics); 559diagnostics.Add(MessageProvider.CreateDiagnostic(MessageProvider.ERR_MetadataFileNotAssembly, Location.None, peReference.Display ?? "")); 668Location location, 793out ImmutableArray<Location> referenceDirectiveLocations) 796ArrayBuilder<Location>? referenceDirectiveLocationsBuilder = null; 829referenceDirectiveLocationsBuilder = ArrayBuilder<Location>.GetInstance(); 855referenceDirectiveLocations = referenceDirectiveLocationsBuilder?.ToImmutableAndFree() ?? ImmutableArray<Location>.Empty; 868private static PortableExecutableReference? ResolveReferenceDirective(string reference, Location location, TCompilation compilation)
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);
Symbols\ISymbol.cs (1)
171ImmutableArray<Location> Locations { get; }
Symbols\ISymbolExtensions.cs (1)
111foreach (var location in symbol.Locations)
Symbols\ISymbolInternal.cs (1)
97ImmutableArray<Location> Locations { get; }
Syntax\SyntaxNode.cs (2)
673public Location GetLocation() 678internal Location Location
Syntax\SyntaxNodeOrToken.cs (1)
828public Location? GetLocation()
Syntax\SyntaxReference.cs (1)
50internal Location GetLocation()
Syntax\SyntaxToken.cs (2)
642public Location GetLocation() 647? Location.None
Syntax\SyntaxTree.cs (1)
340public abstract Location GetLocation(TextSpan span);
Syntax\SyntaxTrivia.cs (1)
409public Location GetLocation()
Microsoft.CodeAnalysis.CodeStyle (95)
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
135NotificationOption2 notificationOption, ImmutableArray<Location> additionalLocations,
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
49var location = parent.GetLocation();
src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (3)
98internal Location GetLocation(SyntaxTree syntaxTree) 102return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, 0)); 105return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, _commentPrefixLength));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (2)
97var location = Location.Create(tree, change.Span);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (26)
25/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 42Location location, 45IEnumerable<Location>? additionalLocations, 72/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 90Location location, 93ImmutableArray<Location> additionalLocations, 94ImmutableArray<Location> additionalUnnecessaryLocations, 109Location location, 113ImmutableArray<Location> additionalLocations, 114ImmutableArray<Location> additionalUnnecessaryLocations) 136/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 158Location location, 161ImmutableArray<Location> additionalLocations, 162ImmutableArray<Location> additionalUnnecessaryLocations, 179Location location, 183ImmutableArray<Location> additionalLocations, 184ImmutableArray<Location> additionalUnnecessaryLocations, 205Location location, 209IEnumerable<Location> additionalLocations, 240/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 257Location location, 260IEnumerable<Location>? additionalLocations,
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (4)
126var option = GetCodeStyleOption(field, symbolEndContext.Options, out var location); 223var option = GetCodeStyleOption(field, options, out var location); 236private static Location GetDiagnosticLocation(IFieldSymbol field) 295private static CodeStyleOption2<bool> GetCodeStyleOption(IFieldSymbol field, AnalyzerOptions options, out Location diagnosticLocation)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
32protected abstract Location GetDiagnosticLocation(SyntaxNode block);
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
79Location.Create(badTrivia.SyntaxTree!, new TextSpan(badTrivia.SpanStart, 0)),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
40protected abstract Location GetDiagnosticLocation(TSwitchSyntax switchBlock);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
38protected sealed override Location GetDiagnosticLocation(TSwitchSyntax switchBlock)
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
52protected abstract Location GetLocation(IOperation operation);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (3)
127private static Location GetDiagnosticSquiggleLocation(TParenthesizedExpressionSyntax parenthesizedExpression, CancellationToken cancellationToken) 129var parenthesizedExpressionLocation = parenthesizedExpression.GetLocation(); 135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
643ImmutableArray<Location> additionalLocations;
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
130private static Location GetDiagnosticLocation(ISymbol symbol) 539var diagnosticLocation = GetDiagnosticLocation(member); 548: ImmutableArray<Location>.Empty;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
110protected abstract Location GetDefinitionLocationToFade(IOperation unusedDefinition);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
132var location = parameter.Locations[0];
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
63var firstUnnecessaryLocation = unnecessaryLocations[0];
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
29out string? formatString, out ImmutableArray<Location> unnecessaryLocations)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
245ImmutableArray<Location> locations,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
22public static ImmutableArray<Location> GetLocationsToFade(
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (4)
136private ImmutableArray<Location> FadeOutCode( 143using var locations = TemporaryArray<Location>.Empty; 151var location1 = Location.Create(syntaxTree, TextSpan.FromBounds(
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (3)
46var diagnosticLocation = owningSymbol.Locations[0]; 77var operationLocation = operation.Syntax.GetLocation(); 78var declarationLocation = context.OwningSymbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).GetLocation();
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
352var invalidPlaceholderLocation = Location.Create(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
54public static bool ShouldAnalyzeLocation(this SymbolStartAnalysisContext context, Location location) 74public static bool ShouldAnalyzeLocation(this SymbolAnalysisContext context, Location location)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (8)
13public static SyntaxTree GetSourceTreeOrThrow(this Location location) 19public static SyntaxToken FindToken(this Location location, CancellationToken cancellationToken) 22public static SyntaxNode FindNode(this Location location, CancellationToken cancellationToken) 25public static SyntaxNode FindNode(this Location location, bool getInnermostNodeForTie, CancellationToken cancellationToken) 28public static SyntaxNode FindNode(this Location location, bool findInsideTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken) 31public static bool IsVisibleSourceLocation(this Location loc) 42public static bool IntersectsWith(this Location loc1, Location loc2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
478Location GetDeconstructionReferenceLocation(SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
76private static ImmutableArray<Location> ReadPropertyLocations(SymbolKeyReader reader, out string? failureReason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 25using var _ = ArrayBuilder<Location>.GetInstance(out var result); 27foreach (var location in symbol.Locations) 220bool TryResolveLocation(Location loc, int index, out SymbolKeyResolution resolution, out string? reason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
325private readonly ReadFunction<Location?> _readLocation; 643public Location? ReadLocation(out string? failureReason) 657return Location.None; 679return Location.Create(syntaxTree, new TextSpan(start, length)); 689return Location.None; 715return Location.None; 723public SymbolKeyResolution? ResolveLocation(Location location) 757public PooledArrayBuilder<Location?> ReadLocationArray(out string? failureReason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
60private readonly Action<Location?> _writeLocation; 247internal void WriteLocation(Location? location) 298internal void WriteLocationArray(ImmutableArray<Location> array)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (3)
27using var _2 = ArrayBuilder<Location>.GetInstance(out var locations); 32locations.Add(element.Locations.FirstOrDefault() ?? Location.None); 128private static ImmutableArray<Location> ReadElementLocations(SymbolKeyReader reader, out string? failureReason)
Microsoft.CodeAnalysis.CodeStyle.Fixes (30)
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
50var location = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (2)
44protected Location location = null; 45public Location Location
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
62public Location AfterThisLocation { get; private set; } 63public Location BeforeThisLocation { get; private set; }
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
194var location = referenceLocation.Location;
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44var syntaxNode = Location.Create(syntaxTree, context.Span).FindNode(context.CancellationToken);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
144var switchLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
60foreach (var location in diagnostic.AdditionalLocations) 69Location location,
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
60var loc = diagnostic.AdditionalLocations[0];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
482protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Location? location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (2)
129Location? location, 139Location? location,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (14)
33public Location? ContextLocation { get; } 43public Location? AfterThisLocation { get; } 53public Location? BeforeThisLocation { get; } 134Location? contextLocation = null, 135Location? afterThisLocation = null, 136Location? beforeThisLocation = null, 168private static void CheckLocation(Location? location, string name) 176internal Location? BestLocation 180Optional<Location> contextLocation = default, 181Optional<Location?> afterThisLocation = default, 182Optional<Location?> beforeThisLocation = default, 195var newContextLocation = contextLocation.HasValue ? contextLocation.Value : this.ContextLocation; 196var newAfterThisLocation = afterThisLocation.HasValue ? afterThisLocation.Value : this.AfterThisLocation; 197var newBeforeThisLocation = beforeThisLocation.HasValue ? beforeThisLocation.Value : this.BeforeThisLocation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (1)
192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
140public ImmutableArray<Location> Locations
Microsoft.CodeAnalysis.CSharp (754)
Binder\Binder.cs (6)
534internal static void Error(BindingDiagnosticBag diagnostics, DiagnosticInfo info, Location location) 561var location = syntax.GetLocation(); 568var location = syntax.GetLocation(); 573internal static void Error(BindingDiagnosticBag diagnostics, ErrorCode code, Location location) 578internal static void Error(BindingDiagnosticBag diagnostics, ErrorCode code, Location location, params object[] args) 812Location? location = null,
Binder\Binder.QueryUnboundLambdaState.cs (1)
52public override Location ParameterLocation(int index) { return _parameters[index].TryGetFirstLocation(); }
Binder\Binder.ValueChecks.cs (3)
424ArrayBuilder<(string Name, Location Location)?>? namesBuilder = null; 428namesBuilder = ArrayBuilder<(string Name, Location Location)?>.GetInstance(argumentNamesOpt.Length); 3022public override ImmutableArray<Location> Locations
Binder\Binder_Constraints.cs (1)
447Location location,
Binder\Binder_Deconstruct.cs (2)
477var locationsBuilder = ArrayBuilder<Location?>.GetInstance(leftLength); 551var locationsBuilder = ArrayBuilder<Location?>.GetInstance(count);
Binder\Binder_Expressions.cs (16)
1016var elementLocations = ArrayBuilder<Location>.GetInstance(arguments.Count); 1492internal static bool CheckManagedAddr(CSharpCompilation compilation, TypeSymbol type, Location location, BindingDiagnosticBag diagnostics, bool errorForManaged = false) 1502internal static bool CheckManagedAddr(CSharpCompilation compilation, TypeSymbol type, ManagedKind managedKind, Location location, BindingDiagnosticBag diagnostics, bool errorForManaged = false) 2482var location = thisOrBaseToken.GetLocation(); 4847Location errorLocation; 4916Location errorLocation, 5055static void validateRecordCopyConstructor(MethodSymbol constructor, NamedTypeSymbol baseType, MethodSymbol resultMember, Location errorLocation, BindingDiagnosticBag diagnostics) 6167Location location = creationSyntax switch 7099Location errorLocation, 7200internal static bool ReportConstructorUseSiteDiagnostics(Location errorLocation, BindingDiagnosticBag diagnostics, bool suppressUnsupportedRequiredMembersError, in CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 7297diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 1, 1))); 7301diagnostics.Add(new CSDiagnosticInfo(ErrorCode.WRN_LowercaseEllSuffix), Location.Create(node.SyntaxTree, new TextSpan(token.Span.End - 2, 1))); 9135Location location; 10865var location = syntax.Location; 10905Location location = null, SyntaxNode node = null) 10938Location getErrorLocation()
Binder\Binder_InterpolatedString.cs (2)
912var parameterNamesAndLocationsBuilder = ArrayBuilder<(string, Location)?>.GetInstance(3); 963ImmutableArray<(string, Location)?> parameterNamesAndLocations;
Binder\Binder_Invocation.cs (3)
85ImmutableArray<(string Name, Location Location)?> names = default, 1468ArrayBuilder<(string Name, Location Location)?>? namesBuilder, 1802private static Location GetLocationForOverloadResolutionDiagnostic(SyntaxNode node, SyntaxNode expression)
Binder\Binder_Lookup.cs (2)
1442diagInfo = diagnose ? new CSDiagnosticInfo(ErrorCode.ERR_BadAccess, new[] { unwrappedSymbol }, unwrappedSymbols, additionalLocations: ImmutableArray<Location>.Empty) : null; 1466diagInfo = new CSDiagnosticInfo(ErrorCode.ERR_BadAccess, new[] { unwrappedSymbol }, ImmutableArray.Create<Symbol>(unwrappedSymbol), additionalLocations: ImmutableArray<Location>.Empty);
Binder\Binder_NameConflicts.cs (4)
13private bool ValidateLambdaParameterNameConflictsInScope(Location location, string name, BindingDiagnosticBag diagnostics) 20Location location = GetLocation(symbol); 24private static Location GetLocation(Symbol symbol) 93private bool ValidateNameConflictsInScope(Symbol? symbol, Location location, string name, BindingDiagnosticBag diagnostics)
Binder\Binder_Statements.cs (9)
1994private static Location GetAnonymousFunctionLocation(SyntaxNode node) 2183var lambdaParameterLocation = anonymousFunction.ParameterLocation(i); 2457var location = nodeForError.Location; 3381Location location = GetLocationForDiagnostics(syntax); 3399private static Location GetLocationForDiagnostics(SyntaxNode node) 3404return Location.Create(lambdaSyntax.SyntaxTree, 3408return Location.Create(anonymousMethodSyntax.SyntaxTree, 3917Location diagnosticsLocation = constructor.GetFirstLocationOrNone(); 3978Location diagnosticsLocation = constructor.GetFirstLocationOrNone();
Binder\Binder_Symbols.cs (20)
456diagnostics.Add(info, Location.Create(@delegate.SyntaxTree, TextSpan.FromBounds(@delegate.SpanStart, asterisk.Span.End))); 682var locations = ArrayBuilder<Location>.GetInstance(numElements); 748internal static void ReportMissingTupleElementNamesAttributesIfNeeded(CSharpCompilation compilation, Location location, BindingDiagnosticBag diagnostics) 1662internal static NamedTypeSymbol GetSpecialType(CSharpCompilation compilation, SpecialType typeId, Location location, BindingDiagnosticBag diagnostics) 1759internal static bool ReportUseSite(Symbol symbol, BindingDiagnosticBag diagnostics, Location location) 1777internal NamedTypeSymbol GetWellKnownType(WellKnownType type, BindingDiagnosticBag diagnostics, Location location) 1791internal static NamedTypeSymbol GetWellKnownType(CSharpCompilation compilation, WellKnownType type, BindingDiagnosticBag diagnostics, Location location) 1811internal Symbol GetWellKnownTypeMember(WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1820internal static Symbol GetWellKnownTypeMember(CSharpCompilation compilation, WellKnownMember member, BindingDiagnosticBag diagnostics, Location location = null, SyntaxNode syntax = null, bool isOptional = false) 1891Location la = snd.GetFirstLocation(); 1892Location lb = fst.GetFirstLocation(); 2547var location = where.Location; 2628protected virtual AssemblySymbol GetForwardedToAssemblyInUsingNamespaces(string metadataName, ref NamespaceOrTypeSymbol qualifierOpt, BindingDiagnosticBag diagnostics, Location location) 2633protected AssemblySymbol GetForwardedToAssembly(string fullName, BindingDiagnosticBag diagnostics, Location location) 2701protected AssemblySymbol GetForwardedToAssembly(string name, int arity, ref NamespaceOrTypeSymbol qualifierOpt, BindingDiagnosticBag diagnostics, Location location) 2736internal static bool CheckFeatureAvailability(SyntaxNode syntax, MessageID feature, BindingDiagnosticBag diagnostics, Location? location = null) 2742internal static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, BindingDiagnosticBag diagnostics, Location location) 2745private static bool CheckFeatureAvailability(SyntaxNode syntax, MessageID feature, DiagnosticBag? diagnostics, Location? location = null) 2751private static bool CheckFeatureAvailability(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, Location location) 2757private static bool CheckFeatureAvailability<TData>(SyntaxTree tree, MessageID feature, DiagnosticBag? diagnostics, TData data, Func<TData, Location> getLocation, bool forceWarning = false)
Binder\Binder_TupleOperators.cs (2)
318Location location = ((BoundTupleExpression)(useRight ? right : left)).Arguments[i].Syntax.Parent.Location; 407ImmutableArray<Location> elementLocations = elements.SelectAsArray(e => e.Syntax.Location);
Binder\Binder_Unsafe.cs (1)
41internal bool ReportUnsafeIfNotAllowed(Location location, BindingDiagnosticBag diagnostics)
Binder\BinderFactory.BinderFactoryVisitor.cs (3)
640private static bool InSpan(Location location, SyntaxTree syntaxTree, TextSpan span) 649private static bool InSpan(ImmutableArray<Location> locations, SyntaxTree syntaxTree, TextSpan span) 652foreach (var loc in locations)
Binder\BindingDiagnosticBag.cs (8)
105internal bool ReportUseSite(Symbol? symbol, Location location) 108internal bool ReportUseSite<TData>(Symbol? symbol, Func<TData, Location> getLocation, TData data) 149protected override bool ReportUseSiteDiagnostic(DiagnosticInfo diagnosticInfo, DiagnosticBag diagnosticBag, Location location) 154internal CSDiagnosticInfo Add(ErrorCode code, Location location) 167internal CSDiagnosticInfo Add(ErrorCode code, Location location, params object[] args) 174internal CSDiagnosticInfo Add(ErrorCode code, Location location, ImmutableArray<Symbol> symbols, params object[] args) 176var info = new CSDiagnosticInfo(code, args, symbols, ImmutableArray<Location>.Empty); 181internal void Add(DiagnosticInfo? info, Location location)
Binder\ExecutableCodeBinder.cs (1)
122Location errorLocation = (iterator as SynthesizedSimpleProgramEntryPointSymbol)?.ReturnTypeSyntax.GetLocation() ?? iterator.GetFirstLocation();
Binder\HostObjectModeBinder.cs (1)
43ImmutableArray<Location>.Empty
Binder\InMethodBinder.cs (5)
146RefKind refKind, TypeSymbol returnType, Location errorLocation, BindingDiagnosticBag diagnostics) 242private static bool ReportConflictWithParameter(Symbol parameter, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 247var oldLocation = parameter.GetFirstLocationOrNone(); 248Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.GetRoot().ContainsDiagnostics == true, 322internal override bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics)
Binder\LocalScopeBinder.cs (2)
501private bool ReportConflictWithLocal(Symbol local, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 541internal virtual bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics)
Binder\RefSafetyAnalysis.cs (2)
1109var location = syntax.GetLocation(); 1114private static void Error(BindingDiagnosticBag diagnostics, ErrorCode code, Location location, params object[] args)
Binder\Semantics\OverloadResolution\AnalyzedArguments.cs (3)
16public readonly ArrayBuilder<(string Name, Location Location)?> Names; 24this.Names = new ArrayBuilder<(string, Location)?>(32); 150ImmutableArray<(string, Location)?> argumentNamesOpt)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
3601bool result = !_binder.MethodIsCompatibleWithDelegateOrFunctionPointer(node.ReceiverOpt, conv.IsExtensionMethod, conv.Method, delegateType, Location.None, BindingDiagnosticBag.Discarded);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (19)
190Location location, 478Location badName = arguments.Names[badArg].GetValueOrDefault().Location; 580private static void ReportUnsupportedMetadata(Location location, BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, MemberResolutionResult<TMember> firstUnsupported) 595private static void ReportWrongCallingConvention(Location location, BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, MemberResolutionResult<TMember> firstSupported, MethodSymbol target) 623Location location) 642Location location, 697private bool HadReturnMismatch(Location location, BindingDiagnosticBag diagnostics, TypeSymbol delegateOrFunctionPointerType) 718private bool HadConstraintFailure(Location location, BindingDiagnosticBag diagnostics) 743Location location, 799(string badName, Location location) = arguments.Names[badArg].GetValueOrDefault(); 819(string badName, Location location) = arguments.Names[badArg].GetValueOrDefault(); 833(string name, Location location) = arguments.Names[result.Result.FirstBadArgument].GetValueOrDefault(); 859(string badName, Location location) = arguments.Names[badArg].GetValueOrDefault(); 882Location location) 927Location location, 966Location location) 1086Location location, 1389private bool HadAmbiguousWorseMethods(BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, Location location, bool isQuery, BoundExpression receiver, string name) 1453private bool HadAmbiguousBestMethods(BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, Location location)
Binder\WithLambdaParametersBinder.cs (3)
116private static bool ReportConflictWithParameter(ParameterSymbol parameter, Symbol newSymbol, string name, Location newLocation, BindingDiagnosticBag diagnostics) 118var oldLocation = parameter.GetFirstLocation(); 158internal override bool EnsureSingleDefinition(Symbol symbol, string name, Location location, BindingDiagnosticBag diagnostics)
Binder\WithUsingNamespacesAndTypesBinder.cs (1)
51protected override AssemblySymbol? GetForwardedToAssemblyInUsingNamespaces(string name, ref NamespaceOrTypeSymbol qualifierOpt, BindingDiagnosticBag diagnostics, Location location)
BoundTree\BoundTreeVisitors.cs (1)
183public static Location GetTooLongOrComplexExpressionErrorLocation(BoundNode node)
BoundTree\UnboundLambda.cs (3)
481public Location ParameterLocation(int index) { return Data.ParameterLocation(index); } 561public abstract Location ParameterLocation(int index); 1499public override Location ParameterLocation(int index)
CodeGen\Optimizer.cs (1)
2396public override ImmutableArray<Location> Locations
CommandLine\CSharpCommandLineParser.cs (1)
1540new CSharpRequiredLanguageVersion(MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())), Location.None));
Compilation\CSharpCompilation.cs (20)
530diagnostics.Add(ErrorCode.ERR_DebugEntryPointNotSourceMethodDefinition, Location.None); 1779ImmutableArray<Location>.Empty 2134additionalLocations: viableEntryPoints.Select(m => m.GetFirstLocation()).OfType<Location>().AsImmutable()); 2431private ConcurrentDictionary<(string FilePath, int Position), OneOrMany<(Location AttributeLocation, MethodSymbol Interceptor)>>? _interceptions; 2433internal void AddInterception(string filePath, int position, Location attributeLocation, MethodSymbol interceptor) 2459internal (Location AttributeLocation, MethodSymbol Interceptor)? TryGetInterceptor(SimpleNameSyntax? node) 2957var location = syntaxTree.GetLocation(TextSpan.FromBounds(0, 0)); 2976new CSharpRequiredLanguageVersion(MessageID.IDS_FeatureNullableReferenceTypes.RequiredVersion())), Location.None)); 3592var location = symbol.GetFirstLocation(); 3619foreach ((_, OneOrMany<(Location, MethodSymbol)> interceptionsOfAGivenLocation) in _interceptions) 4119ImmutableArray<Location?> elementLocations, 4145ImmutableArray<Location?> elementLocations, 4174ImmutableArray<Location> memberLocations, 4194var location = memberLocations.IsDefault ? Location.None : memberLocations[i]; 4199var descriptor = new AnonymousTypeDescriptor(fields.ToImmutableAndFree(), Location.None); 4521internal override int CompareSourceLocations(Location loc1, Location loc2) 4648internal bool HasDynamicEmitAttributes(BindingDiagnosticBag diagnostics, Location location) 4654internal bool HasTupleNamesAttributes(BindingDiagnosticBag diagnostics, Location location) =>
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
150var location = NoLocation.Singleton;
Compilation\CSharpDiagnosticFilter.cs (1)
141Location location,
Compilation\CSharpSemanticModel.cs (1)
3232foreach (var location in symbol.Locations)
Compilation\SyntaxTreeSemanticModel.cs (3)
1812var loc = partial.GetFirstLocation(); 2178foreach (var location in symbol.Locations) 2388if (symbol.TryGetFirstLocation() is not Location location)
Compiler\ClsComplianceChecker.cs (14)
118Location attributeLocation; 121Location warningLocation = i == 0 ? attributeLocation : module.GetFirstLocation(); 346Location attributeLocation; 609Location warningLocation; 625Location warningLocation; 643Location warningLocation; 655private bool TryGetAttributeWarningLocation(CSharpAttributeData attribute, out Location location) 694Location attributeLocation; 704Location attributeLocation; 766private bool TryGetClsComplianceAttributeLocation(ImmutableArray<CSharpAttributeData> attributes, out Location attributeLocation) 1148Location ignoredLocation; 1184private bool? GetDeclaredCompliance(Symbol symbol, out Location attributeLocation) 1253private void AddDiagnostic(ErrorCode code, Location location) 1260private void AddDiagnostic(ErrorCode code, Location location, params object[] args)
Compiler\DocumentationCommentCompiler.cs (7)
112diagnostics.Add(ErrorCode.ERR_DocFileGen, Location.None, e.Message); 315Location location = GetLocationInTreeReportingDocumentationCommentDiagnostics(symbol); 385Location location = parameter.GetFirstLocation(); 400Location location = typeParameter.GetFirstLocation(); 563Location location = new SourceLocation(trivia.SyntaxTree, new TextSpan(trivia.SpanStart, 0)); 599private static Location GetLocationInTreeReportingDocumentationCommentDiagnostics(Symbol symbol) 601foreach (Location location in symbol.Locations)
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (14)
37private HashSet<Location> _inProgressIncludeElementNodes; 268Location location = GetIncludeElementLocation(includeElement, ref currentXmlFilePath, ref originatingSyntax); 404Location errorLocation = XmlLocation.Create(e, resolvedFilePath); 434private static string MakeCommentMessage(Location location, MessageID messageId) 446private bool EnterIncludeElement(Location location) 450_inProgressIncludeElementNodes = new HashSet<Location>(); 456private bool LeaveIncludeElement(Location location) 464private Location GetIncludeElementLocation(XElement includeElement, ref string currentXmlFilePath, ref CSharpSyntaxNode originatingSyntax) 466Location location = includeElement.Annotation<Location>(); 508Location sourceLocation = originatingSyntax.Location; 530Location sourceLocation = originatingSyntax.Location; 634private void RecordSyntaxDiagnostics(CSharpSyntaxNode treelessSyntax, Location sourceLocation) 650private void RecordBindingDiagnostics(BindingDiagnosticBag bindingDiagnostics, Location sourceLocation)
Declarations\MergedNamespaceDeclaration.cs (3)
57public ImmutableArray<Location> NameLocations 63return ImmutableArray.Create<Location>(_declarations[0].NameLocation); 67var builder = ArrayBuilder<Location>.GetInstance();
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);
Emitter\Model\PEModuleBuilder.cs (9)
231var location = GetSmallestSourceLocationOrNull(symbol); 343Location location = null; 443var location = GetSmallestSourceLocationOrNull(symbol); 450private void AddSymbolLocation(MultiDictionary<Cci.DebugSourceDocument, Cci.DefinitionWithLocation> result, Location location, Cci.IDefinition definition) 468private Location GetSmallestSourceLocationOrNull(Symbol symbol) 473Location result = null; 474foreach (var loc in symbol.Locations) 1758Location locationOpt = null) 1784internal void EnsureParamCollectionAttributeExists(BindingDiagnosticBag diagnostics, Location location)
Errors\CSDiagnostic.cs (2)
16internal CSDiagnostic(DiagnosticInfo info, Location location, bool isSuppressed = false) 26internal override Diagnostic WithLocation(Location location)
Errors\CSDiagnosticInfo.cs (7)
20private readonly IReadOnlyList<Location> _additionalLocations; 23: this(code, Array.Empty<object>(), ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty) 28: this(code, args, ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty) 33: this(code, args, symbols, ImmutableArray<Location>.Empty) 37internal CSDiagnosticInfo(ErrorCode code, object[] args, ImmutableArray<Symbol> symbols, ImmutableArray<Location> additionalLocations) 42_additionalLocations = additionalLocations.IsDefaultOrEmpty ? SpecializedCollections.EmptyReadOnlyList<Location>() : additionalLocations; 55public override IReadOnlyList<Location> AdditionalLocations => _additionalLocations;
Errors\DiagnosticBagExtensions.cs (6)
21internal static CSDiagnosticInfo Add(this DiagnosticBag diagnostics, ErrorCode code, Location location) 37internal static CSDiagnosticInfo Add(this DiagnosticBag diagnostics, ErrorCode code, Location location, params object[] args) 45internal static CSDiagnosticInfo Add(this DiagnosticBag diagnostics, ErrorCode code, Location location, ImmutableArray<Symbol> symbols, params object[] args) 47var info = new CSDiagnosticInfo(code, args, symbols, ImmutableArray<Location>.Empty); 53internal static void Add(this DiagnosticBag diagnostics, DiagnosticInfo info, Location location) 83Location location,
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
48var location = questionToken.GetLocation();
Errors\MessageID.cs (7)
351Location? location = null) 365Location? location = null) 379Location? location = null) 393Location? location = null) 407Func<TData, Location> getLocation, 422Func<TData, Location> getLocation, 437Location location)
Errors\MessageProvider.cs (6)
87public override Diagnostic CreateDiagnostic(int code, Location location, params object[] args) 89var info = new CSDiagnosticInfo((ErrorCode)code, args, ImmutableArray<Symbol>.Empty, ImmutableArray<Location>.Empty); 95return new CSDiagnostic(info, Location.None); 128Location.None, 205public override void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity) 212public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
FlowAnalysis\AbstractFlowPass.cs (3)
330Location location) 338protected virtual void LeaveParameter(ParameterSymbol parameter, SyntaxNode syntax, Location location) 494protected bool ShouldAnalyzeOutParameters(out Location location)
FlowAnalysis\AbstractFlowPass_LocalFunctions.cs (1)
114Location? location = localFuncSymbol.TryGetFirstLocation();
FlowAnalysis\ControlFlowPass.cs (1)
341var sourceLocation = node.Syntax.Location;
FlowAnalysis\DataFlowsInWalker.cs (1)
119Location location)
FlowAnalysis\DataFlowsOutWalker.cs (1)
264protected override void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location)
FlowAnalysis\DefiniteAssignment.cs (8)
113private readonly PooledDictionary<Symbol, Location> _unsafeAddressTakenVariables = PooledDictionary<Symbol, Location>.GetInstance(); 376Location location; 408var diagnosticLocation = CurrentSymbol is LambdaSymbol lambda 449protected virtual void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location) 687Location location; 1932protected override void LeaveParameters(ImmutableArray<ParameterSymbol> parameters, SyntaxNode syntax, Location location) 1943protected override void LeaveParameter(ParameterSymbol parameter, SyntaxNode syntax, Location location)
FlowAnalysis\NullableWalker.cs (22)
247/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 642var exitLocation = method is SynthesizedPrimaryConstructor || method.DeclaringSyntaxReferences.IsEmpty ? null : method.TryGetFirstLocation(); 703void checkMemberStateOnConstructorExit(MethodSymbol constructor, Symbol member, LocalState state, int thisSlot, Location? exitLocation, ImmutableArray<string> membersWithStateEnforcedByRequiredMembers, bool forcePropertyAnalysis) 1211Location location; 1304var location = syntaxOpt?.GetLocation() ?? methodMainNode.Syntax.GetLastToken().GetLocation(); 2303Location? location = null) 2510private void ReportNullabilityMismatchInAssignment(Location location, object sourceType, object destinationType) 2567private void ReportNonSafetyDiagnostic(Location location) 2577private void ReportDiagnostic(ErrorCode errorCode, Location location, params object[] arguments) 8633private void ReportNullabilityMismatchWithTargetDelegate(Location location, TypeSymbol targetType, MethodSymbol targetInvokeMethod, MethodSymbol sourceInvokeMethod, bool invokedAsExtensionMethod) 8651void reportBadDelegateReturn(BindingDiagnosticBag bag, MethodSymbol targetInvokeMethod, MethodSymbol sourceInvokeMethod, bool topLevel, (TypeSymbol targetType, Location location) arg) 8658void reportBadDelegateParameter(BindingDiagnosticBag bag, MethodSymbol sourceInvokeMethod, MethodSymbol targetInvokeMethod, ParameterSymbol parameter, bool topLevel, (TypeSymbol targetType, Location location) arg) 8667private void ReportNullabilityMismatchWithTargetDelegate(Location location, NamedTypeSymbol delegateType, BoundLambda lambda) 8688location = Location.Create(lambdaSyntax.SyntaxTree, new Text.TextSpan(start, lambdaSyntax.ArrowToken.Span.End - start)); 8722void reportBadDelegateReturn(BindingDiagnosticBag bag, MethodSymbol targetInvokeMethod, MethodSymbol sourceInvokeMethod, bool topLevel, Location location) 8729void reportBadDelegateParameter(BindingDiagnosticBag bag, MethodSymbol sourceInvokeMethod, MethodSymbol targetInvokeMethod, ParameterSymbol parameterSymbol, bool topLevel, Location location) 8791Location? diagnosticLocation = null, 9123Location getDiagnosticLocation() 9337Location diagnosticLocation) 9395Location operandLocation = conversionOperand.Syntax.GetLocation(); 9556Location diagnosticLocation) 10626private void ReportNullabilityMismatchInArgument(Location argumentLocation, TypeSymbol argumentType, ParameterSymbol? parameterOpt, TypeSymbol parameterType, bool forOutput)
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
51public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
FlowAnalysis\UnassignedVariablesWalker.cs (1)
70protected override void ReportUnassignedOutParameter(ParameterSymbol parameter, SyntaxNode node, Location location)
Generated\BoundNodes.xml.Generated.cs (3)
6283public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false) 6299public ImmutableArray<(string Name, Location Location)?> ArgumentNamesOpt { get; } 6307public BoundUnconvertedObjectCreationExpression Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder)
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
575if (p.RefKind != RefKind.None && p.TryGetFirstLocation() is Location location)
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (1)
204public override ImmutableArray<Location> Locations
Lowering\LocalRewriter\LocalRewriter.cs (2)
336Location location; 596private bool TryGetWellKnownTypeMember<TSymbol>(SyntaxNode? syntax, WellKnownMember member, [NotNullWhen(true)] out TSymbol? symbol, bool isOptional = false, Location? location = null) where TSymbol : Symbol
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)))
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.cs (2)
109public override ImmutableArray<Location> Locations 111get { return ImmutableArray<Location>.Empty; }
Lowering\SynthesizedMethodBaseSymbol.cs (1)
35Location location,
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
244var location = symbol.Locations.First();
Symbols\AliasSymbol.cs (5)
50private readonly ImmutableArray<Location> _locations; // NOTE: can be empty for the "global" alias. 55protected AliasSymbol(string aliasName, Symbol containingSymbol, ImmutableArray<Location> locations, bool isExtern) 70return new AliasSymbolFromResolvedTarget(globalNamespace, "global", globalNamespace, ImmutableArray<Location>.Empty, isExtern: false); 118public override ImmutableArray<Location> Locations 436internal AliasSymbolFromResolvedTarget(NamespaceOrTypeSymbol target, string aliasName, Symbol containingSymbol, ImmutableArray<Location> locations, bool isExtern)
Symbols\AnonymousTypes\AnonymousTypeDescriptor.cs (2)
18public readonly Location Location; 32public AnonymousTypeDescriptor(ImmutableArray<AnonymousTypeField> fields, Location location)
Symbols\AnonymousTypes\AnonymousTypeField.cs (2)
18public readonly Location Location; 38Location location,
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (9)
92private readonly ConcurrentDictionary<Location, bool> _sourceLocationsSeen = new ConcurrentDictionary<Location, bool>(); 99Location location = anonymous.GetFirstLocation(); 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); 827private int CompareLocations(Location x, Location y) 833else if (x == Location.None) 837else if (y == Location.None)
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (2)
171public sealed override ImmutableArray<Location> Locations 173get { return ImmutableArray.Create<Location>(this.TypeDescriptor.Location); }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (1)
86public override ImmutableArray<Location> Locations
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\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (2)
118public override ImmutableArray<Location> Locations 120get { return ImmutableArray<Location>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertyAccessorSymbol.cs (1)
59public override ImmutableArray<Location> Locations
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (5)
25private readonly ImmutableArray<Location> _locations; 30this(container, field, fieldTypeWithAnnotations, index, ImmutableArray<Location>.Empty, includeBackingField: true) 35this(container, field, field.TypeWithAnnotations, index, ImmutableArray.Create<Location>(field.Location), includeBackingField: false) 44ImmutableArray<Location> locations, 89public override ImmutableArray<Location> Locations
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (2)
54public override ImmutableArray<Location> Locations 56get { return ImmutableArray<Location>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (7)
36private Location _smallestLocation; 41internal AnonymousTypeOrDelegateTemplateSymbol(AnonymousTypeManager manager, Location location) 63internal Location SmallestLocation 91internal void AdjustLocation(Location location) 100Location currentSmallestLocation = _smallestLocation; 210public sealed override ImmutableArray<Location> Locations 212get { return ImmutableArray<Location>.Empty; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (2)
44public override ImmutableArray<Location> Locations 46get { return ImmutableArray<Location>.Empty; }
Symbols\ArrayTypeSymbol.cs (2)
310public override ImmutableArray<Location> Locations 314return ImmutableArray<Location>.Empty;
Symbols\Attributes\AttributeData.cs (8)
81internal abstract Location GetAttributeArgumentLocation(int parameterIndex); 399Location syntaxLocation = GetSecurityAttributeActionSyntaxLocation(nodeOpt, typedValue, out displayString); 429Location syntaxLocation = GetSecurityAttributeActionSyntaxLocation(nodeOpt, typedValue, out displayString); 445Location syntaxLocation = GetSecurityAttributeActionSyntaxLocation(nodeOpt, typedValue, out displayString); 459Location syntaxLocation = GetSecurityAttributeActionSyntaxLocation(nodeOpt, typedValue, out displayString); 470private static Location GetSecurityAttributeActionSyntaxLocation(AttributeSyntax? nodeOpt, TypedConstant typedValue, out object displayString) 535Location argSyntaxLocation = nodeOpt?.GetNamedArgumentSyntax(filePropName)?.Location ?? NoLocation.Singleton; 634Location attributeArgumentSyntaxLocation = this.GetAttributeArgumentLocation(0);
Symbols\Attributes\PEAttributeData.cs (1)
149internal override Location GetAttributeArgumentLocation(int parameterIndex)
Symbols\Attributes\RetargetingAttributeData.cs (1)
80internal override Location GetAttributeArgumentLocation(int parameterIndex) => _underlying.GetAttributeArgumentLocation(parameterIndex);
Symbols\Attributes\SourceAttributeData.cs (1)
165internal override Location GetAttributeArgumentLocation(int parameterIndex)
Symbols\Compilation_WellKnownMembers.cs (12)
512private void EnsureEmbeddableAttributeExists(EmbeddableAttributes attribute, BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 528internal void EnsureIsReadOnlyAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 533internal void EnsureRequiresLocationAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 538internal void EnsureParamCollectionAttributeExistsAndModifyCompilation(BindingDiagnosticBag? diagnostics, Location location) 543internal void EnsureIsByRefLikeAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 548internal void EnsureIsUnmanagedAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 553internal void EnsureNullableAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 558internal void EnsureNullableContextAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 563internal void EnsureNativeIntegerAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 569internal void EnsureScopedRefAttributeExists(BindingDiagnosticBag? diagnostics, Location location, bool modifyCompilation) 574internal bool CheckIfAttributeShouldBeEmbedded(EmbeddableAttributes attribute, BindingDiagnosticBag? diagnosticsOpt, Location locationOpt) 665private bool CheckIfAttributeShouldBeEmbedded(BindingDiagnosticBag? diagnosticsOpt, Location? locationOpt, WellKnownType attributeType, WellKnownMember attributeCtor, WellKnownMember? secondAttributeCtor = null)
Symbols\ConstraintsHelper.cs (9)
101Location location = typeParameter.GetFirstLocation(); 492Location location, 529public readonly Location Location; 533public CheckConstraintsArgs(CSharpCompilation currentCompilation, ConversionsBase conversions, Location location, BindingDiagnosticBag diagnostics) : 538public CheckConstraintsArgs(CSharpCompilation currentCompilation, ConversionsBase conversions, bool includeNullability, Location location, BindingDiagnosticBag diagnostics) : 543public CheckConstraintsArgs(CSharpCompilation currentCompilation, ConversionsBase conversions, bool includeNullability, Location location, BindingDiagnosticBag diagnostics, CompoundUseSiteInfo<AssemblySymbol> template) 561public static CheckConstraintsArgsBoxed Allocate(CSharpCompilation currentCompilation, ConversionsBase conversions, Location location, BindingDiagnosticBag diagnostics) 569public static CheckConstraintsArgsBoxed Allocate(CSharpCompilation currentCompilation, ConversionsBase conversions, bool includeNullability, Location location, BindingDiagnosticBag diagnostics) 602ImmutableArray<Location> elementLocations,
Symbols\DiscardSymbol.cs (2)
32public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\DynamicTypeSymbol.cs (2)
70public override ImmutableArray<Location> Locations 74return ImmutableArray<Location>.Empty;
Symbols\ErrorMethodSymbol.cs (2)
91public override ImmutableArray<Location> Locations 93get { return ImmutableArray<Location>.Empty; }
Symbols\ErrorPropertySymbol.cs (2)
62public override ImmutableArray<Location> Locations { get { return ImmutableArray<Location>.Empty; } }
Symbols\ErrorTypeSymbol.cs (3)
254public override ImmutableArray<Location> Locations 258return ImmutableArray<Location>.Empty; 626public override ImmutableArray<Location> Locations
Symbols\ErrorTypeSymbol.ErrorTypeParameterSymbol.cs (2)
126public override ImmutableArray<Location> Locations 130return ImmutableArray<Location>.Empty;
Symbols\ExtendedErrorTypeSymbol.cs (2)
176public override ImmutableArray<Location> Locations 180return ImmutableArray<Location>.Empty;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (3)
229static void checkUnmanagedSupport(CSharpCompilation compilation, Location errorLocation, BindingDiagnosticBag diagnostics) 826public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
70public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (2)
80public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\FunctionTypeSymbol.cs (1)
112public override ImmutableArray<Location> Locations => throw ExceptionUtilities.Unreachable();
Symbols\LabelSymbol.cs (1)
109public override ImmutableArray<Location> Locations
Symbols\LexicalSortKey.cs (1)
74public LexicalSortKey(Location location, CSharpCompilation compilation)
Symbols\MergedNamespaceSymbol.cs (1)
277public override ImmutableArray<Location> Locations
Symbols\Metadata\PE\PEAssemblySymbol.cs (2)
118public override ImmutableArray<Location> Locations 122return this.PrimaryModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PEEventSymbol.cs (2)
344public override ImmutableArray<Location> Locations 348return _containingType.ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PEFieldSymbol.cs (2)
514public override ImmutableArray<Location> Locations 518return _containingType.ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PEMethodSymbol.cs (2)
987public override ImmutableArray<Location> Locations => _containingType.ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PEModuleSymbol.cs (2)
234public override ImmutableArray<Location> Locations 238return this.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PENamedTypeSymbol.cs (2)
1604public override ImmutableArray<Location> Locations 1608return ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PENamespaceSymbol.cs (2)
170public sealed override ImmutableArray<Location> Locations 174return ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
1033public override ImmutableArray<Location> Locations
Symbols\Metadata\PE\PEPropertySymbol.cs (2)
714public override ImmutableArray<Location> Locations 718return _containingType.ContainingPEModule.MetadataLocation.Cast<MetadataLocation, Location>();
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
430public override ImmutableArray<Location> Locations
Symbols\MethodSymbol.cs (3)
993Location? location, 1161if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None)) 1171if (type.Type.ContainsTupleNames() && compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None))
Symbols\MissingAssemblySymbol.cs (2)
116public override ImmutableArray<Location> Locations 120return ImmutableArray<Location>.Empty;
Symbols\MissingModuleSymbol.cs (2)
122public override ImmutableArray<Location> Locations 126return ImmutableArray<Location>.Empty;
Symbols\MissingNamespaceSymbol.cs (2)
94public override ImmutableArray<Location> Locations 98return ImmutableArray<Location>.Empty;
Symbols\NonMissingModuleSymbol.cs (2)
120ImmutableArray<Location>.Empty); 138ImmutableArray<Location>.Empty);
Symbols\PointerTypeSymbol.cs (2)
181public override ImmutableArray<Location> Locations 185return ImmutableArray<Location>.Empty;
Symbols\PublicModel\PreprocessingSymbol.cs (2)
60ImmutableArray<Location> ISymbol.Locations => ImmutableArray<Location>.Empty;
Symbols\PublicModel\Symbol.cs (1)
104ImmutableArray<Location> ISymbol.Locations
Symbols\RangeVariableSymbol.cs (5)
19private readonly Location? _location; 22internal RangeVariableSymbol(string Name, Symbol containingSymbol, Location? location, bool isTransparent = false) 48public override ImmutableArray<Location> Locations 49=> _location is null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(_location); 51public override Location? TryGetFirstLocation()
Symbols\ReducedExtensionMethodSymbol.cs (1)
361public override ImmutableArray<Location> Locations
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
183public override ImmutableArray<Location> Locations
Symbols\Retargeting\RetargetingModuleSymbol.cs (1)
176public override ImmutableArray<Location> Locations
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (1)
153public override ImmutableArray<Location> Locations
Symbols\SignatureOnlyMethodSymbol.cs (1)
137public override ImmutableArray<Location> Locations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyParameterSymbol.cs (1)
95public override ImmutableArray<Location> Locations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\SignatureOnlyPropertySymbol.cs (1)
74public override ImmutableArray<Location> Locations { get { throw ExceptionUtilities.Unreachable(); } }
Symbols\Source\CrefTypeParameterSymbol.cs (2)
177public override ImmutableArray<Location> Locations 181return ImmutableArray.Create<Location>(_declaringSyntax.GetLocation());
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
188var memberLocation = implementingMember.GetFirstLocation(); 358var memberLocation = implementingMember.GetFirstLocation();
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
23internal abstract Location ErrorLocation { get; }
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
45protected override Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base)
Symbols\Source\IndexedTypeParameterSymbol.cs (2)
192public override ImmutableArray<Location> Locations 196return ImmutableArray<Location>.Empty;
Symbols\Source\LambdaParameterSymbol.cs (1)
27Location location)
Symbols\Source\LambdaSymbol.cs (4)
219public override ImmutableArray<Location> Locations 223return ImmutableArray.Create<Location>(_syntax.Location); 231internal Location DiagnosticLocation 380var location = unboundLambda.ParameterLocation(p);
Symbols\Source\LocalFunctionSymbol.cs (3)
260Location? location = null; 336public override ImmutableArray<Location> Locations => ImmutableArray.Create(Syntax.Identifier.GetLocation()); 338public override Location TryGetFirstLocation() => Syntax.Identifier.GetLocation();
Symbols\Source\ModifierUtils.cs (7)
21Location errorLocation, 43Location errorLocation, 128private static void ReportPartialError(Location errorLocation, BindingDiagnosticBag diagnostics, SyntaxTokenList? modifierTokens) 148Location errorLocation, 194internal static void ReportUnsupportedModifiersForLanguageVersion(DeclarationModifiers modifiers, DeclarationModifiers unsupportedModifiers, Location errorLocation, BindingDiagnosticBag diagnostics, LanguageVersion availableVersion, LanguageVersion requiredVersion) 211internal static void CheckFeatureAvailabilityForStaticAbstractMembersInInterfacesIfNeeded(DeclarationModifiers mods, bool isExplicitInterfaceImplementation, Location location, BindingDiagnosticBag diagnostics) 460internal static bool CheckAccessibility(DeclarationModifiers modifiers, Symbol symbol, bool isExplicitInterfaceImplementation, BindingDiagnosticBag diagnostics, Location errorLocation)
Symbols\Source\ParameterHelpers.cs (2)
417internal static Location GetParameterLocation(ParameterSymbol parameter) => parameter.GetNonNullSyntaxNode().Location; 688Location loc = ((ParameterSyntax)syntax).Identifier.GetNextToken(includeZeroWidth: true).GetLocation(); //could be missing
Symbols\Source\SourceAssemblySymbol.cs (13)
573public override ImmutableArray<Location> Locations 2130ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>> result = null; 2194private ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>>> _lazyInternalsVisibleToMap; 2196private static Location GetAssemblyAttributeLocationForDiagnostic(AttributeSyntax attributeSyntaxOpt) 2218diagnostics.Add(useSiteInfo, useSiteInfo.DiagnosticInfo is object ? GetAssemblyAttributeLocationForDiagnostic(arguments.AttributeSyntaxOpt) : Location.None)) 2272ref ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>>> lazyInternalsVisibleToMap) 2306new ConcurrentDictionary<string, ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, String>>>(StringComparer.OrdinalIgnoreCase), null); 2313Tuple<Location, string> locationAndValue = null; 2320locationAndValue = new Tuple<Location, string>(GetAssemblyAttributeLocationForDiagnostic(nodeOpt), displayName); 2326ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, string>> keys = null; 2333keys = new ConcurrentDictionary<ImmutableArray<byte>, Tuple<Location, String>>(); 2402Location attributeArgumentSyntaxLocation = attribute.GetAttributeArgumentLocation(0); 2415Location attributeArgumentSyntaxLocation = attribute.GetAttributeArgumentLocation(0);
Symbols\Source\SourceClonedParameterSymbol.cs (1)
108public override ImmutableArray<Location> Locations
Symbols\Source\SourceComplexParameterSymbol.cs (3)
45Location location, 1697Location location, 1724Location location,
Symbols\Source\SourceConstructorSymbol.cs (4)
27Location location, 86Location location, 123NamedTypeSymbol containingType, ConstructorDeclarationSyntax syntax, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics, 165private void CheckModifiers(MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceConstructorSymbolBase.cs (2)
24Location location, 60var location = this.GetFirstLocation();
Symbols\Source\SourceDestructorSymbol.cs (5)
23base(containingType, syntax.GetReference(), GetSymbolLocation(syntax, out Location location), isIterator: SyntaxFacts.HasYieldOperations(syntax.Body), 64private static (DeclarationModifiers, Flags) MakeModifiersAndFlags(NamedTypeSymbol containingType, DestructorDeclarationSyntax syntax, bool isNullableAnalysisEnabled, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors) 75private static Location GetSymbolLocation(DestructorDeclarationSyntax syntax, out Location location) 129private static DeclarationModifiers MakeModifiers(NamedTypeSymbol containingType, SyntaxTokenList modifiers, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors)
Symbols\Source\SourceEventAccessorSymbol.cs (2)
27Location location, 197internal Location Location
Symbols\Source\SourceEventSymbol.cs (8)
25private readonly Location _location; 60public Location Location 114public sealed override ImmutableArray<Location> Locations 122public override Location TryGetFirstLocation() 438private void CheckAccessibility(Location location, BindingDiagnosticBag diagnostics, bool isExplicitInterfaceImplementation) 444bool isFieldLike, Location location, 529Location location = this.GetFirstLocation(); 751var location = this.GetFirstLocation();
Symbols\Source\SourceFieldSymbol.cs (4)
137var location = ErrorLocation; 216public override Location TryGetFirstLocation() 219public sealed override ImmutableArray<Location> Locations 222internal sealed override Location ErrorLocation
Symbols\Source\SourceLabelSymbol.cs (3)
77public override ImmutableArray<Location> Locations 82? ImmutableArray<Location>.Empty 83: ImmutableArray.Create<Location>(_identifierNodeOrToken.GetLocation()!);
Symbols\Source\SourceLocalSymbol.cs (2)
406public override Location TryGetFirstLocation() 414public override ImmutableArray<Location> Locations
Symbols\Source\SourceMemberContainerSymbol.cs (9)
491internal static void ReportReservedTypeName(string? name, CSharpCompilation compilation, DiagnosticBag? diagnostics, Location location) 988public sealed override ImmutableArray<Location> Locations 989=> ImmutableArray<Location>.CastUp(declaration.NameLocations.ToImmutable()); 991public override Location TryGetFirstLocation() 1812var location = GetFirstLocation(); 1868ReportReservedTypeName(identifier?.Text, this.DeclaringCompilation, diagnostics.DiagnosticBag, identifier?.GetLocation() ?? Location.None); 3915private static Location GetAccessorOrPropertyLocation(PropertySymbol propertySymbol, bool getNotSet) 3924private static Location GetAccessorOrEventLocation(EventSymbol propertySymbol, bool isAdder) 4104var location = m.GetFirstLocation();
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (17)
229var info = new CSDiagnosticInfo(ErrorCode.ERR_MixingWinRTEventWithRegular, args, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<Location>(this.GetFirstLocation())); 328Location location = implementingMember.IsFromCompilation(this.DeclaringCompilation) 342protected abstract Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base); 345private Location GetImplementsLocationOrFallback(NamedTypeSymbol implementedInterface) 350internal Location? GetImplementsLocation(NamedTypeSymbol implementedInterface) 695Location symbolLocation = symbol.TryGetFirstLocation(); 757var overridingMemberLocation = overridingMember.GetFirstLocation(); 869var overridingMemberLocation = overridingMember.GetFirstLocation(); 1046var overridingMemberLocation = overridingProperty.GetFirstLocation(); 1147Location overridingMemberLocation, 1205Location symbolLocation = overridingSymbol.TryGetFirstLocation(); 1216private static readonly ReportMismatchInReturnType<Location> ReportBadReturn = 1217(BindingDiagnosticBag diagnostics, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, bool topLevel, Location location) 1223private static readonly ReportMismatchInParameterType<Location> ReportBadParameter = 1224(BindingDiagnosticBag diagnostics, MethodSymbol overriddenMethod, MethodSymbol overridingMethod, ParameterSymbol overridingParameter, bool topLevel, Location location) 1558var hidingMemberLocation = hidingMember.GetFirstLocation(); 1639private static bool AddHidingAbstractDiagnostic(Symbol hidingMember, Location hidingMemberLocation, Symbol hiddenMember, BindingDiagnosticBag diagnostics, ref bool suppressAccessors)
Symbols\Source\SourceMemberMethodSymbol.cs (6)
300protected readonly Location _location; 323Location location, 776public override ImmutableArray<Location> Locations 779public override Location TryGetFirstLocation() 1080protected void CheckModifiersForBody(Location location, BindingDiagnosticBag diagnostics) 1094protected void CheckFeatureAvailabilityAndRuntimeSupport(SyntaxNode declarationSyntax, Location location, bool hasBody, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceMethodSymbol.cs (3)
61internal void ReportAsyncParameterErrors(BindingDiagnosticBag diagnostics, Location location) 79static Location getLocation(ParameterSymbol parameter, Location location)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (4)
1144static void reportFeatureNotEnabled(BindingDiagnosticBag diagnostics, Location attributeLocation, ArrayBuilder<string> namespaceNames) 1168var attributeLocation = attributeSyntax.Location; 1427static UnmanagedCallersOnlyAttributeData DecodeUnmanagedCallersOnlyAttributeData(SourceMethodSymbolWithAttributes @this, CSharpAttributeData attribute, Location location, BindingDiagnosticBag diagnostics) 1516protected void AsyncMethodChecks(bool verifyReturnType, Location errorLocation, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceModuleSymbol.cs (4)
44private ImmutableArray<Location> _locations; 337var location = this.GlobalNamespace.GetFirstLocationOrNone(); 403public override ImmutableArray<Location> Locations 411DeclaringCompilation.MergedRootDeclaration.Declarations.SelectAsArray(d => (Location)d.Location));
Symbols\Source\SourceNamedTypeSymbol.cs (2)
36protected override Location GetCorrespondingBaseListLocation(NamedTypeSymbol @base) 38Location backupLocation = null;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
97Location baseLocation = null; 777diagnostics.Add(useSiteInfo.Diagnostics.IsNullOrEmpty() ? Location.None : (FindBaseRefSyntax(declaredBase) ?? GetFirstLocation()), useSiteInfo);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
663Location location = usingDirective.Alias.Name.Location;
Symbols\Source\SourceNamespaceSymbol.cs (3)
30private ImmutableArray<Location> _locations; 88public override ImmutableArray<Location> Locations 104public override Location? TryGetFirstLocation()
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (4)
24protected SourceOrdinaryMethodOrUserDefinedOperatorSymbol(NamedTypeSymbol containingType, SyntaxReference syntaxReferenceOpt, Location location, bool isIterator, (DeclarationModifiers declarationModifiers, Flags flags) modifiersAndFlags) 29protected abstract Location ReturnTypeLocation { get; } 225Location? returnTypeLocation = null; 266Location getReturnTypeLocation()
Symbols\Source\SourceOrdinaryMethodSymbol.cs (8)
50Location location, 90NamedTypeSymbol containingType, Location location, MethodDeclarationSyntax syntax, MethodKind methodKind, 266protected sealed override Location ReturnTypeLocation => GetSyntax().ReturnType.Location; 424private static DeclarationModifiers MakeDeclarationModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, Location location, DeclarationModifiers allowedModifiers, BindingDiagnosticBag diagnostics) 687private static (DeclarationModifiers mods, bool hasExplicitAccessMod) MakeModifiers(MethodDeclarationSyntax syntax, NamedTypeSymbol containingType, MethodKind methodKind, bool hasBody, Location location, BindingDiagnosticBag diagnostics) 793private void CheckModifiers(bool isExplicitInterfaceImplementation, Location location, BindingDiagnosticBag diagnostics) 920Location location, 978Location location,
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
31Location location,
Symbols\Source\SourceParameterSymbol.cs (5)
25private readonly Location? _location; 108Location location) 264public sealed override ImmutableArray<Location> Locations 265=> _location is null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(_location); 269public override Location? TryGetFirstLocation()
Symbols\Source\SourcePropertyAccessorSymbol.cs (7)
90Location location, 116Location location, 143Location location, 177Location location, 223NamedTypeSymbol containingType, SourcePropertySymbolBase property, DeclarationModifiers propertyModifiers, Location location, 493bool hasBody, Location location, BindingDiagnosticBag diagnostics, out bool modifierErrors) 524private void CheckModifiers(Location location, bool hasBody, bool isAutoPropertyOrExpressionBodied, BindingDiagnosticBag diagnostics)
Symbols\Source\SourcePropertySymbol.cs (4)
37Location location, 118Location location, 174protected override Location TypeLocation 364Location location,
Symbols\Source\SourcePropertySymbolBase.cs (8)
73public Location Location { get; } 99Location location, 282protected abstract Location TypeLocation { get; } 524public sealed override Location TryGetFirstLocation() => Location; 526public override ImmutableArray<Location> Locations 1003Location location = TypeLocation; 1051private void CheckAccessibility(Location location, BindingDiagnosticBag diagnostics, bool isExplicitInterfaceImplementation) 1056private void CheckModifiers(bool isExplicitInterfaceImplementation, Location location, bool isIndexer, BindingDiagnosticBag diagnostics)
Symbols\Source\SourceSimpleParameterSymbol.cs (2)
26ImmutableArray<Location> locations) 38Location? location)
Symbols\Source\SourceTypeParameterSymbol.cs (7)
26private readonly ImmutableArray<Location> _locations; 34protected SourceTypeParameterSymbolBase(string name, int ordinal, ImmutableArray<Location> locations, ImmutableArray<SyntaxReference> syntaxRefs) 44public override ImmutableArray<Location> Locations 316Location getLocation() => this.GetNonNullSyntaxNode().Location; 464public SourceTypeParameterSymbol(SourceNamedTypeSymbol owner, string name, int ordinal, VarianceKind varianceKind, ImmutableArray<Location> locations, ImmutableArray<SyntaxReference> syntaxRefs) 609public SourceMethodTypeParameterSymbol(SourceMethodSymbol owner, string name, int ordinal, ImmutableArray<Location> locations, ImmutableArray<SyntaxReference> syntaxRefs) 870public SourceOverridingMethodTypeParameterSymbol(OverriddenMethodTypeParameterMapBase map, string name, int ordinal, ImmutableArray<Location> locations, ImmutableArray<SyntaxReference> syntaxRefs)
Symbols\Source\SourceUserDefinedConversionSymbol.cs (2)
58Location location, 109protected override Location ReturnTypeLocation
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (2)
63Location location, 109protected override Location ReturnTypeLocation
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (4)
29Location location, 125protected static DeclarationModifiers MakeDeclarationModifiers(MethodKind methodKind, bool inInterface, BaseMethodDeclarationSyntax syntax, Location location, BindingDiagnosticBag diagnostics) 207static void reportModifierIfPresent(DeclarationModifiers result, DeclarationModifiers errorModifier, Location location, BindingDiagnosticBag diagnostics, CSharpRequiredLanguageVersion requiredVersionArgument, string availableVersionArgument) 729var location = this.GetFirstLocation();
Symbols\Source\SynthesizedAttributeData.cs (2)
54internal override Location GetAttributeArgumentLocation(int parameterIndex) => NoLocation.Singleton; 87internal override Location GetAttributeArgumentLocation(int parameterIndex) => _original.GetAttributeArgumentLocation(parameterIndex);
Symbols\Source\ThisParameterSymbol.cs (2)
166public override ImmutableArray<Location> Locations 168get { return _containingMethod is not null ? _containingMethod.Locations : ImmutableArray<Location>.Empty; }
Symbols\Source\TypeParameterBuilder.cs (4)
24private readonly Location _location; 26internal TypeParameterBuilder(SyntaxReference syntaxRef, SourceNamedTypeSymbol owner, Location location) 54private static ImmutableArray<Location> ToLocations(IList<TypeParameterBuilder> builders) 56var arrayBuilder = ArrayBuilder<Location>.GetInstance(builders.Count);
Symbols\Symbol.cs (13)
317ImmutableArray<Location> ISymbolInternal.Locations => this.Locations; 403var firstLocation = this.TryGetFirstLocation(); 417public abstract ImmutableArray<Location> Locations { get; } 421public virtual Location? TryGetFirstLocation() 428public Location GetFirstLocation() 431public Location GetFirstLocationOrNone() 432=> TryGetFirstLocation() ?? Location.None; 442foreach (var loc in this.Locations) 452protected static bool IsLocationContainedWithin(Location loc, SyntaxTree tree, TextSpan declarationSpan, out bool wasZeroWidthMatch) 494internal static ImmutableArray<SyntaxReference> GetDeclaringSyntaxReferenceHelper<TNode>(ImmutableArray<Location> locations) 503foreach (Location location in locations) 1173internal static bool ReportUseSiteDiagnostic(DiagnosticInfo info, DiagnosticBag diagnostics, Location location) 1189internal static bool ReportUseSiteDiagnostic(DiagnosticInfo info, BindingDiagnosticBag diagnostics, Location location)
Symbols\Symbol_Attributes.cs (3)
466var builder = ArrayBuilder<Location>.GetInstance(); 493Location location = withInfo.Location; 495foreach (Location argumentLocation in builder)
Symbols\SymbolExtensions.cs (2)
296internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, BindingDiagnosticBag diagnostics) 299internal static void CheckUnsafeModifier(this Symbol symbol, DeclarationModifiers modifiers, Location errorLocation, DiagnosticBag? diagnostics)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (2)
150public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
51public override ImmutableArray<Location> Locations => _containingType.Locations;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
47public override ImmutableArray<Location> Locations => _containingType.Locations;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (2)
827public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructorParameterBackingFieldSymbol.cs (2)
33internal override Location ErrorLocation 42public override ImmutableArray<Location> Locations
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
28var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
34var location = ReturnTypeLocation; 36Parameters: _ctor.Parameters.SelectAsArray<ParameterSymbol, ImmutableArray<Location>, ParameterSymbol>(
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (2)
61protected override Location TypeLocation 137Location location,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (2)
48protected sealed override Location ReturnTypeLocation => GetFirstLocation(); 67var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
35var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
33var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (1)
30var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
45protected sealed override Location ReturnTypeLocation => GetFirstLocation();
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
92var location = ReturnTypeLocation;
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (1)
52protected override Location TypeLocation
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (1)
41var location = ReturnTypeLocation;
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (2)
100internal override Location ErrorLocation 115public override ImmutableArray<Location> Locations
Symbols\Synthesized\SynthesizedContainer.cs (2)
86public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (2)
218public override ImmutableArray<Location> Locations 220get { return ImmutableArray<Location>.Empty; }
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
84public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (2)
102public override ImmutableArray<Location> Locations 104get { return ImmutableArray<Location>.Empty; }
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (4)
62compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && 74compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) && 158public override ImmutableArray<Location> Locations 160get { return ImmutableArray<Location>.Empty; }
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (2)
191public override ImmutableArray<Location> Locations 193get { return ImmutableArray<Location>.Empty; }
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
47Location.None,
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
95public override ImmutableArray<Location> Locations => [];
Symbols\Synthesized\SynthesizedImplementationMethod.cs (2)
161public sealed override ImmutableArray<Location> Locations 163get { return ImmutableArray<Location>.Empty; }
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (4)
75public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty; 239public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
144public sealed override ImmutableArray<Location> Locations
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (1)
124public override ImmutableArray<Location> Locations
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
328public override ImmutableArray<Location> Locations 332return ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedLocal.cs (2)
143public sealed override ImmutableArray<Location> Locations 145get { return (_syntaxOpt == null) ? ImmutableArray<Location>.Empty : ImmutableArray.Create(_syntaxOpt.GetLocation()); }
Symbols\Synthesized\SynthesizedParameterSymbol.cs (4)
135public override ImmutableArray<Location> Locations 137get { return ImmutableArray<Location>.Empty; } 156if (type.Type.ContainsDynamic() && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None) && compilation.CanEmitBoolean()) 172compilation.HasTupleNamesAttributes(BindingDiagnosticBag.Discarded, Location.None) &&
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
64public override ImmutableArray<Location> Locations => ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (2)
56public override ImmutableArray<Location> Locations 60return ImmutableArray<Location>.Empty;
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
111public override ImmutableArray<Location> Locations
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
75public override ImmutableArray<Location> Locations
Symbols\SynthesizedNamespaceSymbol.cs (2)
61public override ImmutableArray<Location> Locations 62=> ImmutableArray<Location>.Empty;
Symbols\SynthesizedSimpleMethodTypeParameterSymbol.cs (1)
96public override ImmutableArray<Location> Locations
Symbols\Tuples\TupleErrorFieldSymbol.cs (4)
30private readonly ImmutableArray<Location> _locations; 42Location location, 52_locations = location == null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(location); 115public override ImmutableArray<Location> Locations
Symbols\Tuples\TupleFieldSymbol.cs (4)
30private readonly ImmutableArray<Location> _locations; 41ImmutableArray<Location> locations, 175public sealed override ImmutableArray<Location> Locations 259ImmutableArray<Location> locations,
Symbols\Tuples\TupleTypeSymbol.cs (21)
31Location? locationOpt, 33ImmutableArray<Location?> elementLocations, 61var locations = locationOpt is null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(locationOpt); 104ImmutableArray<Location?> elementLocations = default, 105ImmutableArray<Location> locations = default) 162ImmutableArray<Location?> newElementLocations, 164ImmutableArray<Location> locations) 504diagnostics.Add(useSiteInfo, static syntax => syntax?.Location ?? Location.None, syntax); 556private ImmutableArray<Location?> TupleElementLocations 626ImmutableArray<Location> locations = getElementLocations(in elementLocations, tupleFieldIndex); 748var location = elementLocations.IsDefault ? null : elementLocations[i]; 842static ImmutableArray<Location> getElementLocations(in ImmutableArray<Location?> elementLocations, int tupleFieldIndex) 846return ImmutableArray<Location>.Empty; 849var elementLocation = elementLocations[tupleFieldIndex]; 850return elementLocation == null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(elementLocation); 895internal ImmutableArray<Location?> ElementLocations { get; } 904internal ImmutableArray<Location> Locations { get; } 927Locations = ImmutableArray<Location>.Empty; 931ImmutableArray<Location?> elementLocations, ImmutableArray<bool> errorPositions, ImmutableArray<Location> locations)
Symbols\TypeSymbol.cs (4)
1882var location = GetImplicitImplementationDiagnosticLocation(implementedMethod, implementingType, implementingMethod); 1984Location interfaceLocation = GetInterfaceLocation(interfaceMember, implementingType); 2071private static Location GetInterfaceLocation(Symbol interfaceMember, TypeSymbol implementingType) 2130internal static Location GetImplicitImplementationDiagnosticLocation(Symbol interfaceMember, TypeSymbol implementingType, Symbol member)
Symbols\UpdatedContainingSymbolLocal.cs (1)
80public override ImmutableArray<Location> Locations => _underlyingLocal.Locations;
Symbols\VarianceSafety.cs (2)
428private delegate Location LocationProvider<T>(T arg); 466var location = locationProvider(locationArg) ?? unsafeTypeParameter.GetFirstLocation();
Symbols\Wrapped\WrappedEventSymbol.cs (1)
70public override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
184public override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedMethodSymbol.cs (1)
93public override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
127public override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
59public sealed override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
92public override ImmutableArray<Location> Locations
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
144public override ImmutableArray<Location> Locations
Syntax\CSharpSyntaxNode.cs (2)
193/// Gets a <see cref="Location"/> for this node. 195public new Location GetLocation()
Syntax\CSharpSyntaxTree.cs (2)
756/// Gets a <see cref="Location"/> for the specified text <paramref name="span"/>. 758public override Location GetLocation(TextSpan span)
Microsoft.CodeAnalysis.CSharp.CodeStyle (52)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
53var diagnosticLocation = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
56var diagnosticLocation = option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
57public static Location GetUseProgramMainDiagnosticLocation(CompilationUnitSyntax root, bool isHidden) 70return Location.Create(
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
30public static Location GetUseTopLevelStatementsDiagnosticLocation(MethodDeclarationSyntax methodDeclaration, bool isHidden)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
65var additionalLocations = ArrayBuilder<Location>.GetInstance();
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (10)
132var additionalLocations = ImmutableArray.Create<Location>( 133Location.Create(tree, ifStatement.Span), 134Location.Create(tree, expressionStatement.Span)); 170ImmutableArray<Location> additionalLocations, 182var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End)); 321Location.Create(tree, localDeclarationStatement.Span), 322Location.Create(tree, ifStatement.Span), 323Location.Create(tree, expressionStatement.Span));
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
73private static Location GetDiagnosticLocation(INamedTypeSymbol namedTypeSymbol)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
171private static (Location? location, Location? additionalLocation) GetDiagnosticLocation(
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (4)
40if (!IsCandidate(context, out var location, out var additionalLocation, out var option)) 73[NotNullWhen(true)] out Location? primaryLocation, 74[NotNullWhen(true)] out Location? additionalLocation,
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
43protected override Location GetDiagnosticLocation(SyntaxNode block)
src\Analyzers\CSharp\Analyzers\PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
15protected override Location GetDiagnosticLocation(SwitchExpressionSyntax switchBlock)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67protected override Location GetLocation(IOperation operation) => operation.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
117var firstStatementLocation = root.SyntaxTree.GetLocation(firstUnreachableStatement.FullSpan); 135var location = root.SyntaxTree.GetLocation(span);
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
81protected override Location GetDefinitionLocationToFade(IOperation unusedDefinition)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
66void FadeOutCode(SyntaxNodeAnalysisContext context, AnalysisResult analysisResult, ImmutableArray<Location> locations) 250Location DiagnosticLocation,
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (1)
79protected override Location GetDiagnosticLocation(IndexerDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
79protected override Location GetDiagnosticLocation(PropertyDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (1)
33public abstract Location GetDiagnosticLocation(SyntaxNode declaration);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (2)
81public override Location GetDiagnosticLocation(SyntaxNode declaration) 84protected virtual Location GetDiagnosticLocation(TDeclaration declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
100var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden 115var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (4)
76var location = GetDiagnosticLocation(declaration); 90var location = GetDiagnosticLocation(declaration); 103private static Location GetDiagnosticLocation(LambdaExpressionSyntax declaration) 104=> Location.Create(declaration.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (2)
258var location = Location.Create(invocation.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
238AnonymousFunctionExpressionSyntax anonymousFunction, out ImmutableArray<Location> referenceLocations, CancellationToken cancellationToken) 242using var _ = ArrayBuilder<Location>.GetInstance(out var references);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (4)
125var location = Location.Create(syntaxNode.SyntaxTree, span); 133var location = syntaxNode.GetFirstToken().GetLocation(); 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
60var location = token.GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
212public Location GetDeconstructionReferenceLocation(SyntaxNode node)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (28)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (3)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0]; 60var switchLocation = diagnostic.AdditionalLocations[0]; 73var declaratorToRemoveLocation = diagnostic.AdditionalLocations.ElementAtOrDefault(1);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
65var location = diagnostics[0].Location;
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
82var declaratorLocation = diagnostic.AdditionalLocations[0]; 83var identifierLocation = diagnostic.AdditionalLocations[1]; 84var invocationOrCreationLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (5)
78var ifStatementLocation = diagnostic.AdditionalLocations[0]; 79var expressionStatementLocation = diagnostic.AdditionalLocations[1]; 121var localDeclarationLocation = diagnostic.AdditionalLocations[0]; 122var ifStatementLocation = diagnostic.AdditionalLocations[1]; 123var expressionStatementLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
58var firstUnreachableStatementLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
63var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
53var verbatimInterpolatedLocation = diagnostic.Location;
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
79var location = diagnostic.Location;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (4)
43using var _1 = PooledHashSet<Location>.GetInstance(out var declaratorLocations); 90var declaratorLocation = diagnostic.AdditionalLocations[0]; 91var comparisonLocation = diagnostic.AdditionalLocations[1]; 92var asExpressionLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
54var ifStatementLocation = diagnostic.AdditionalLocations[0]; 55var localDeclarationLocation = diagnostic.AdditionalLocations[1];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
52var notExpressionLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
95var location = diagnostic.AdditionalLocations[0]; 152private static SyntaxNode CreateArgumentListWithUtf8String(BaseArgumentListSyntax argumentList, Location location, string stringValue, bool isConvertedToReadOnlySpan)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
198Location location, CancellationToken cancellationToken) 200var contextLocation = location;
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.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
355=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.Create(context.Tree, TextSpan.FromBounds(1000, 2000))));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (18)
CodeGen\CodeGenTupleTest.cs (18)
5799var loc1 = Location.Create(tree, new TextSpan(0, 1)); 5910var loc1 = Location.Create(tree, new TextSpan(0, 1)); 5911var loc2 = Location.Create(tree, new TextSpan(1, 1)); 6351var loc1 = Location.Create(syntaxTree, new TextSpan(0, 1)); 6387var loc1 = Location.Create(syntaxTree, new TextSpan(0, 1)); 6388var loc2 = Location.Create(syntaxTree, new TextSpan(1, 1)); 6651tuple2 = comp.CreateTupleTypeSymbol(underlyingType, default(ImmutableArray<string>), default(ImmutableArray<Location>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>)); 6693tuple2 = comp.CreateTupleTypeSymbol(underlyingType, default(ImmutableArray<string>), default(ImmutableArray<Location>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>)); 6731tuple2 = comp.CreateTupleTypeSymbol(elementTypes, default(ImmutableArray<string>), default(ImmutableArray<Location>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>)); 6772tuple2 = comp.CreateTupleTypeSymbol(elementTypes, default(ImmutableArray<string>), default(ImmutableArray<Location>), default(ImmutableArray<CodeAnalysis.NullableAnnotation>)); 28996elementLocations: ImmutableArray.Create<Location>(null, null, null, null, null, null, null, null, null), 29014elementLocations: ImmutableArray.Create<Location>(null, null, null, null, null, null, null, null, null),
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (18)
Diagnostics\DiagnosticAnalyzerTests.cs (17)
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(",")); 2351private void ReportDiagnosticsCore(Action<Diagnostic> addDiagnostic, Location location, params object[] messageArguments)
Diagnostics\GetDiagnosticsTests.cs (1)
1013Location location;
Microsoft.CodeAnalysis.CSharp.Features (86)
Completion\CompletionProviders\ObjectAndWithInitializerCompletionProvider.cs (1)
107protected override Tuple<ITypeSymbol, Location>? GetInitializedType(
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
178using var _1 = PooledDictionary<Location, IFieldSymbol>.GetInstance(out var locationToField);
ConvertProgram\ConvertToProgramMainCodeRefactoringProvider.cs (1)
46var acceptableLocation = GetUseProgramMainDiagnosticLocation(root, isHidden: true);
Debugging\BreakpointResolver.cs (1)
35var location = method.Locations.First(loc => loc.IsInSource);
DocumentHighlighting\CSharpDocumentHighlightsService.cs (2)
34protected override async Task<ImmutableArray<Location>> GetAdditionalReferencesAsync( 45using var _ = ArrayBuilder<Location>.GetInstance(out var results);
GenerateType\CSharpGenerateTypeService.cs (2)
567public override async Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync( 588var afterThisLocation = lastMember != null
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
90Location location, CancellationToken cancellationToken)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
53var diagnosticLocation = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
56var diagnosticLocation = option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
57public static Location GetUseProgramMainDiagnosticLocation(CompilationUnitSyntax root, bool isHidden) 70return Location.Create(
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_TopLevelStatements.cs (1)
30public static Location GetUseTopLevelStatementsDiagnosticLocation(MethodDeclarationSyntax methodDeclaration, bool isHidden)
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
65var additionalLocations = ArrayBuilder<Location>.GetInstance();
src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (10)
132var additionalLocations = ImmutableArray.Create<Location>( 133Location.Create(tree, ifStatement.Span), 134Location.Create(tree, expressionStatement.Span)); 170ImmutableArray<Location> additionalLocations, 182var fadeLocation = Location.Create(tree, TextSpan.FromBounds(firstStatement.SpanStart, previousToken.Span.End)); 203fadeLocation = Location.Create(tree, TextSpan.FromBounds(nextToken.Span.Start, ifStatement.Span.End)); 321Location.Create(tree, localDeclarationStatement.Span), 322Location.Create(tree, ifStatement.Span), 323Location.Create(tree, expressionStatement.Span));
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
73private static Location GetDiagnosticLocation(INamedTypeSymbol namedTypeSymbol)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
171private static (Location? location, Location? additionalLocation) GetDiagnosticLocation(
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (4)
40if (!IsCandidate(context, out var location, out var additionalLocation, out var option)) 73[NotNullWhen(true)] out Location? primaryLocation, 74[NotNullWhen(true)] out Location? additionalLocation,
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveStatementPlacement\CSharpConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
43protected override Location GetDiagnosticLocation(SyntaxNode block)
src\Analyzers\CSharp\Analyzers\PopulateSwitch\CSharpPopulateSwitchExpressionDiagnosticAnalyzer.cs (1)
15protected override Location GetDiagnosticLocation(SwitchExpressionSyntax switchBlock)
src\Analyzers\CSharp\Analyzers\QualifyMemberAccess\CSharpQualifyMemberAccessDiagnosticAnalyzer.cs (1)
67protected override Location GetLocation(IOperation operation) => operation.Syntax.GetLocation();
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (2)
117var firstStatementLocation = root.SyntaxTree.GetLocation(firstUnreachableStatement.FullSpan); 135var location = root.SyntaxTree.GetLocation(span);
src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
81protected override Location GetDefinitionLocationToFade(IOperation unusedDefinition)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (2)
66void FadeOutCode(SyntaxNodeAnalysisContext context, AnalysisResult analysisResult, ImmutableArray<Location> locations) 250Location DiagnosticLocation,
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForIndexersHelper.cs (1)
79protected override Location GetDiagnosticLocation(IndexerDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForPropertiesHelper.cs (1)
79protected override Location GetDiagnosticLocation(PropertyDeclarationSyntax declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper.cs (1)
33public abstract Location GetDiagnosticLocation(SyntaxNode declaration);
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyHelper`1.cs (2)
81public override Location GetDiagnosticLocation(SyntaxNode declaration) 84protected virtual Location GetDiagnosticLocation(TDeclaration declaration)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
100var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden 115var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaDiagnosticAnalyzer.cs (4)
76var location = GetDiagnosticLocation(declaration); 90var location = GetDiagnosticLocation(declaration); 103private static Location GetDiagnosticLocation(LambdaExpressionSyntax declaration) 104=> Location.Create(declaration.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (2)
258var location = Location.Create(invocation.SyntaxTree,
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
238AnonymousFunctionExpressionSyntax anonymousFunction, out ImmutableArray<Location> referenceLocations, CancellationToken cancellationToken) 242using var _ = ArrayBuilder<Location>.GetInstance(out var references);
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (4)
125var location = Location.Create(syntaxNode.SyntaxTree, span); 133var location = syntaxNode.GetFirstToken().GetLocation(); 138private void ReportDiagnostic(OperationAnalysisContext context, SyntaxNode syntaxNode, NotificationOption2 notificationOption, Location location, ArrayCreationOperationLocation operationLocation)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (3)
39var switchLocation = context.Diagnostics.First().AdditionalLocations[0]; 60var switchLocation = diagnostic.AdditionalLocations[0]; 73var declaratorToRemoveLocation = diagnostic.AdditionalLocations.ElementAtOrDefault(1);
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
65var location = diagnostics[0].Location;
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (3)
82var declaratorLocation = diagnostic.AdditionalLocations[0]; 83var identifierLocation = diagnostic.AdditionalLocations[1]; 84var invocationOrCreationLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (5)
78var ifStatementLocation = diagnostic.AdditionalLocations[0]; 79var expressionStatementLocation = diagnostic.AdditionalLocations[1]; 121var localDeclarationLocation = diagnostic.AdditionalLocations[0]; 122var ifStatementLocation = diagnostic.AdditionalLocations[1]; 123var expressionStatementLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs (1)
58var firstUnreachableStatementLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
80var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseExpressionBodyForLambda\UseExpressionBodyForLambdaCodeFixProvider.cs (1)
63var declarationLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseInterpolatedVerbatimString\CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (1)
53var verbatimInterpolatedLocation = diagnostic.Location;
src\Analyzers\CSharp\CodeFixes\UsePatternCombinators\CSharpUsePatternCombinatorsCodeFixProvider.cs (1)
79var location = diagnostic.Location;
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (4)
43using var _1 = PooledHashSet<Location>.GetInstance(out var declaratorLocations); 90var declaratorLocation = diagnostic.AdditionalLocations[0]; 91var comparisonLocation = diagnostic.AdditionalLocations[1]; 92var asExpressionLocation = diagnostic.AdditionalLocations[2];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpIsAndCastCheckCodeFixProvider.cs (2)
54var ifStatementLocation = diagnostic.AdditionalLocations[0]; 55var localDeclarationLocation = diagnostic.AdditionalLocations[1];
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpUseNotPatternCodeFixProvider.cs (1)
52var notExpressionLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\CSharp\CodeFixes\UseUtf8StringLiteral\UseUtf8StringLiteralCodeFixProvider.cs (2)
95var location = diagnostic.AdditionalLocations[0]; 152private static SyntaxNode CreateArgumentListWithUtf8String(BaseArgumentListSyntax argumentList, Location location, string stringValue, bool isConvertedToReadOnlySpan)
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
52var location = diagnostics[0].Location;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Diagnostics\Suppression\RemoveSuppressionTests.cs (2)
49var location = _reportDiagnosticsWithoutLocation ? Location.None : classDecl.Identifier.GetLocation();
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (1)
51var location = classDecl.Identifier.GetLocation();
Diagnostics\Suppression\SuppressionTests.cs (1)
2461=> context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (23)
SourceGeneration\GeneratorDriverTests.cs (23)
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); 1271c.ReportDiagnostic(d.WithLocation(Location.Create(c.Compilation.SyntaxTrees.First(), l))); 1360return x.Diagnostic.WithLocation(Location.Create(syntaxTree, TextSpan.FromBounds(start, end))); 3626location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3659location: Location.Create(validSyntaxTree, TextSpan.FromBounds(0, 2)), 3660additionalLocations: new[] { Location.Create(invalidSyntaxTree, TextSpan.FromBounds(0, 2)) })); 3690location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3720location: Location.Create(validSyntaxTree, TextSpan.FromBounds(0, 2)), 3721additionalLocations: new[] { Location.Create(invalidSyntaxTree, TextSpan.FromBounds(0, 2)) })); 3752location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)))); 3784location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)), 3785additionalLocations: new[] { Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)) })); 3815location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)))); 3844location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)), 3845additionalLocations: new[] { Location.Create(syntaxTree, TextSpan.FromBounds(0, 100)) })); 3876location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2)))); 3906location: Location.Create(syntaxTree, TextSpan.FromBounds(0, 2))));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (17)
Compilation\CompilationAPITests.cs (8)
2535memberLocations: ImmutableArray.Create(Location.None))); 2559memberLocations: ImmutableArray.Create(Location.None, null))); 2614loc => Assert.Equal(loc, Location.None)); 2622var loc1 = Location.Create(tree, new TextSpan(0, 1)); 2623var loc2 = Location.Create(tree, new TextSpan(1, 1)); 2650loc => Assert.Equal(loc, Location.None));
Compilation\SemanticModelAPITests.cs (1)
1198var ploc = parasym.Locations[0];
Symbols\MockAssemblySymbol.cs (2)
48public override ImmutableArray<Location> Locations 50get { return ImmutableArray.Create<Location>(); }
Symbols\MockNamedTypeSymbol.cs (2)
160public override ImmutableArray<Location> Locations 162get { return ImmutableArray.Create<Location>(); }
Symbols\MockNamespaceSymbol.cs (2)
90public override ImmutableArray<Location> Locations 94return ImmutableArray.Create<Location>();
Symbols\Source\DelegateTests.cs (2)
75Assert.Equal(d.Locations[0], d.DelegateInvokeMethod.Locations[0], EqualityComparer<Location>.Default); 76Assert.Equal(d.Locations[0], d.InstanceConstructors[0].Locations[0], EqualityComparer<Location>.Default);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (25)
Diagnostics\DiagnosticTest.cs (5)
83Location l1 = new SourceLocation(syntaxTree, new TextSpan(5, 8)); 2760public readonly Location OtherLocation; 2761public override IReadOnlyList<Location> AdditionalLocations 2765return new Location[1] { OtherLocation }; 2769public CustomErrorInfo(CommonMessageProvider provider, object otherSymbol, Location otherLocation)
Diagnostics\LocationsTests.cs (8)
91Location locX = new SourceLocation(syntaxTree, xSpan); 92Location locXToCloseBrace = new SourceLocation(syntaxTree, xToCloseBraceSpan); 504Location location = Location.Create("test.txt", new TextSpan(), new LinePositionSpan(new LinePosition(2, 1), new LinePosition(3, 1))); 519Location locationWithoutMapping = Location.Create(filePath, sourceSpan, lineSpan); 520Location locationWithMapping = Location.Create(filePath, sourceSpan, lineSpan, mappedFilePath, mappedLineSpan);
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 (7)
425Assert.Equal(Location.None, literal.GetLocation()); 439Assert.Equal(Location.None, literal.GetLocation()); 452var expectedLocation = Location.Create(expression.Token.SyntaxTree, TextSpan.FromBounds(0, 2)); 466var expectedLocation = Location.Create(expression.Token.SyntaxTree, TextSpan.FromBounds(0, 2)); 477Assert.Equal(Location.None, token.GetLocation());
Syntax\SyntaxNodeTests.cs (4)
2077var nodeLocation = method.GetLocation(); 2082var tokenLocation = method.Identifier.GetLocation(); 2087var triviaLocation = method.ReturnType.GetLastToken().TrailingTrivia[0].GetLocation(); 2093var spanLocation = tree.GetLocation(textSpan);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (2)
Extensions.cs (2)
780ImmutableArray<Location> elementLocations = default) 789ImmutableArray<Location> elementLocations = default,
Microsoft.CodeAnalysis.CSharp.Workspaces (20)
Rename\CSharpRenameRewriterLanguageService.cs (16)
63private readonly Location? _renamableDeclarationLocation; 786public override async Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync( 793IDictionary<Location, Location> reverseMappedLocations, 798using var _ = ArrayBuilder<Location>.GetInstance(out var conflicts); 870var location = renamedSymbol.Locations.Single(); 900foreach (var location in renamedSymbol.Locations) 920foreach (var location in conflictingLocations) 964ArrayBuilder<Location> conflicts, IEnumerable<ISymbol> symbols, 965IDictionary<Location, Location> reverseMappedLocations) 969foreach (var location in symbol.Locations) 975if (location.IsInSource && reverseMappedLocations.TryGetValue(location, out var conflictingLocation)) 983public override async Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync( 1028public override ImmutableArray<Location> ComputePossibleImplicitUsageConflicts( 1031Location originalDeclarationLocation,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
60var location = token.GetLocation();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
212public Location GetDeconstructionReferenceLocation(SyntaxNode node)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (2)
198Location location, CancellationToken cancellationToken) 200var contextLocation = location;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
CodeGeneration\SymbolEditorTests.cs (5)
356var location = symbol.Locations.Last(); 393var location = symbol.Locations.First(); 434var location = symbol.Locations.Last(); 480var location = symbol.Locations.Last(); 487var newLocation = newSymbol.Locations.Last();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Workspaces\NoCompilationDocumentDiagnosticAnalyzer.cs (1)
30Diagnostic.Create(Descriptor, Location.Create(document.FilePath, default, default))));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (7)
CodeFixes\CodeFixServiceTests.cs (2)
927var location = Location.Create(context.AdditionalFile.Path, span, text.Lines.GetLinePositionSpan(span));
Diagnostics\DiagnosticAnalyzerServiceTests.cs (2)
858var generator = new DiagnosticProducingGenerator(c => Location.Create(c.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10))); 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))))));
EditAndContinue\EditAndContinueLanguageServiceTests.cs (3)
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"]);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
Peek\DefinitionPeekableItem.cs (1)
97foreach (var declaration in sourceLocations)
Peek\PeekableItemFactory.cs (1)
86var firstLocation = symbol.Locations.FirstOrDefault();
Peek\PeekHelpers.cs (1)
47internal static LinePositionSpan GetEntityOfInterestSpan(ISymbol symbol, Workspace workspace, Location identifierLocation, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (7)
Diagnostics\DiagnosticServiceTests.vb (2)
1750context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None)) 1789context.ReportDiagnostic(Diagnostic.Create(Descriptor, Location.None, _symbolNames.Count))
FindReferences\FindReferencesTests.vb (1)
464Private Shared Function IsInSource(loc As Location, uiVisibleOnly As Boolean) As Boolean
Rename\RenameEngineResult.vb (4)
200Private Function GetLabeledLocations(label As String) As IEnumerable(Of Location) 201Dim locations As New List(Of Location) 224Private Sub AssertLocationReplacedWith(location As Location, replacementText As String, Optional isRenameWithinStringOrComment As Boolean = False) 247Private Sub AssertLocationReferencedAs(location As Location, type As RelatedLocationType)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
EvaluationContextBase.cs (3)
111public override IReadOnlyList<Location> AdditionalLocations 126public override Location Location 166internal override Diagnostic WithLocation(Location location)
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
MetadataAsSource\OmniSharpMetadataAsSourceHelpers.cs (1)
19public static Task<Location> GetLocationInGeneratedSourceAsync(ISymbol symbol, Document generatedDocument, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Features (159)
ChangeSignature\AbstractChangeSignatureService.cs (2)
157var declarationLocation = symbol.Locations.FirstOrDefault(); 454private static bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solution solution, out SyntaxNode nodeToUpdate, out DocumentId documentId)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (2)
70var currentLocation = Location.Create(currentTree, currentDiagnosticSpan);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (2)
211var locationToCheck = Location.Create(tree, spanToCheck);
CodeLens\CodeLensFindReferenceProgress.cs (4)
35private readonly ConcurrentSet<Location> _locations = new ConcurrentSet<Location>(LocationComparer.Instance); 51public ImmutableArray<Location> Locations => [.. _locations]; 76private IEnumerable<Location> GetPartialLocations(ISymbol symbol, CancellationToken cancellationToken)
CodeLens\CodeLensReferencesService.cs (3)
101private static async Task<ReferenceLocationDescriptor> GetDescriptorOfEnclosingSymbolAsync(Solution solution, Location location, CancellationToken cancellationToken) 217private static ISymbol GetEnclosingMethod(SemanticModel semanticModel, Location location, CancellationToken cancellationToken) 245private static async Task<ReferenceMethodDescriptor> TryGetMethodDescriptorAsync(Location commonLocation, Solution solution, CancellationToken cancellationToken)
CodeLens\LocationComparer.cs (4)
13internal sealed class LocationComparer : IEqualityComparer<Location> 17public bool Equals(Location x, Location y) 28public int GetHashCode(Location obj)
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
20protected abstract Tuple<ITypeSymbol, Location>? GetInitializedType(Document document, SemanticModel semanticModel, int position, CancellationToken cancellationToken);
Debugging\AbstractBreakpointResolver.cs (1)
80var location = methodSymbol.Locations.First(loc => loc.IsInSource);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (7)
176using var _ = ArrayBuilder<Location>.GetInstance(out var additionalReferences); 195protected virtual Task<ImmutableArray<Location>> GetAdditionalReferencesAsync( 198return SpecializedTasks.EmptyImmutableArray<Location>(); 205ArrayBuilder<Location> additionalReferences, 232foreach (var location in reference.Definition.Locations) 289private static async Task AddLocationSpanAsync(Location location, Solution solution, HashSet<DocumentSpan> spanSet, MultiDictionary<Document, HighlightSpan> tagList, HighlightSpanKind kind, CancellationToken cancellationToken) 300Solution solution, Location location, CancellationToken cancellationToken)
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 (6)
140return Diagnostic.Create(descriptor, Location.None); 171await foreach (var location in CreateChangedLocationsAsync(oldProject, newProject, documentAnalyses, cancellationToken).ConfigureAwait(false)) 179private static async IAsyncEnumerable<Location> CreateChangedLocationsAsync(Project oldProject, Project newProject, ImmutableArray<DocumentAnalysisResults> documentAnalyses, [EnumeratorCancellation] CancellationToken cancellationToken) 202yield return Location.Create(newTree, GetFirstLineDifferenceSpan(oldText, newText)); 208yield return Location.None; 546documentDiagnostics.Add(Diagnostic.Create(descriptor, Location.Create(newDocument.FilePath!, textSpan: default, lineSpan: default), [newDocument.FilePath]));
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
107Location.None,
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDiagnosticAnalyzer.cs (1)
80Location.Create(context.SemanticModel.SyntaxTree, diag.Span),
EmbeddedLanguages\RegularExpressions\LanguageServices\AbstractRegexDiagnosticAnalyzer.cs (1)
92Location.Create(context.SemanticModel.SyntaxTree, diag.Span),
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
174private async Task EnqueueWorkItemAsync(Document thisDocument, ImmutableArray<Location> locations) 179foreach (var location in locations)
ExternalAccess\VSTypeScript\VSTypeScriptTaskListService.cs (2)
41var location = Location.Create(document.FilePath!, textSpan, text.Lines.GetLinePositionSpan(textSpan));
ExtractMethod\MethodExtractor.VariableSymbol.cs (4)
171var leftLocation = leftLocations.First(l => l.SourceTree == commonTree); 172var rightLocation = rightLocations.First(l => l.SourceTree == commonTree); 332var locationLeft = _symbol.Locations.First(); 333var locationRight = other._symbol.Locations.First();
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
125foreach (var location in implementation.Locations)
FindUsages\DefinitionItemFactory.cs (4)
43ImmutableArray<Location> locations, 223private static ImmutableArray<DocumentSpan> GetSourceLocations(ISymbol definition, ImmutableArray<Location> locations, Solution solution, bool includeHiddenLocations) 234foreach (var location in locations) 290var location = referenceLocation.Location;
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (1)
62var afterThisLocation = result.Members.Length == 1
GenerateType\AbstractGenerateTypeService.cs (1)
69public abstract Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
417(INamespaceSymbol, INamespaceOrTypeSymbol, Location) enclosingNamespaceGeneratedTypeToAddAndLocation;
GenerateType\IGenerateTypeService.cs (1)
17Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
65public ImmutableArray<Location> Locations => _symbol.Locations;
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (2)
79Location? navigateLocation = null; 261private async Task<Location> RelocateSymbol_NoLockAsync(Solution solution, MetadataAsSourceGeneratedFileInfo fileInfo, SymbolKey symbolId, CancellationToken cancellationToken)
MetadataAsSource\MetadataAsSourceFile.cs (2)
11internal MetadataAsSourceFile(string filePath, Location identifierLocation, string documentTitle, string documentTooltip) 20public Location IdentifierLocation { get; }
MetadataAsSource\MetadataAsSourceHelpers.cs (4)
71public static async Task<Location> GetLocationInGeneratedSourceAsync(SymbolKey symbolId, Document generatedDocument, CancellationToken cancellationToken) 77var location = GetFirstSourceLocation(resolution); 83location = Location.Create(tree, new TextSpan(0, 0)); 89private static Location? GetFirstSourceLocation(SymbolKeyResolution resolution)
Navigation\NavigableItemFactory.cs (5)
19Solution solution, ISymbol symbol, Location location, 37public static IEnumerable<Location> GetPreferredSourceLocations( 49var generatedSourceLocations = candidateLocationGroups.SingleOrDefault(g => g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>(); 50var nonGeneratedSourceLocations = candidateLocationGroups.SingleOrDefault(g => !g.Key) ?? SpecializedCollections.EmptyEnumerable<Location>(); 55private static IEnumerable<Location> GetPreferredSourceLocations(ISymbol symbol)
Navigation\NavigableItemFactory.SymbolLocationNavigableItem.cs (2)
21Location location, 26private readonly Location _location = location;
NavigationBar\AbstractNavigationBarItemService.cs (2)
79var navigationLocation = symbol.Locations.FirstOrDefault(loc => loc.SourceTree != null && loc.SourceTree != tree) ?? 80Location.Create(allReferences.First().SyntaxTree, allReferences.First().Span);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
249var location = referenceLocation.Location; 289var location = referenceLocation.Location;
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
261var location = referenceLocation.Location;
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
69var location = symbol.Locations.Single();
src\Analyzers\Core\Analyzers\AddRequiredParentheses\AbstractAddRequiredParenthesesDiagnosticAnalyzer.cs (1)
135NotificationOption2 notificationOption, ImmutableArray<Location> additionalLocations,
src\Analyzers\Core\Analyzers\ConvertTypeofToNameof\AbstractConvertTypeOfToNameOfDiagnosticAnalyzer.cs (1)
49var location = parent.GetLocation();
src\Analyzers\Core\Analyzers\FileHeaders\FileHeader.cs (3)
98internal Location GetLocation(SyntaxTree syntaxTree) 102return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, 0)); 105return Location.Create(syntaxTree, new TextSpan(_fileHeaderStart, _commentPrefixLength));
src\Analyzers\Core\Analyzers\Formatting\AbstractFormattingAnalyzer.cs (2)
97var location = Location.Create(tree, change.Span);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (26)
25/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 42Location location, 45IEnumerable<Location>? additionalLocations, 72/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 90Location location, 93ImmutableArray<Location> additionalLocations, 94ImmutableArray<Location> additionalUnnecessaryLocations, 109Location location, 113ImmutableArray<Location> additionalLocations, 114ImmutableArray<Location> additionalUnnecessaryLocations) 136/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 158Location location, 161ImmutableArray<Location> additionalLocations, 162ImmutableArray<Location> additionalUnnecessaryLocations, 179Location location, 183ImmutableArray<Location> additionalLocations, 184ImmutableArray<Location> additionalUnnecessaryLocations, 205Location location, 209IEnumerable<Location> additionalLocations, 240/// <param name="location">An optional primary location of the diagnostic. If null, <see cref="Location"/> will return <see cref="Location.None"/>.</param> 257Location location, 260IEnumerable<Location>? additionalLocations,
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (4)
126var option = GetCodeStyleOption(field, symbolEndContext.Options, out var location); 223var option = GetCodeStyleOption(field, options, out var location); 236private static Location GetDiagnosticLocation(IFieldSymbol field) 295private static CodeStyleOption2<bool> GetCodeStyleOption(IFieldSymbol field, AnalyzerOptions options, out Location diagnosticLocation)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
32protected abstract Location GetDiagnosticLocation(SyntaxNode block);
src\Analyzers\Core\Analyzers\NewLines\MultipleBlankLines\AbstractMultipleBlankLinesDiagnosticAnalyzer.cs (1)
79Location.Create(badTrivia.SyntaxTree!, new TextSpan(badTrivia.SpanStart, 0)),
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (1)
40protected abstract Location GetDiagnosticLocation(TSwitchSyntax switchBlock);
src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchStatementDiagnosticAnalyzer.cs (1)
38protected sealed override Location GetDiagnosticLocation(TSwitchSyntax switchBlock)
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (1)
52protected abstract Location GetLocation(IOperation operation);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
137context.ReportDiagnostic(Diagnostic.Create(s_enableGenerateDocumentationFileIdDescriptor, Location.None));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (3)
127private static Location GetDiagnosticSquiggleLocation(TParenthesizedExpressionSyntax parenthesizedExpression, CancellationToken cancellationToken) 129var parenthesizedExpressionLocation = parenthesizedExpression.GetLocation(); 135return Location.Create(parenthesizedExpression.SyntaxTree, TextSpan.FromBounds(parenthesizedExpressionLocation.SourceSpan.Start, textSpanEndPosition));
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
643ImmutableArray<Location> additionalLocations;
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
130private static Location GetDiagnosticLocation(ISymbol symbol) 539var diagnosticLocation = GetDiagnosticLocation(member); 548: ImmutableArray<Location>.Empty;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (1)
110protected abstract Location GetDefinitionLocationToFade(IOperation unusedDefinition);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
132var location = parameter.Locations[0];
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
63var firstUnnecessaryLocation = unnecessaryLocations[0];
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
29out string? formatString, out ImmutableArray<Location> unnecessaryLocations)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (1)
245ImmutableArray<Location> locations,
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
22public static ImmutableArray<Location> GetLocationsToFade(
src\Analyzers\Core\Analyzers\UseObjectInitializer\AbstractUseObjectInitializerDiagnosticAnalyzer.cs (4)
136private ImmutableArray<Location> FadeOutCode( 143using var locations = TemporaryArray<Location>.Empty; 151var location1 = Location.Create(syntaxTree, TextSpan.FromBounds(
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (3)
46var diagnosticLocation = owningSymbol.Locations[0]; 77var operationLocation = operation.Syntax.GetLocation(); 78var declarationLocation = context.OwningSymbol.DeclaringSyntaxReferences[0].GetSyntax(cancellationToken).GetLocation();
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
352var invalidPlaceholderLocation = Location.Create(
src\Analyzers\Core\CodeFixes\AddRequiredParentheses\AddRequiredParenthesesCodeFixProvider.cs (1)
50var location = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (2)
44protected Location location = null; 45public Location Location
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
62public Location AfterThisLocation { get; private set; } 63public Location BeforeThisLocation { get; private set; }
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
194var location = referenceLocation.Location;
src\Analyzers\Core\CodeFixes\OrderModifiers\AbstractOrderModifiersCodeFixProvider.cs (1)
44var syntaxNode = Location.Create(syntaxTree, context.Span).FindNode(context.CancellationToken);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
144var switchLocation = diagnostic.AdditionalLocations[0];
src\Analyzers\Core\CodeFixes\RemoveUnnecessarySuppressions\RemoveUnnecessaryPragmaSuppressionsCodeFixProvider.cs (2)
60foreach (var location in diagnostic.AdditionalLocations) 69Location location,
src\Analyzers\Core\CodeFixes\SimplifyInterpolation\AbstractSimplifyInterpolationCodeFixProvider.cs (1)
60var loc = diagnostic.AdditionalLocations[0];
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
279var propertyLocation = locations[0]; 280var declaratorLocation = locations[1];
ValueTracking\ValueTrackedItem.cs (1)
45public static async ValueTask<ValueTrackedItem?> TryCreateAsync(Solution solution, Location location, ISymbol symbol, ValueTrackedItem? parent = null, CancellationToken cancellationToken = default)
ValueTracking\ValueTracker.cs (3)
48var location = Location.Create(syntaxRef.SyntaxTree, syntaxRef.Span); 286foreach (var definitionLocation in symbol.Locations)
ValueTracking\ValueTrackingProgressCollector.cs (1)
40internal async Task<bool> TryReportAsync(Solution solution, Location location, ISymbol symbol, CancellationToken cancellationToken = default)
Microsoft.CodeAnalysis.Features.UnitTests (5)
EditAndContinue\RemoteEditAndContinueServiceTests.cs (4)
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\TraceLogTests.cs (1)
20var diagnostic = Diagnostic.Create(EditAndContinueDiagnosticDescriptors.GetDescriptor(EditAndContinueErrorCode.ErrorReadingFile), Location.None, "file", "error");
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
72return Diagnostic.Create(descriptor, Location.None, analyzerName, e.GetType(), e.Message); 327foreach (var location in diagnostic.AdditionalLocations) 334async Task VerifyDiagnosticLocationAsync(string id, Location location)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (5)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (1)
385Diagnostic.Create(Descriptor, Location.Create(document.FilePath!, default, default))));
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
139location: Location.Create(context.AdditionalFile.Path, Text.TextSpan.FromBounds(0, 0), new Text.LinePositionSpan(new Text.LinePosition(0, 0), new Text.LinePosition(0, 0))), "args"));
Diagnostics\PullDiagnosticTests.cs (3)
678var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10))); 1324var generator = new DiagnosticProducingGenerator(context => Location.Create(context.Compilation.SyntaxTrees.Single(), new TextSpan(0, 10))); 1344context => Location.Create(
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 (37)
Diagnostics\CommonDiagnosticAnalyzers.cs (29)
71var location = context.Tree.GetRoot().GetLocation(); 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))); 918private readonly Location _invalidLocation; 953Diagnostic.Create(Descriptor, Location.None, additionalLocations: new[] { _invalidLocation }) : 1261private void ReportDiagnostic(Action<Diagnostic> addDiagnostic, Location location) 1653var diagnostic = Diagnostic.Create(rule, Location.None, args); 1668private void ReportDiagnosticsCore(Action<Diagnostic> addDiagnostic, Location location, params object[] messageArguments) 1804foreach (var location in symbolContext.Symbol.Locations) 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))); 2660var location = Location.Create(context.AdditionalFile.Path, _diagnosticSpan, text.Lines.GetLinePositionSpan(_diagnosticSpan)); 2951private void HandleCallback(Location analysisLocation, Compilation compilation, Action<Diagnostic> reportDiagnostic, CancellationToken cancellationToken)
Diagnostics\DiagnosticDescription.cs (2)
48private readonly Location _location; 538var l = d.Location;
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
43context.ReportDiagnostic(CodeAnalysis.Diagnostic.Create(s_rule, Location.None, messageArgs: Id));
Mocks\TestMessageProvider.cs (3)
21public override Diagnostic CreateDiagnostic(int code, Location location, params object[] args) 258public override void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity) 263public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
SourceGeneration\TestGenerators.cs (2)
56private readonly Func<GeneratorExecutionContext, Location> _produceLocation; 58public DiagnosticProducingGenerator(Func<GeneratorExecutionContext, Location> produceLocation)
Microsoft.CodeAnalysis.UnitTests (10)
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 (7)
37var mainLocation = Location.Create(@"Z:\Main Location.cs", span, position); 40IEnumerable<Location> additionalLocations = new[] { 41Location.Create(@"Relative Additional/Location.cs", span, position), 82logger.LogDiagnostic(Diagnostic.Create(descriptor, Location.None), null); 110var location = Location.Create(
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (1)
1400var location = token.GetLocation();
Microsoft.CodeAnalysis.VisualBasic (479)
Analysis\FlowAnalysis\DataFlowPass.Symbols.vb (3)
54Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 56Return ImmutableArray(Of Location).Empty 76Friend Overrides ReadOnly Property IdentifierLocation As Location
Analysis\FlowAnalysis\DataFlowPass.vb (3)
1099Private Function GetUnassignedSymbolFirstLocation(sym As Symbol, boundFieldAccess As BoundFieldAccess) As Location 1108Dim locations As ImmutableArray(Of Location) = sym.Locations 1193Dim firstLocation As Location = GetUnassignedSymbolFirstLocation(sym, boundFieldAccess)
Binding\Binder.vb (9)
659Public Function GetLocation(span As TextSpan) As Location 881Public Shared Sub ReportDiagnostic(diagBag As DiagnosticBag, location As Location, id As ERRID) 885Public Shared Sub ReportDiagnostic(diagBag As DiagnosticBag, location As Location, id As ERRID, ParamArray args As Object()) 889Public Shared Sub ReportDiagnostic(diagBag As DiagnosticBag, location As Location, info As DiagnosticInfo) 911Public Shared Sub ReportDiagnostic(diagBag As BindingDiagnosticBag, location As Location, id As ERRID) 915Public Shared Sub ReportDiagnostic(diagBag As BindingDiagnosticBag, location As Location, id As ERRID, ParamArray args As Object()) 919Public Shared Sub ReportDiagnostic(diagBag As BindingDiagnosticBag, location As Location, info As DiagnosticInfo) 932Public Shared Function ReportUseSite(diagBag As BindingDiagnosticBag, location As Location, useSiteInfo As UseSiteInfo(Of AssemblySymbol)) As Boolean 1104location As Location,
Binding\Binder_Delegates.vb (1)
1159Dim addressOfLocation As Location = syntaxNode.GetLocation()
Binding\Binder_Expressions.vb (3)
348Dim elementLocations = ArrayBuilder(Of Location).GetInstance(arguments.Count) 3019Dim declarationLocation As Location = localSymbol.IdentifierLocation 3020Dim referenceLocation As Location = node.GetLocation()
Binding\Binder_Invocation.vb (16)
108Dim argumentNamesLocations As ImmutableArray(Of Location) = Nothing 189Dim argumentNamesLocations As ImmutableArray(Of Location) = Nothing 256argumentNamesLocations As ImmutableArray(Of Location), 395argumentNamesLocations As ImmutableArray(Of Location), 1199Optional diagnosticLocationOpt As Location = Nothing 1230Optional diagnosticLocationOpt As Location = Nothing 1296Public Shared Function GetLocationForOverloadResolutionDiagnostic(node As SyntaxNode, Optional groupOpt As BoundMethodOrPropertyGroup = Nothing) As Location 1354Optional diagnosticLocationOpt As Location = Nothing 1764diagnosticLocation As Location, 1825diagnosticLocation As Location, 1901Dim msg = VisualBasicDiagnosticFormatter.Instance.Format(iDiagnostic.WithLocation(Location.None)) 1979diagnosticLocation As Location, 2977ByRef argumentNamesLocations As ImmutableArray(Of Location), 3007ByRef argumentNamesLocations As ImmutableArray(Of Location), 3021Dim argumentNamesLocationsBuilder As ArrayBuilder(Of Location) = Nothing 3035argumentNamesLocationsBuilder = ArrayBuilder(Of Location).GetInstance()
Binding\Binder_ObjectInitializer.vb (2)
36Dim argumentNamesLocations As ImmutableArray(Of Location) = Nothing 143Dim argumentNamesLocations As ImmutableArray(Of Location) = Nothing
Binding\Binder_Query.vb (6)
1961ReportDiagnostic(diagnostics, Location.Create(groupBy.SyntaxTree, GetGroupByOperatorNameSpan(groupBy)), ERRID.ERR_QueryOperatorNotFound, StringConstants.GroupByMethod) 2000ReportDiagnostic(diagnostics, Location.Create(groupBy.SyntaxTree, GetGroupByOperatorNameSpan(groupBy)), ERRID.ERR_QueryOperatorNotFound, StringConstants.GroupByMethod) 2040Location.Create(groupJoin.SyntaxTree, GetQueryOperatorNameSpan(groupJoin.GroupKeyword, groupJoin.JoinKeyword)), 2076Location.Create(groupJoin.SyntaxTree, GetQueryOperatorNameSpan(groupJoin.GroupKeyword, groupJoin.JoinKeyword)), 4664diagnosticLocationOpt:=Location.Create(node.SyntaxTree, operatorNameLocation)) 4716ReportDiagnostic(diagnostics, Location.Create(node.SyntaxTree, operatorNameLocation), ERRID.ERR_QueryOperatorNotFound, operatorName)
Binding\Binder_Statements.vb (1)
2477Dim argumentNamesLocations As ImmutableArray(Of Location) = Nothing
Binding\Binder_Symbols.vb (2)
613Dim locations = ArrayBuilder(Of Location).GetInstance(numElements) 668Dim locationsArray As ImmutableArray(Of Location) = locations.ToImmutableAndFree()
Binding\Binder_XmlLiterals.vb (2)
1657Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1908Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Binding\BindingDiagnosticBag.vb (5)
76Protected Overrides Function ReportUseSiteDiagnostic(diagnosticInfo As DiagnosticInfo, diagnosticBag As DiagnosticBag, location As Location) As Boolean 98Friend Function ReportUseSite(symbol As Symbol, location As Location) As Boolean 152Friend Overloads Function Add(code As ERRID, location As Location) As DiagnosticInfo 158Friend Overloads Function Add(code As ERRID, location As Location, ParamArray args As Object()) As DiagnosticInfo 164Friend Overloads Sub Add(info As DiagnosticInfo, location As Location)
Binding\ExecutableCodeBinder.vb (2)
136Dim bestLocation As Location = Nothing 139Dim sourceLocation As Location = symbol.Locations(0)
Binding\ImplicitVariableBinder.vb (2)
198Public ReadOnly Location As Location 200Public Sub New(name As String, location As Location, errorId As ERRID)
BoundTree\BoundTreeVisitor.vb (1)
161Public Shared Function GetTooLongOrComplexExpressionErrorLocation(node As BoundNode) As Location
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\ClsComplianceChecker.vb (7)
223Dim attributeLocation As Location = Nothing 238Dim attributeLocation As Location = Nothing 396Private Function TryGetAttributeWarningLocation(attribute As VisualBasicAttributeData, ByRef location As Location) As Boolean 685Dim ignoredLocation As Location = Nothing 715Private Function GetDeclaredCompliance(symbol As Symbol, <Out> ByRef attributeLocation As Location) As Boolean? 758Private Function GetDeclaredComplianceHelper(symbol As Symbol, <Out> ByRef attributeLocation As Location, <Out> ByRef isAttributeInherited As Boolean) As Boolean? 838Private Sub AddDiagnostic(symbol As Symbol, code As ERRID, location As Location, ParamArray args As Object())
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (13)
40Private _inProgressIncludeElementNodes As HashSet(Of Location) 442Dim location As location = GetIncludeElementLocation(includeElement, currentXmlFilePath, originatingSyntax) 546Private Function ShouldProcessLocation(loc As Location) As Boolean 552Private Function GenerateDiagnostic(suppressDiagnostic As Boolean, loc As Location, id As ERRID, ParamArray arguments As Object()) As String 560Private Function GenerateDiagnostic(loc As Location, id As ERRID, ParamArray arguments As Object()) As String 564Private Function AddIncludeElementLocation(location As Location) As Boolean 566Me._inProgressIncludeElementNodes = New HashSet(Of location)() 572Private Function RemoveIncludeElementLocation(location As Location) As Boolean 579Private Function GetIncludeElementLocation(includeElement As XElement, ByRef currentXmlFilePath As String, ByRef originatingSyntax As XmlNodeSyntax) As Location 580Dim location As location = includeElement.Annotation(Of location)() 713Private Sub ProcessErrorLocations(currentXmlLocation As XmlLocation, referenceName As String, useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol), errorLocations As ImmutableArray(Of Location), errid As Nullable(Of ERRID)) 767Dim loc As Location = XmlLocation.Create(attribute, currentXmlFilePath)
Compilation\DocumentationComments\DocumentationCommentCompiler.vb (1)
85diagnostics.Add(ERRID.ERR_DocFileGen, Location.None, ex.Message)
Compilation\DocumentationComments\DocumentationCommentWalker.vb (2)
277Private Sub ProcessErrorLocations(node As SyntaxNode, errorLocations As ImmutableArray(Of Location), useSiteInfo As CompoundUseSiteInfo(Of AssemblySymbol), errid As Nullable(Of ERRID)) 296Private Sub ProcessBadNameInCrefAttribute(crefAttribute As XmlCrefAttributeSyntax, errorLocation As Location, errid As ERRID)
Compilation\MethodCompiler.vb (3)
769Dim location As Location = sourceMethod.NonMergedLocation 1993Dim locations As ImmutableArray(Of Location) = If(constructor.IsImplicitlyDeclared, containingType.Locations, constructor.Locations) 1994diagnostics.Add(If(locations.IsDefaultOrEmpty, Location.None, locations(0)), useSiteInfo)
Compilation\VisualBasicCompilation.vb (9)
482diagnostics.Add(ERRID.ERR_DebugEntryPointNotSourceMethodDefinition, Location.None) 1249Friend Overrides Function CompareSourceLocations(first As Location, second As Location) As Integer 1650Dim location As Location = sourceMethod.NonMergedLocation 2857elementLocations As ImmutableArray(Of Location), 2875elementLocations As ImmutableArray(Of Location), 2917memberLocations As ImmutableArray(Of Location), 2933Dim loc = If(memberLocations.IsDefault, Location.None, memberLocations(i)) 2939fields.ToImmutableAndFree(), Location.None, isImplicitlyDeclared:=False)
Compilation\VisualBasicDiagnosticFilter.vb (1)
128location As Location,
Declarations\GlobalNamespaceDeclaration.vb (1)
28nameLocation As Location,
Declarations\MergedNamespaceDeclaration.vb (3)
56Public ReadOnly Property NameLocations As ImmutableArray(Of Location) 61Return ImmutableArray(Of Location).Empty 66Dim builder = ArrayBuilder(Of Location).GetInstance()
Declarations\MergedTypeDeclaration.vb (2)
119Public ReadOnly Property NameLocations As ImmutableArray(Of Location) 125Dim builder = ArrayBuilder(Of Location).GetInstance()
Declarations\SingleNamespaceDeclaration.vb (1)
24nameLocation As Location,
Declarations\SingleNamespaceOrTypeDeclaration.vb (3)
12Public ReadOnly NameLocation As Location 14Protected Sub New(name As String, syntaxReference As SyntaxReference, nameLocation As Location) 20Public ReadOnly Property Location As Location
Declarations\SingleTypeDeclaration.vb (1)
38nameLocation As Location,
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
265diagnostics.Add(ErrorFactory.ErrorInfo(ERRID.ERR_EncNoPIAReference, embeddedType.AdaptedNamedTypeSymbol), Location.None)
Emit\PEModuleBuilder.vb (5)
203Dim location As Location = Nothing 273Dim location As Location = GetSmallestSourceLocationOrNull(symbol) 279Private Sub AddSymbolLocation(result As MultiDictionary(Of Cci.DebugSourceDocument, Cci.DefinitionWithLocation), location As Location, definition As Cci.IDefinition) 294Private Function GetSmallestSourceLocationOrNull(symbol As Symbol) As Location 298Dim result As Location = Nothing
Emit\SynthesizedNamespaceSymbol.vb (2)
38Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 40Return ImmutableArray(Of Location).Empty
Errors\CustomDiagnostics.vb (3)
53Public Overrides ReadOnly Property AdditionalLocations As IReadOnlyList(Of Location) 92Public Overrides ReadOnly Property AdditionalLocations As IReadOnlyList(Of Location) 94Dim builder = ArrayBuilder(Of Location).GetInstance()
Errors\DiagnosticBagExtensions.vb (4)
25Friend Function Add(diagnostics As DiagnosticBag, code As ERRID, location As Location) As DiagnosticInfo 41Friend Function Add(diagnostics As DiagnosticBag, code As ERRID, location As Location, ParamArray args As Object()) As DiagnosticInfo 49Friend Sub Add(diagnostics As DiagnosticBag, info As DiagnosticInfo, location As Location) 87location As Location,
Errors\MessageProvider.vb (7)
88Public Overrides Function CreateDiagnostic(code As Integer, location As Location, ParamArray args() As Object) As Diagnostic 93Return New VBDiagnostic(info, Location.None) 121Location.None, 386Public Overrides Sub ReportDuplicateMetadataReferenceStrong(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity) 388DirectCast(location, Location), 393Public Overrides Sub ReportDuplicateMetadataReferenceWeak(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity) 395DirectCast(location, Location),
Errors\VBDiagnostic.vb (2)
13Friend Sub New(info As DiagnosticInfo, location As Location, Optional isSuppressed As Boolean = False) 21Friend Overrides Function WithLocation(location As Location) As Diagnostic
Locations\LocationExtensions.vb (3)
13Public Function EmbeddedKind(location As Location) As EmbeddedSymbolKind 23Public Function PossiblyEmbeddedOrMySourceSpan(location As Location) As TextSpan 33Public Function PossiblyEmbeddedOrMySourceTree(location As Location) As SyntaxTree
Lowering\LambdaRewriter\LambdaCapturedVariable.vb (2)
110Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 112Return ImmutableArray(Of Location).Empty
Lowering\LambdaRewriter\SynthesizedLambdaMethod.vb (2)
25Private ReadOnly _locations As ImmutableArray(Of Location) 130Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
45Dim addressOfLocation As Location = syntaxNode.GetLocation()
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (3)
158Private ReadOnly _locations As ImmutableArray(Of Location) 174Me._locations = ImmutableArray.Create(Of Location)(syntax.GetLocation()) 248Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Lowering\StateMachineRewriter\SynthesizedContainer.vb (2)
268Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 270Return ImmutableArray(Of Location).Empty
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.vb (2)
23Private ReadOnly _locations As ImmutableArray(Of Location) 78Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Lowering\StateMachineRewriter\SynthesizedStateMachineProperty.vb (2)
94Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 96Return ImmutableArray(Of Location).Empty
Parser\Parser.vb (2)
6131Friend Shared Function CheckFeatureAvailability(diagnosticsOpt As DiagnosticBag, location As Location, languageVersion As LanguageVersion, feature As Feature) As Boolean 6150Friend Shared Function CheckFeatureAvailability(diagnostics As BindingDiagnosticBag, location As Location, languageVersion As LanguageVersion, feature As Feature) As Boolean
Semantics\Operators.vb (2)
3417Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 3419Return ImmutableArray(Of Location).Empty
Symbols\AliasSymbol.vb (3)
58Private ReadOnly _aliasLocations As ImmutableArray(Of Location) 65aliasLocation As Location) 118Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\AnonymousTypes\AnonymousTypeDescriptor.vb (5)
25Public ReadOnly Location As Location 49Public Sub New(fields As ImmutableArray(Of AnonymousTypeField), location As Location, isImplicitlyDeclared As Boolean) 156Public ReadOnly Location As Location 185Public Sub New(name As String, type As TypeSymbol, location As Location, Optional isKeyOrByRef As Boolean = False) 192Public Sub New(name As String, location As Location, isKey As Boolean)
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (8)
28Private ReadOnly _sourceLocationsSeen As New ConcurrentDictionary(Of Location, Boolean) 34Dim location As Location = anonymous.Locations(0) 166Dim names = key.Fields.SelectAsArray(Function(f) New AnonymousTypeField(f.Name, Location.None, f.IsKey)) 167Return New AnonymousTypeDescriptor(names, Location.None, True) 334Private Function CompareLocations(x As Location, y As Location) As Integer 337ElseIf x = Location.None Then 339ElseIf y = Location.None Then
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_PropertyPublicSymbol.vb (1)
77Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\AnonymousTypes\PublicSymbols\AnonymousTypeOrDelegatePublicSymbol.vb (2)
170Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 172Return ImmutableArray.Create(Of Location)(Me.TypeDescriptor.Location)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (1)
210Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_PropertySymbol.vb (2)
191Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 193Return ImmutableArray(Of Location).Empty
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (5)
269Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 271Return ImmutableArray(Of Location).Empty 309Public ReadOnly Location As Location 319Public ReadOnly Property SmallestLocation As Location 336Dim newLocation As Location = typeDescr.Location
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTypeParameterSymbol.vb (2)
51Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 53Return ImmutableArray(Of Location).Empty
Symbols\ArrayTypeSymbol.vb (2)
283Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 285Return ImmutableArray(Of Location).Empty
Symbols\Attributes\AttributeData.vb (12)
252Friend Shared Function GetArgumentLocation(nodeOpt As AttributeSyntax, argumentIndex As Integer) As Location 256Private Shared Function GetArgumentDisplayAndLocation(nodeOpt As AttributeSyntax, value As Integer, argumentIndex As Integer) As (ArgumentDisplay As String, Location As Location) 269Friend Shared Function GetFirstArgumentLocation(nodeOpt As AttributeSyntax) As Location 273Private Shared Function GetFirstArgumentDisplayAndLocation(nodeOpt As AttributeSyntax, value As Integer) As (ArgumentDisplay As String, Location As Location) 296Dim displayAndLocation As (ArgumentDisplay As String, Location As Location) = GetFirstArgumentDisplayAndLocation(nodeOpt, securityAction) 325Dim displayAndLocation As (ArgumentDisplay As String, Location As Location) = GetFirstArgumentDisplayAndLocation(nodeOpt, securityAction) 337Dim displayAndLocation As (ArgumentDisplay As String, Location As Location) = GetFirstArgumentDisplayAndLocation(nodeOpt, securityAction) 348Dim displayAndLocation As (ArgumentDisplay As String, Location As Location) = GetFirstArgumentDisplayAndLocation(nodeOpt, securityAction) 396Dim argSyntaxLocation As Location = If(arguments.AttributeSyntaxOpt IsNot Nothing, 448Dim location As Location = GetFirstArgumentLocation(nodeOpt) 456Dim location As Location = GetFirstArgumentLocation(node) 498Dim location As Location = GetFirstArgumentLocation(nodeOpt)
Symbols\ConstraintsHelper.vb (3)
387loc As Location, 449elementLocations As ImmutableArray(Of Location), 548diagnosticLocation As Location,
Symbols\EmbeddedSymbols\EmbeddedSymbolExtensions.vb (1)
34Public Function IsEmbeddedOrMyTemplateLocation(location As Location) As Boolean
Symbols\ErrorMethodSymbol.vb (2)
180Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 182Return ImmutableArray(Of Location).Empty
Symbols\ErrorTypeSymbol.vb (2)
127Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 129Return ImmutableArray(Of Location).Empty
Symbols\IndexedTypeParameterSymbol.vb (2)
155Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 157Return ImmutableArray(Of Location).Empty
Symbols\InstanceErrorTypeSymbol.vb (2)
248Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 250Return ImmutableArray(Of Location).Empty
Symbols\LabelSymbol.vb (2)
68Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 70Return ImmutableArray(Of Location).Empty
Symbols\LexicalSortKey.vb (3)
108Public Sub New(location As Location, compilation As VisualBasicCompilation) 180Public Shared Function Compare(first As Location, second As Location, compilation As VisualBasicCompilation) As Integer
Symbols\MergedNamespaceSymbol.vb (2)
345Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 347Return ImmutableArray.CreateRange(Of Location)((From ns In _namespacesToMerge, loc In ns.Locations Select loc))
Symbols\Metadata\PE\PEAssemblySymbol.vb (2)
138Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 140Return StaticCast(Of Location).From(PrimaryModule.MetadataLocation)
Symbols\Metadata\PE\PEEventSymbol.vb (1)
241Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Metadata\PE\PEFieldSymbol.vb (2)
357Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 359Return StaticCast(Of Location).From(_containingType.ContainingPEModule.MetadataLocation)
Symbols\Metadata\PE\PEMethodSymbol.vb (2)
901Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 903Return StaticCast(Of Location).From(_containingType.ContainingPEModule.MetadataLocation)
Symbols\Metadata\PE\PEModuleSymbol.vb (2)
260Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 262Return StaticCast(Of Location).From(Me.MetadataLocation)
Symbols\Metadata\PE\PENamedTypeSymbol.vb (2)
818Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 820Return StaticCast(Of Location).From(ContainingPEModule.MetadataLocation)
Symbols\Metadata\PE\PENamespaceSymbol.vb (2)
132Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 134Return StaticCast(Of Location).From(ContainingPEModule.MetadataLocation)
Symbols\Metadata\PE\PEParameterSymbol.vb (1)
454Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Metadata\PE\PEPropertySymbol.vb (1)
315Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Metadata\PE\PETypeParameterSymbol.vb (1)
272Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\MissingAssemblySymbol.vb (2)
109Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 111Return ImmutableArray(Of Location).Empty
Symbols\MissingModuleSymbol.vb (2)
94Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 96Return ImmutableArray(Of Location).Empty
Symbols\MissingNamespaceSymbol.vb (2)
85Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 87Return ImmutableArray(Of Location).Empty
Symbols\PreprocessingSymbol.vb (2)
28Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 30Return ImmutableArray(Of Location).Empty
Symbols\ReducedExtensionMethodSymbol.vb (3)
597Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 772Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 987Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingAssemblySymbol.vb (1)
156Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingEventSymbol.vb (1)
160Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingFieldSymbol.vb (1)
216Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingMethodSymbol.vb (1)
256Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingModuleSymbol.vb (1)
154Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingNamedTypeSymbol.vb (1)
431Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingNamespaceSymbol.vb (1)
126Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingParameterSymbol.vb (1)
204Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingPropertySymbol.vb (1)
187Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Retargeting\RetargetingTypeParameterSymbol.vb (1)
125Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SignatureOnlyMethodSymbol.vb (1)
198Public Overrides ReadOnly Property Locations() As ImmutableArray(Of Location)
Symbols\SignatureOnlyParameterSymbol.vb (1)
143Public Overrides ReadOnly Property Locations() As ImmutableArray(Of Location)
Symbols\SignatureOnlyPropertySymbol.vb (1)
214Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\BoundLambdaParameterSymbol.vb (1)
29location As Location
Symbols\Source\CrefTypeParameterSymbol.vb (2)
110Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 112Return ImmutableArray.Create(Of Location)(Me._syntaxReference.GetLocation())
Symbols\Source\CustomEventAccessorSymbol.vb (2)
26location As Location) 150Private Function BindParameters(location As Location,
Symbols\Source\ImplementsHelper.vb (1)
42Public Function GetImplementingLocation(sourceSym As Symbol, implementedSym As Symbol) As Location
Symbols\Source\ImplicitNamedTypeSymbol.vb (1)
168Protected Overrides Function GetInheritsOrImplementsLocation(base As NamedTypeSymbol, getInherits As Boolean) As Location
Symbols\Source\LambdaParameterSymbol.vb (5)
15Private ReadOnly _location As ImmutableArray(Of Location) 26location As Location 33_location = ImmutableArray.Create(Of Location)(location) 35_location = ImmutableArray(Of Location).Empty 137Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\LambdaSymbol.vb (1)
254Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\LocalSymbol.vb (5)
192Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 198Friend MustOverride ReadOnly Property IdentifierLocation As Location 592Friend NotOverridable Overrides ReadOnly Property IdentifierLocation As Location 989Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1001Friend Overrides ReadOnly Property IdentifierLocation As Location
Symbols\Source\MeParameterSymbol.vb (2)
42Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 44Return If(_container Is Nothing, ImmutableArray(Of Location).Empty, _container.Locations)
Symbols\Source\OverloadingHelper.vb (3)
105Dim locationOfFirstOverride As Location = Nothing 132Dim locationOfFirstName As Location = Nothing 150Dim metadataLocation As Location = Nothing
Symbols\Source\RangeVariableSymbol.vb (5)
53Public MustOverride Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 183Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 185Return ImmutableArray.Create(Of Location)(_identifierToken.GetLocation()) 265Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 267Return ImmutableArray.Create(Of Location)(_syntax.GetLocation())
Symbols\Source\SourceAssemblySymbol.vb (10)
74Private _lazyInternalsVisibleToMap As ConcurrentDictionary(Of String, ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String))) 818Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 914Dim result As ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)) = Nothing 984New ConcurrentDictionary(Of String, ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)))(StringComparer.OrdinalIgnoreCase), Nothing) 991Dim locationAndValue As Tuple(Of Location, String) = Nothing 997locationAndValue = New Tuple(Of Location, String)(If(nodeOpt IsNot Nothing, nodeOpt.GetLocation(), NoLocation.Singleton), displayName) 1003Dim keys As ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)) = Nothing 1007keys = New ConcurrentDictionary(Of ImmutableArray(Of Byte), Tuple(Of Location, String)) 1045Dim attributeArgumentSyntaxLocation As Location = GetAssemblyAttributeFirstArgumentLocation(arguments.AttributeSyntaxOpt) 1162Private Shared Function GetAssemblyAttributeFirstArgumentLocation(attributeSyntaxOpt As AttributeSyntax) As Location
Symbols\Source\SourceClonedParameterSymbol.vb (1)
60Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SourceComplexParameterSymbol.vb (3)
278location As Location, 294location As Location, 424location As Location,
Symbols\Source\SourceEnumConstantSymbol.vb (1)
57Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SourceEventSymbol.vb (3)
24Private ReadOnly _location As Location 444Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 723Friend Function GetImplementingLocation(implementedEvent As EventSymbol) As Location
Symbols\Source\SourceFieldSymbol.vb (3)
618Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 620Return ImmutableArray.Create(Of Location)(GetSymbolLocation(_syntaxRef)) 864Private Shared Function GetSymbolLocation(syntaxRef As SyntaxReference) As Location
Symbols\Source\SourceFile.vb (1)
356location As Location,
Symbols\Source\SourceLabelSymbol.vb (2)
54Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 56Return ImmutableArray.Create(Of Location)(_labelName.GetLocation())
Symbols\Source\SourceMemberContainerTypeSymbol.vb (22)
120Dim bestLocation As Location = best.Location 482Private Function GetImplementsLocation(implementedInterface As NamedTypeSymbol, ByRef directInterface As NamedTypeSymbol) As Location 502Private Function GetImplementsLocation(implementedInterface As NamedTypeSymbol) As Location 507Protected MustOverride Function GetInheritsOrImplementsLocation(base As NamedTypeSymbol, getInherits As Boolean) As Location 540location As Location, 971Dim location As Location 1014Dim location As Location 1045Dim location As Location = param.Locations(0) 1085Dim location As Location 1121Dim location As Location 1376Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1786Dim bestPartialMethodLocation As Location = bestPartialMethod.NonMergedLocation 1791Dim bestImplLocation As Location = Nothing 1802Dim candidateLocation As Location = candidate.NonMergedLocation 1896implMethodLocation As Location, 2319Private Sub CheckDefaultPropertyAgainstAllBases(namedType As NamedTypeSymbol, defaultPropertyName As String, location As Location, diagBag As BindingDiagnosticBag) 2331Private Sub CheckDefaultPropertyAgainstBase(defaultPropertyName As String, baseType As NamedTypeSymbol, location As Location, diagBag As BindingDiagnosticBag) 3840Private Sub ReportOverloadsErrors(comparisonResults As SymbolComparisonResults, firstMember As Symbol, secondMember As Symbol, location As Location, diagnostics As BindingDiagnosticBag) 3905Dim location1, location2 As Location 3955Dim location1, location2 As Location 3987Dim location1 As Location = GetImplementsLocation(interface1, directInterface1) 3988Dim location2 As Location = GetImplementsLocation(interface2, directInterface2)
Symbols\Source\SourceMemberMethodSymbol.vb (3)
230Dim location As Location = methodImpl.NonMergedLocation 243Dim location As Location = methodImpl.NonMergedLocation 258Dim location As Location = methodImpl.NonMergedLocation
Symbols\Source\SourceMethodSymbol.vb (10)
48Private _lazyLocations As ImmutableArray(Of Location) 61Optional locations As ImmutableArray(Of Location) = Nothing) 818Friend ReadOnly Property NonMergedLocation As Location 831Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 838Dim location As Location = Me.NonMergedLocation 841ImmutableArray(Of Location).Empty, 851Private Function GetSymbolLocation(syntaxRef As SyntaxReference) As Location 1151Friend Function GetImplementingLocation(implementedMethod As MethodSymbol) As Location 1809Dim location As Location = methodImpl.NonMergedLocation 2043Optional locations As ImmutableArray(Of Location) = Nothing)
Symbols\Source\SourceModuleSymbol.vb (2)
48Private _locations As ImmutableArray(Of Location) 204Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SourceNamedTypeSymbol.vb (4)
1306Private Function GetInheritsLocation(base As NamedTypeSymbol) As Location 1310Protected Overrides Function GetInheritsOrImplementsLocation(base As NamedTypeSymbol, getInherits As Boolean) As Location 1311Dim backupLocation As Location = Nothing 1436Dim location As Location
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (4)
870Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1217Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1606Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1800Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SourceNamespaceSymbol.vb (2)
280Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 282Return StaticCast(Of Location).From(_declaration.NameLocations)
Symbols\Source\SourceParameterSymbol.vb (6)
16Private ReadOnly _location As Location 25location As Location) 33Friend ReadOnly Property Location As Location 69Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 72Return ImmutableArray.Create(Of Location)(_location) 74Return ImmutableArray(Of Location).Empty
Symbols\Source\SourcePropertyAccessorSymbol.vb (2)
32locations As ImmutableArray(Of Location)) 390location As Location,
Symbols\Source\SourcePropertySymbol.vb (5)
30Private ReadOnly _location As Location 67location As Location) 451Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 1003Friend Function GetImplementingLocation(implementedProperty As PropertySymbol) As Location 1133Private Shared Function GetAccessorBlockBeginLocation(accessor As SourcePropertyAccessorSymbol) As Location
Symbols\Source\SourceSimpleParameterSymbol.vb (2)
30location As Location) 181location As Location,
Symbols\Source\SourceTypeParameterSymbol.vb (5)
166Protected Shared Function GetSymbolLocation(syntaxRef As SyntaxReference) As Location 206Private Shared Function GetLocation(diagnostic As TypeParameterDiagnosticInfo) As Location 260Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 262Dim builder = ArrayBuilder(Of Location).GetInstance() 338Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SynthesizedEntryPointSymbol.vb (2)
133Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 135Return ImmutableArray(Of Location).Empty
Symbols\Source\SynthesizedFieldSymbol.vb (1)
136Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SynthesizedInteractiveInitializerMethod.vb (1)
99Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
76Dim diagnosticLocation As Location = attributeSyntax.GetLocation()
Symbols\Source\SynthesizedMyGroupCollectionPropertySymbol.vb (3)
107Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 109Return ImmutableArray(Of Location).Empty 124Dim diagnosticLocation As Location = AttributeSyntax.GetLocation()
Symbols\Source\UnboundLambdaParameterSymbol.vb (1)
27location As Location,
Symbols\SubstitutedEventSymbol.vb (1)
109Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedFieldSymbol.vb (1)
150Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedMethodSymbol.vb (1)
267Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedNamedType.vb (1)
218Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedParameterSymbol.vb (1)
86Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedPropertySymbol.vb (1)
190Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SubstitutedTypeParameterSymbol.vb (1)
147Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Symbol.vb (4)
341Public MustOverride ReadOnly Property Locations As ImmutableArray(Of Location) 366Friend Shared Function GetDeclaringSyntaxNodeHelper(Of TNode As VisualBasicSyntaxNode)(locations As ImmutableArray(Of Location)) As ImmutableArray(Of VisualBasicSyntaxNode) 390Friend Shared Function GetDeclaringSyntaxReferenceHelper(Of TNode As VisualBasicSyntaxNode)(locations As ImmutableArray(Of Location)) As ImmutableArray(Of SyntaxReference) 1295Private ReadOnly Property ISymbol_Locations As ImmutableArray(Of Location) Implements ISymbol.Locations, ISymbolInternal.Locations
Symbols\SynthesizedSymbols\SynthesizedAccessor.vb (1)
122Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedBackingFieldBase.vb (1)
83Public NotOverridable Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (1)
115Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedConstructorBase.vb (1)
179Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedDelegateMethodSymbol.vb (1)
294Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedEventDelegateSymbol.vb (1)
219Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedGlobalMethodBase.vb (2)
138Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 140Return ImmutableArray(Of Location).Empty
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionConstructorSymbol.vb (1)
72Location.None,
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionSymbol.vb (2)
130Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 132Return ImmutableArray(Of Location).Empty
Symbols\SynthesizedSymbols\SynthesizedInterfaceImplementationStubSymbol.vb (2)
166Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 168Return ImmutableArray(Of Location).Empty
Symbols\SynthesizedSymbols\SynthesizedIntrinsicOperatorSymbol.vb (2)
152Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 154Return ImmutableArray(Of Location).Empty
Symbols\SynthesizedSymbols\SynthesizedLocal.vb (3)
34Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 36Return If(_syntaxOpt Is Nothing, ImmutableArray(Of Location).Empty, ImmutableArray.Create(_syntaxOpt.GetLocation())) 57Friend NotOverridable Overrides ReadOnly Property IdentifierLocation As Location
Symbols\SynthesizedSymbols\SynthesizedMethod.vb (2)
174Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 176Return ImmutableArray(Of Location).Empty
Symbols\SynthesizedSymbols\SynthesizedOverridingWitheventsProperty.vb (1)
179Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedParameterSymbol.vb (6)
208Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 210Return ImmutableArray(Of Location).Empty 425Private ReadOnly _locations As ImmutableArray(Of Location) 427Public Sub New(container As MethodSymbol, type As TypeSymbol, ordinal As Integer, isByRef As Boolean, name As String, location As Location) 429Me._locations = ImmutableArray.Create(Of location)(location) 432Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedSymbols\SynthesizedRegularMethodBase.vb (1)
129Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Tuples\TupleErrorFieldSymbol.vb (5)
27Private ReadOnly _locations As ImmutableArray(Of Location) 38location As Location, 47Me._locations = If((location Is Nothing), ImmutableArray(Of Location).Empty, ImmutableArray.Create(Of Location)(location)) 92Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Tuples\TupleFieldSymbol.vb (6)
134Private ReadOnly _locations As ImmutableArray(Of Location) 145location As Location, 151Me._locations = If((location Is Nothing), ImmutableArray(Of Location).Empty, ImmutableArray.Create(Of Location)(location)) 160Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 228location As Location,
Symbols\Tuples\TupleTypeSymbol.vb (21)
19Private ReadOnly _locations As ImmutableArray(Of Location) 21Private ReadOnly _elementLocations As ImmutableArray(Of Location) 158Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 332Private Sub New(locationOpt As Location, underlyingType As NamedTypeSymbol, elementLocations As ImmutableArray(Of Location), 336Me.New(If((locationOpt Is Nothing), ImmutableArray(Of Location).Empty, ImmutableArray.Create(Of Location)(locationOpt)), 340Private Sub New(locations As ImmutableArray(Of Location), underlyingType As NamedTypeSymbol, 341elementLocations As ImmutableArray(Of Location), elementNames As ImmutableArray(Of String), 360locationOpt As Location, 362elementLocations As ImmutableArray(Of Location), 392Return TupleTypeSymbol.Create(ImmutableArray(Of Location).Empty, tupleCompatibleType, Nothing, Nothing, Nothing) 396Return TupleTypeSymbol.Create(ImmutableArray(Of Location).Empty, tupleCompatibleType, Nothing, elementNames, errorPositions:=Nothing) 399Public Shared Function Create(locationOpt As Location, tupleCompatibleType As NamedTypeSymbol, 400elementLocations As ImmutableArray(Of Location), elementNames As ImmutableArray(Of String), 403Return TupleTypeSymbol.Create(If((locationOpt Is Nothing), ImmutableArray(Of Location).Empty, ImmutableArray.Create(Of Location)(locationOpt)), 407Public Shared Function Create(locations As ImmutableArray(Of Location), tupleCompatibleType As NamedTypeSymbol, 408elementLocations As ImmutableArray(Of Location), elementNames As ImmutableArray(Of String), 447Dim extensionTuple As TupleTypeSymbol = TupleTypeSymbol.Create(CType(Nothing, Location), tupleCompatibleType, Nothing, Nothing, Nothing) 497Return New TupleTypeSymbol(CType(Nothing, Location), Me._underlyingType, Nothing, newElementNames, Me._elementTypes, Nothing)
Symbols\TypeParameterConstraint.vb (5)
15Public Sub New(kind As TypeParameterConstraintKind, loc As Location) 22Public Sub New(type As TypeSymbol, loc As Location) 27Private Sub New(kind As TypeParameterConstraintKind, type As TypeSymbol, loc As Location) 35Public Function AtLocation(loc As Location) As TypeParameterConstraint 41Public ReadOnly LocationOpt As Location
Symbols\UnboundGenericType.vb (1)
215Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedEventSymbol.vb (1)
46Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedFieldSymbol.vb (1)
112Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedMethodSymbol.vb (1)
66Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedNamedTypeSymbol.vb (1)
90Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedParameterSymbol.vb (1)
55Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedPropertySymbol.vb (1)
65Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\Wrapped\WrappedTypeParameterSymbol.vb (1)
76Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Syntax\VisualBasicSyntaxNode.vb (1)
440Public Shadows Function GetLocation() As Location
Syntax\VisualBasicSyntaxTree.vb (1)
491Public Overrides Function GetLocation(span As TextSpan) As Location
VisualBasicExtensions.vb (1)
223Friend Function GetLocation(syntaxReference As SyntaxReference) As Location
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (6)
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
43Protected Overrides Function GetDiagnosticLocation(block As SyntaxNode) As Location
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
40Protected Overrides Function GetLocation(operation As IOperation) As Location
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
74Protected Overrides Function GetDefinitionLocationToFade(unusedDefinition As IOperation) As Location
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
61additionalLocations:=ImmutableArray(Of Location).Empty, 85additionalLocations:=ImmutableArray(Of Location).Empty,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1550Public Function GetDeconstructionReferenceLocation(node As SyntaxNode) As Location Implements ISyntaxFacts.GetDeconstructionReferenceLocation
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (3)
CommandLineTests.vb (3)
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), 11092Dim diagLocation = Location.Create(path, span, linePosSpan)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (6)
CodeGen\CodeGenTuples.vb (5)
6872Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) 6921Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) 6922Dim loc2 = Location.Create(tree, New TextSpan(1, 1)) 7270Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) 7271Dim loc2 = Location.Create(tree, New TextSpan(1, 1))
Emit\EmitMetadata.vb (1)
481Assert.Equal(ImmutableArray.Create(Of Location)(), method1Ret.Locations)
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (24)
Symbols\DisplayClassVariable.vb (1)
180Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EEDisplayClassFieldLocalSymbol.vb (2)
42Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 48Friend Overrides ReadOnly Property IdentifierLocation As Location
Symbols\EELocalConstantSymbol.vb (2)
63Friend Overrides ReadOnly Property IdentifierLocation As Location 69Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EELocalSymbol.vb (4)
14Private ReadOnly _locations As ImmutableArray(Of Location) 23locations As ImmutableArray(Of Location), 89Friend Overrides ReadOnly Property IdentifierLocation As Location 95Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EELocalSymbolBase.vb (1)
26Friend Shared ReadOnly NoLocations As ImmutableArray(Of Location) = ImmutableArray.Create(NoLocation.Singleton)
Symbols\EEMethodSymbol.vb (3)
32Private ReadOnly _locations As ImmutableArray(Of Location) 56location As Location, 354Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EENamedTypeSymbol.vb (1)
263Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EEStaticLocalSymbol.vb (2)
60Friend Overrides ReadOnly Property IdentifierLocation As Location 66Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\EETypeParameterSymbol.vb (1)
73Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\PlaceholderLocalSymbol.vb (2)
76Friend Overrides ReadOnly Property IdentifierLocation As Location 82Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\PlaceholderMethodSymbol.vb (2)
131Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 133Return ImmutableArray(Of Location).Empty
Symbols\SimpleTypeParameterSymbol.vb (1)
97Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
Symbols\SynthesizedContextMethodSymbol.vb (1)
57Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location)
SyntaxHelpers.vb (1)
142diagnostics.Add(ERRID.ERR_InvalidFormatSpecifier, Location.None, token)
Microsoft.CodeAnalysis.VisualBasic.Features (8)
Completion\CompletionProviders\ObjectInitializerCompletionProvider.vb (2)
58cancellationToken As CancellationToken) As Tuple(Of ITypeSymbol, Location) 93Dim initializerLocation As Location = token.GetLocation()
GenerateType\VisualBasicGenerateTypeService.vb (1)
426Public Overrides Async Function GetOrGenerateEnclosingNamespaceSymbolAsync(namedTypeSymbol As INamedTypeSymbol, containers() As String, selectedDocument As Document, selectedDocumentRoot As SyntaxNode, cancellationToken As CancellationToken) As Task(Of (INamespaceSymbol, INamespaceOrTypeSymbol, Location))
src\Analyzers\VisualBasic\Analyzers\NewLines\ConsecutiveStatementPlacement\VisualBasicConsecutiveStatementPlacementDiagnosticAnalyzer.vb (1)
43Protected Overrides Function GetDiagnosticLocation(block As SyntaxNode) As Location
src\Analyzers\VisualBasic\Analyzers\QualifyMemberAccess\VisualBasicQualifyMemberAccessDiagnosticAnalyzer.vb (1)
40Protected Overrides Function GetLocation(operation As IOperation) As Location
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedParametersAndValues\VisualBasicRemoveUnusedParametersAndValuesDiagnosticAnalyzer.vb (1)
74Protected Overrides Function GetDefinitionLocationToFade(unusedDefinition As IOperation) As Location
src\Analyzers\VisualBasic\Analyzers\UseInferredMemberName\VisualBasicUseInferredMemberNameDiagnosticAnalyzer.vb (2)
61additionalLocations:=ImmutableArray(Of Location).Empty, 85additionalLocations:=ImmutableArray(Of Location).Empty,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (34)
Compilation\CompilationAPITests.vb (7)
1578memberLocations:=ImmutableArray.Create(Location.None)) 1594Sub(loc) Assert.Equal(loc, Location.None)) 1603Dim loc1 = Location.Create(tree, New TextSpan(0, 1)) 1604Dim loc2 = Location.Create(tree, New TextSpan(1, 1)) 1641Sub(loc) Assert.Equal(loc, Location.None)) 1656Sub(loc) Assert.Equal(loc, Location.None)) 1670Sub(loc) Assert.Equal(loc, Location.None))
Diagnostics\DiagnosticAnalyzerTests.vb (11)
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) 361Dim location As Location = Nothing
Diagnostics\GetDiagnosticsTests.vb (1)
656Dim location As Location
SourceGeneration\GeneratorDriverTests.vb (15)
312location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 343location:=Location.Create(validSyntaxTree, TextSpan.FromBounds(2, 4)), 344additionalLocations:={Location.Create(invalidSyntaxTree, TextSpan.FromBounds(2, 4))})) 374location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 404location:=Location.Create(validSyntaxTree, TextSpan.FromBounds(2, 4)), 405additionalLocations:={Location.Create(invalidSyntaxTree, TextSpan.FromBounds(2, 4))})) 434location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 100)))) 464location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)), 465additionalLocations:={Location.Create(syntaxTree, TextSpan.FromBounds(2, 100))})) 495location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 100)))) 524location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)), 525additionalLocations:={Location.Create(syntaxTree, TextSpan.FromBounds(2, 100))})) 554location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 584location:=Location.Create(syntaxTree, TextSpan.FromBounds(2, 4)))) 703Return x.Diagnostic.WithLocation(Location.Create(syntaxTree, TextSpan.FromBounds(start, endpoint)))
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (9)
SymbolsTests\AnonymousTypes\AnonymousTypesSemanticsTests.vb (2)
411Private Sub CheckAnonymousTypeImplicit(local As LocalSymbol, location As Location, anotherType As TypeSymbol, isType As Boolean, ParamArray locations() As Location)
SymbolsTests\Source\SourceSymbolTests.vb (1)
334Dim locs As Location()
SymbolsTests\Source\TypeTests.vb (5)
461Dim span = DirectCast(sym21.Locations(0), Location).GetLineSpan() 497span = DirectCast(sym61.Locations(0), Location).GetLineSpan() 511span = DirectCast(sym71.Locations(0), Location).GetLineSpan() 518span = DirectCast(sym72.Locations(0), Location).GetLineSpan() 525span = DirectCast(sym73.Locations(0), Location).GetLineSpan()
SymbolsTests\SymbolErrorTests.vb (1)
22508Assert.Equal(ImmutableArray.Create(Of Location)(), errTypeSym.Locations)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (10)
MockSymbols.vb (10)
82Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 84Return ImmutableArray.Create(Of Location)() 247Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 249Return ImmutableArray.Create(Of Location)() 570Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 572Return ImmutableArray.Create(Of Location)() 710Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 712Return ImmutableArray.Create(Of Location)() 791Public Overrides ReadOnly Property Locations As ImmutableArray(Of Location) 793Return ImmutableArray.Create(Of Location)()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (13)
Rename\VisualBasicRenameRewriterLanguageService.vb (12)
52Private ReadOnly _renamableDeclarationLocation As Location 689reverseMappedLocations As IDictionary(Of Location, Location), 691) As Task(Of ImmutableArray(Of Location)) 693Dim conflicts = ArrayBuilder(Of Location).GetInstance() 801cancellationToken As CancellationToken) As Task(Of ImmutableArray(Of Location)) 826Return ImmutableArray(Of Location).Empty 902originalDeclarationLocation As Location, 904cancellationToken As CancellationToken) As ImmutableArray(Of Location) 915Return ImmutableArray(Of Location).Empty 921Return ImmutableArray(Of Location).Empty 968Return ImmutableArray(Of Location).Empty
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (1)
1550Public Function GetDeconstructionReferenceLocation(node As SyntaxNode) As Location Implements ISyntaxFacts.GetDeconstructionReferenceLocation
Microsoft.CodeAnalysis.Workspaces (144)
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 (5)
157public Diagnostic ToDiagnostic(Location location, ImmutableArray<Location> additionalLocations) 165private static DiagnosticDataLocation CreateLocation(TextDocument? document, Location location) 262foreach (var location in diagnostic.AdditionalLocations) 305var diagnostic = Diagnostic.Create(descriptor, Location.None, effectiveSeverity, additionalLocations: null, properties: null, messageArgs: messageArguments);
Diagnostics\Extensions.cs (6)
35public static ValueTask<ImmutableArray<Location>> ConvertLocationsAsync(this IReadOnlyCollection<DiagnosticDataLocation> locations, Project project, CancellationToken cancellationToken) 38public static async ValueTask<Location> ConvertLocationAsync( 42return Location.None; 47return Location.None; 63return Location.None; 66return Location.Create(textDocument.FilePath, span, text.Lines.GetLinePositionSpan(span));
Diagnostics\IWorkspaceVenusSpanMappingService.cs (1)
20void GetAdjustedDiagnosticSpan(DocumentId documentId, Location location, out TextSpan span, out FileLinePositionSpan originalLineInfo, out FileLinePositionSpan mappedLineInfo);
Editing\SymbolEditor.cs (2)
323Location location, 349Location location,
FindSymbols\FindReferences\DependentTypeFinder.cs (3)
42private static readonly Func<Location, bool> s_isInMetadata = static loc => loc.IsInMetadata; 43private static readonly Func<Location, bool> s_isInSource = static loc => loc.IsInSource; 375SymbolSet foundTypes, Func<Location, bool> assert, string message)
FindSymbols\FindReferences\Finders\AbstractMemberScopedReferenceFinder.cs (1)
37var location = symbol.Locations.FirstOrDefault();
FindSymbols\FindReferences\Finders\AbstractReferenceFinder.cs (3)
412var location = node.GetFirstToken().GetLocation(); 529var location = node.GetFirstToken().GetLocation(); 564var location = node.GetFirstToken().GetLocation();
FindSymbols\FindReferences\Finders\AbstractReferenceFinder_GlobalSuppressions.cs (3)
232var location = Location.Create(root.SyntaxTree, new TextSpan(positionOfReferenceInTree, length)); 233var containingStringLocation = token.GetLocation();
FindSymbols\FindReferences\Finders\FinderLocation.cs (1)
32location = Location;
FindSymbols\ReferenceLocation.cs (10)
32public Location Location { get; } 60/// Otherwise, <see cref="Location.None"/>. 62internal Location ContainingStringLocation { get; } 69Location location, 74Location containingStringLocation) 89internal ReferenceLocation(Document document, IAliasSymbol? alias, Location location, bool isImplicit, SymbolUsageInfo symbolUsageInfo, ImmutableArray<(string key, string value)> additionalProperties, CandidateReason candidateReason) 90: this(document, alias, location, isImplicit, symbolUsageInfo, additionalProperties, candidateReason, containingStringLocation: Location.None) 98internal ReferenceLocation(Document document, Location location, Location containingStringLocation) 117EqualityComparer<Location>.Default.Equals(this.Location, other.Location) &&
FindSymbols\ReferenceLocationExtensions.cs (3)
16public static async Task<Dictionary<ISymbol, List<Location>>> FindReferencingSymbolsAsync( 22var result = new Dictionary<ISymbol, List<Location>>(); 51Dictionary<ISymbol, List<Location>> result)
FindSymbols\SymbolCallerInfo.cs (2)
28public IEnumerable<Location> Locations { get; } 46IEnumerable<Location> locations,
ReassignedVariable\AbstractReassignedVariableService.cs (1)
247var parameterLocation = parameter.Locations[0];
Rename\ConflictEngine\ConflictResolver.cs (13)
101var renameSymbolDeclarationLocation = renameLocations.Symbol.Locations.Where(loc => loc.IsInSource).FirstOrDefault(); 116Location renameSymbolDeclarationLocation, 180Location originalDeclarationLocation, 189foreach (var implicitUsageConflict in implicitUsageConflicts) 213foreach (var implicitConflict in implicitConflicts) 233IDictionary<Location, Location> reverseMappedLocations, 325private static void AddConflictingSymbolLocations(IEnumerable<ISymbol> conflictingSymbols, MutableConflictResolution conflictResolution, IDictionary<Location, Location> reverseMappedLocations) 329foreach (var newLocation in newSymbol.Locations) 333if (reverseMappedLocations.TryGetValue(newLocation, out var oldLocation)) 368var location = await GetSymbolLocationAsync(solution, symbol, cancellationToken).ConfigureAwait(false); 401private static async Task<Location?> GetSymbolLocationAsync(Solution solution, ISymbol symbol, CancellationToken cancellationToken)
Rename\ConflictEngine\ConflictResolver.Session.cs (4)
36private readonly Location _renameSymbolDeclarationLocation; 52Location renameSymbolDeclarationLocation, 343var reverseMappedLocations = new Dictionary<Location, Location>();
Rename\ConflictEngine\DeclarationConflictHelpers.cs (4)
15public static ImmutableArray<Location> GetMembersWithConflictingSignatures(IMethodSymbol renamedMethod, bool trimOptionalParameters) 26public static ImmutableArray<Location> GetMembersWithConflictingSignatures(IPropertySymbol renamedProperty, bool trimOptionalParameters) 37private static ImmutableArray<Location> GetConflictLocations(ISymbol renamedMember, 52var builder = ArrayBuilder<Location>.GetInstance();
Rename\IRemoteRenamerService.cs (1)
98CodeAnalysis.Location.Create(tree, Location),
Rename\IRenameRewriterLanguageService.cs (13)
52Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync( 59IDictionary<Location, Location> reverseMappedLocations, 70Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync( 85ImmutableArray<Location> ComputePossibleImplicitUsageConflicts( 88Location originalDeclarationLocation, 126public abstract Task<ImmutableArray<Location>> ComputeDeclarationConflictsAsync(string replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable<ISymbol> referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary<Location, Location> reverseMappedLocations, CancellationToken cancellationToken); 127public abstract Task<ImmutableArray<Location>> ComputeImplicitReferenceConflictsAsync(ISymbol renameSymbol, ISymbol renamedSymbol, IEnumerable<ReferenceLocation> implicitReferenceLocations, CancellationToken cancellationToken); 128public abstract ImmutableArray<Location> ComputePossibleImplicitUsageConflicts(ISymbol renamedSymbol, SemanticModel semanticModel, Location originalDeclarationLocation, int newDeclarationLocationStartingPosition, CancellationToken cancellationToken); 135IEnumerable<ISymbol> properties, string newPropertyName, ArrayBuilder<Location> conflicts)
Rename\RenameLocation.cs (3)
12Location location, 20public readonly Location Location = location; 47=> Location.GetHashCode();
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (9)
182var location = originalSymbol.Locations.Single(); 188foreach (var location in referencedSymbol.Locations) 200var firstLocation = referencedSymbol.Locations[0]; 213foreach (var location in method.Locations) 231void AddRenameLocationIfNotGenerated(Location location, bool isRenamableAccessor = false) 272var aliasLocation = location.Alias.Locations.Single(); 291var aliasLocation = location.Alias.Locations.Single(); 296else if (location.ContainingStringLocation != Location.None) 423var matchLocation = tree.GetLocation(matchTextSpan);
Shared\Extensions\IFindReferencesResultExtensions.cs (1)
19public static IEnumerable<Location> GetDefinitionLocationsToShow(
Shared\Extensions\ISolutionExtensions.cs (1)
42internal static TextDocument? GetTextDocumentForLocation(this Solution solution, Location location)
Shared\Extensions\ProjectExtensions.cs (1)
22internal static DocumentId? GetDocumentForExternalLocation(this Project project, Location location)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\AnalysisContextExtensions.cs (2)
54public static bool ShouldAnalyzeLocation(this SymbolStartAnalysisContext context, Location location) 74public static bool ShouldAnalyzeLocation(this SymbolAnalysisContext context, Location location)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (8)
13public static SyntaxTree GetSourceTreeOrThrow(this Location location) 19public static SyntaxToken FindToken(this Location location, CancellationToken cancellationToken) 22public static SyntaxNode FindNode(this Location location, CancellationToken cancellationToken) 25public static SyntaxNode FindNode(this Location location, bool getInnermostNodeForTie, CancellationToken cancellationToken) 28public static SyntaxNode FindNode(this Location location, bool findInsideTrivia, bool getInnermostNodeForTie, CancellationToken cancellationToken) 31public static bool IsVisibleSourceLocation(this Location loc) 42public static bool IntersectsWith(this Location loc1, Location loc2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFacts.cs (1)
478Location GetDeconstructionReferenceLocation(SyntaxNode node);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
76private static ImmutableArray<Location> ReadPropertyLocations(SymbolKeyReader reader, out string? failureReason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.BodyLevelSymbolKey.cs (4)
20public static ImmutableArray<Location> GetBodyLevelSourceLocations(ISymbol symbol, CancellationToken cancellationToken) 25using var _ = ArrayBuilder<Location>.GetInstance(out var result); 27foreach (var location in symbol.Locations) 220bool TryResolveLocation(Location loc, int index, out SymbolKeyResolution resolution, out string? reason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
325private readonly ReadFunction<Location?> _readLocation; 643public Location? ReadLocation(out string? failureReason) 657return Location.None; 679return Location.Create(syntaxTree, new TextSpan(start, length)); 689return Location.None; 715return Location.None; 723public SymbolKeyResolution? ResolveLocation(Location location) 757public PooledArrayBuilder<Location?> ReadLocationArray(out string? failureReason)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
60private readonly Action<Location?> _writeLocation; 247internal void WriteLocation(Location? location) 298internal void WriteLocationArray(ImmutableArray<Location> array)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (3)
27using var _2 = ArrayBuilder<Location>.GetInstance(out var locations); 32locations.Add(element.Locations.FirstOrDefault() ?? Location.None); 128private static ImmutableArray<Location> ReadElementLocations(SymbolKeyReader reader, out string? failureReason)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (1)
482protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Location? location)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (2)
129Location? location, 139Location? location,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationContext.cs (14)
33public Location? ContextLocation { get; } 43public Location? AfterThisLocation { get; } 53public Location? BeforeThisLocation { get; } 134Location? contextLocation = null, 135Location? afterThisLocation = null, 136Location? beforeThisLocation = null, 168private static void CheckLocation(Location? location, string name) 176internal Location? BestLocation 180Optional<Location> contextLocation = default, 181Optional<Location?> afterThisLocation = default, 182Optional<Location?> beforeThisLocation = default, 195var newContextLocation = contextLocation.HasValue ? contextLocation.Value : this.ContextLocation; 196var newAfterThisLocation = afterThisLocation.HasValue ? afterThisLocation.Value : this.AfterThisLocation; 197var newBeforeThisLocation = beforeThisLocation.HasValue ? beforeThisLocation.Value : this.BeforeThisLocation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (1)
192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
140public ImmutableArray<Location> Locations
Workspace\Solution\TextLoader.cs (3)
160Location location; 167location = Location.None; 172location = Location.Create(filePath, textSpan: default, lineSpan: default);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
FindReferencesTests.cs (2)
642void verifier(Location location) 653foreach (var location in reference.Definition.Locations)
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\MembersMustExistAnalyzer.cs (1)
39context.ReportDiagnostic(Diagnostic.Create(s_memberMustExistDiagnostic, Location.None, missingAPI));
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
721private void Diag(DiagnosticDescriptor desc, Location? location, params object?[]? messageArgs)
Microsoft.Extensions.Options.SourceGeneration (12)
Parser.cs (11)
100Location? modelTypeLocation = modelType.GetLocation(); 101Location lowerLocationInCompilation = modelTypeLocation is not null && modelTypeLocation.SourceTree is not null && _compilation.ContainsSyntaxTree(modelTypeLocation.SourceTree) 266private List<ValidatedMember> GetMembersToValidate(ITypeSymbol modelType, bool speculate, Location lowerLocationInCompilation, ITypeSymbol validatorType) 295Location? memberLocation = member.GetLocation(); 296Location location = memberLocation is not null && memberLocation.SourceTree is not null && _compilation.ContainsSyntaxTree(memberLocation.SourceTree) 316private ValidatedMember? GetMemberInfo(ISymbol member, bool speculate, Location location, ITypeSymbol modelType, ITypeSymbol validatorType) 353var attrLoc = attribute.ApplicationSyntaxReference?.GetSyntax().GetLocation(); 598private bool LengthBasedAttributeIsTrackedForSubstitution(ITypeSymbol memberType, Location location, ITypeSymbol attributeType, ref string attributeFullQualifiedName) 684private string? AddSynthesizedValidator(ITypeSymbol modelType, ISymbol member, Location location, ITypeSymbol validatorType) 865private void Diag(DiagnosticDescriptor desc, Location? location) => 868private void Diag(DiagnosticDescriptor desc, Location? location, params object?[]? messageArgs) =>
ParserUtilities.cs (1)
40internal static Location? GetLocation(this ISymbol symbol)
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 (8)
Parsing\Parser.cs (5)
37Action<DiagnosticDescriptor, Location?, object?[]?> diagReport = Diag; // Keeping one instance of the delegate 78var attrLoc = GetLoggerMessageAttribute(method, sm, symbols); 366(LoggingMethod lm, bool keepMethod) ProcessMethod(MethodDeclarationSyntax method, IMethodSymbol methodSymbol, Location attrLoc) 603private Location? GetLoggerMessageAttribute(MethodDeclarationSyntax methodSyntax, SemanticModel sm, SymbolHolder symbols) 744private void Diag(DiagnosticDescriptor desc, Location? location, params object?[]? messageArgs)
Parsing\Parser.TagProvider.cs (1)
79Location? attrLocation)
Parsing\SymbolLoader.cs (1)
54Action<DiagnosticDescriptor, Location?, object?[]?> diagCallback)
src\Generators\Shared\ParserUtilities.cs (1)
45internal static Location? GetLocation(this ISymbol symbol)
Microsoft.Gen.Logging.Unit.Tests (11)
ParserUtilitiesTests.cs (6)
92.Returns(default(ImmutableArray<Location>)); 97.Returns(ImmutableArray<Location>.Empty); 106var locationMock = Mock.Of<Location>(); 108.Returns(new[] { locationMock, Mock.Of<Location>() }.ToImmutableArray()); 110var result = ParserUtilities.GetLocation(symbolMock.Object);
SymbolLoaderTests.cs (2)
46var callbackMock = new Mock<Action<DiagnosticDescriptor, Location?, object?[]?>>(); 52x => x(It.IsAny<DiagnosticDescriptor>(), It.IsAny<Location?>(), It.Is<object?[]?>(p => p != null && p.Length > 0)),
test\Generators\Shared\RoslynTestUtils.cs (3)
156TextSpan? expectedSpan = Location.None.SourceSpan; 157if (d.Location != Location.None) 172if (expectedSpan != Location.None.SourceSpan)
Microsoft.Gen.Metrics (3)
Parser.cs (2)
596private void Diag(DiagnosticDescriptor desc, Location? location) 601private void Diag(DiagnosticDescriptor desc, Location? location, params object?[]? messageArgs)
src\Generators\Shared\ParserUtilities.cs (1)
45internal static Location? GetLocation(this ISymbol symbol)
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 (3)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
596private void Diag(DiagnosticDescriptor desc, Location? location) 601private void Diag(DiagnosticDescriptor desc, Location? location, params object?[]? messageArgs)
src\Generators\Shared\ParserUtilities.cs (1)
45internal static Location? GetLocation(this ISymbol symbol)
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 (14)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (8)
53var methodsOfInterest = new Dictionary<ISymbol, ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>>>(SymbolEqualityComparer.Default); 108if (methodsOfInterest.TryGetValue(operation.TargetMethod.OriginalDefinition, out ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>> discoverers)) 110foreach (Func<IInvocationOperation, (ITypeSymbol, Location)?> discoverer in discoverers) 113if (typeInfo is (ITypeSymbol targetType, Location diagnosticLocation)) 200static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch 206static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeArgumentTypeLookup(int ordinal) => invocation => 213Location? location = null; 235static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeOfArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch
ComInterfaceInfo.cs (3)
30public Location DiagnosticLocation { get; init; } 42Location diagnosticLocation) 166Location.None)
ComMethodInfo.cs (3)
105Location interfaceLocation = ifaceContext.Declaration.GetLocation(); 106Location? methodLocationInAttributedInterfaceDeclaration = null; 107foreach (var methodLocation in method.Locations)
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
181private static ITypeSymbol GetManagedTypeInAttributeSyntax(Location locationInAttribute, INamedTypeSymbol attributedTypeSymbol)
Analyzers\DiagnosticReporter.cs (1)
19public static DiagnosticReporter CreateForLocation(Location location, Action<Diagnostic> reportDiagnostic) => new((descriptor, properties, args) => reportDiagnostic(location.CreateDiagnosticInfo(descriptor, properties, args).ToDiagnostic()));
Microsoft.Interop.SourceGeneration (50)
DiagnosticExtensions.cs (28)
35Location location = syntaxReference is not null 37: Location.None; 49Location location = syntaxReference is not null 51: Location.None; 57this ImmutableArray<Location> locations, 65this ImmutableArray<Location> locations, 70Location firstLocation = null; 71List<Location> additionalLocations = null; 72foreach (Location location in locations) 88Diagnostic.Create(descriptor, Location.None, properties: properties, args) : 93this Location location, 99location: location.IsInSource ? location : Location.None, 104this Location location, 111location: location.IsInSource ? location : Location.None, 139Location location = syntaxReference is not null 141: Location.None; 153Location location = syntaxReference is not null 155: Location.None; 161this ImmutableArray<Location> locations, 169this ImmutableArray<Location> locations, 174Location firstLocation = null; 175List<Location> additionalLocations = null; 176foreach (Location location in locations) 192DiagnosticInfo.Create(descriptor, Location.None, properties: properties, args) : 197this Location location, 203location: location.IsInSource ? location : Location.None, 208this Location location, 215location: location.IsInSource ? location : Location.None,
DiagnosticInfo.cs (5)
26public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, params object?[] messageArgs) 38public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, ImmutableDictionary<string, string>? properties, params object?[] messageArgs) 50public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location location, IEnumerable<Location>? additionalLocations, ImmutableDictionary<string, string>? properties, params object?[] messageArgs) 56AdditionalLocations = (additionalLocations ?? ImmutableArray<Location>.Empty).ToSequenceEqualImmutableArray(),
Marshalling\GeneratorDiagnostic.cs (5)
26public abstract DiagnosticInfo ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName); 35public override DiagnosticInfo ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName) 45public sealed record UnnecessaryData(TypePositionInfo TypePositionInfo, ImmutableArray<Location> UnnecessaryDataLocations) : GeneratorDiagnostic(TypePositionInfo, isFatal: false) 50public override DiagnosticInfo ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName) 68public override DiagnosticInfo ToDiagnosticInfo(DiagnosticDescriptor descriptor, Location location, string elementName)
Marshalling\MarshallerHelpers.cs (2)
389Location location = TypePositionInfo.GetLocation(info, symbol); 399Location location = TypePositionInfo.GetLocation(info, symbol);
MethodSignatureDiagnosticLocations.cs (2)
45public sealed record MethodSignatureDiagnosticLocations(string MethodIdentifier, ImmutableArray<Location> ManagedParameterLocations, Location FallbackLocation) : ISignatureDiagnosticLocations
TypePositionInfo.cs (8)
73public (Location? InLocation, Location? OutLocation) ByValueMarshalAttributeLocations { get; init; } 105public static Location GetLocation(TypePositionInfo info, IMethodSymbol methodSymbol) 108return Location.None; 116private static (ByValueContentsMarshalKind, Location? inAttribute, Location? outAttribute) GetByValueContentsMarshalKind(IEnumerable<AttributeData> attributes, Compilation compilation) 122Location? inAttributeLocation = null; 123Location? outAttributeLocation = null;
Microsoft.VisualStudio.LanguageServices (15)
CallHierarchy\CallHierarchyCommandHandler.cs (1)
100var node = await _provider.CreateItemAsync(mapping.Symbol, mapping.Project, ImmutableArray<Location>.Empty, cancellationToken).ConfigureAwait(false);
CallHierarchy\CallHierarchyDetail.cs (2)
26Location location, 41private static string ComputeText(Location location)
CallHierarchy\CallHierarchyItem.cs (1)
37ImmutableArray<Location> callsites,
CallHierarchy\CallHierarchyProvider.cs (1)
56ISymbol symbol, Project project, ImmutableArray<Location> callsites, CancellationToken cancellationToken)
CallHierarchy\Finders\ImplementerFinder.cs (1)
48var item = await Provider.CreateItemAsync(implementation, bestLocation.Project, ImmutableArray<Location>.Empty, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\OverridingMemberFinder.cs (1)
44var item = await Provider.CreateItemAsync(@override, bestLocation.Project, ImmutableArray<Location>.Empty, cancellationToken).ConfigureAwait(false);
Diagnostics\VisualStudioVenusSpanMappingService.cs (3)
30DocumentId documentId, Location location, 38if (location == Location.None) 70private TextLineCollection GetTextLines(DocumentId currentDocumentId, Location location)
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (1)
160private static string GetFile(Location loc) => loc.SourceTree!.FilePath;
Progression\GraphBuilder.cs (1)
200var preferredLocation = symbol.Locations.FirstOrDefault(l => l.SourceTree != null);
Progression\GraphQueries\IsUsedByGraphQuery.cs (2)
37foreach (var location in allLocations) 50private static GraphNode? GetLocationNode(Location location, IGraphContext context, ProjectId projectId, CancellationToken cancellationToken)
Venus\ContainedLanguageCodeSupport.cs (1)
491var typeLocation = type.Locations.FirstOrDefault(d => d.SourceTree == containingTree);
System.Text.Json.SourceGeneration (15)
Helpers\RoslynExtensions.cs (3)
28public static Location? GetLocation(this ISymbol typeSymbol) 31public static Location? GetLocation(this AttributeData attributeData) 40public static bool ContainsLocation(this Compilation compilation, Location location)
JsonSourceGenerator.Parser.cs (6)
51private Location? _contextClassLocation; 53public void ReportDiagnostic(DiagnosticDescriptor descriptor, Location? location, params object?[]? messageArgs) 479Location? location = typeSymbol.GetLocation(); 480Location? attributeLocation = attributeData.GetLocation(); 917Location? typeLocation = typeToGenerate.Location; 1115Location? typeLocation,
src\libraries\Common\src\SourceGenerators\DiagnosticInfo.cs (6)
19public Location? Location { get; private init; } 21public static DiagnosticInfo Create(DiagnosticDescriptor descriptor, Location? location, object?[]? messageArgs) 23Location? trimmedLocation = location is null ? null : GetTrimmedLocation(location); 33static Location GetTrimmedLocation(Location location) 34=> Location.Create(location.SourceTree?.FilePath ?? "", location.SourceSpan, location.GetLineSpan().Span);
System.Text.RegularExpressions.Generator (6)
RegexGenerator.cs (1)
355private sealed record class DiagnosticData(DiagnosticDescriptor descriptor, Location location, object? arg = null)
RegexGenerator.Parser.cs (5)
252static Location GetComparableLocation(SyntaxNode syntax) 254var location = syntax.GetLocation(); 255return Location.Create(location.SourceTree?.FilePath ?? string.Empty, location.SourceSpan, location.GetLineSpan().Span); 260internal sealed record RegexPatternAndSyntax(RegexType DeclaringType, bool IsProperty, Location DiagnosticLocation, string MemberName, string Modifiers, bool NullableRegex, string Pattern, RegexOptions Options, int? MatchTimeout, CultureInfo Culture, CompilationData CompilationData); 263internal sealed record RegexMethod(RegexType DeclaringType, bool IsProperty, Location DiagnosticLocation, string MemberName, string Modifiers, bool NullableRegex, string Pattern, RegexOptions Options, int? MatchTimeout, RegexTree Tree, AnalysisResults Analysis, CompilationData CompilationData)
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,