40 references to TargetScope
Microsoft.CodeAnalysis (31)
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (23)
21private static readonly SmallDictionary<string, TargetScope> s_suppressMessageScopeTypes = new SmallDictionary<string, TargetScope>(StringComparer.OrdinalIgnoreCase) 23{ string.Empty, TargetScope.None }, 24{ "module", TargetScope.Module }, 25{ "namespace", TargetScope.Namespace }, 26{ "resource", TargetScope.Resource }, 27{ "type", TargetScope.Type }, 28{ "member", TargetScope.Member }, 29{ "namespaceanddescendants", TargetScope.NamespaceAndDescendants } 90case TargetScope.Namespace: 95case TargetScope.NamespaceAndDescendants: 358if (info.Scope == TargetScope.Invalid) 364if (info is { Scope: TargetScope.Module or TargetScope.None, Target: null }) 381internal static ImmutableArray<ISymbol> ResolveTargetSymbols(Compilation compilation, string target, TargetScope scope) 385case TargetScope.Namespace: 386case TargetScope.Type: 387case TargetScope.Member: 390case TargetScope.NamespaceAndDescendants: 391return ResolveTargetSymbols(compilation, target, TargetScope.Namespace); 426if (!tryGetTargetScope(scopeString, out var scope)) 428scope = TargetScope.Invalid; 438static bool tryGetTargetScope(string? scopeString, out TargetScope scope)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
38private readonly TargetScope _scope; 42public TargetSymbolResolver(Compilation compilation, TargetScope scope, string fullyQualifiedName) 129if (_scope != TargetScope.Namespace && PeekNextChar() == '`') 181if (_scope == TargetScope.Member && !isIndexerProperty && parameters != null) 202case TargetScope.Namespace: 206case TargetScope.Type: 210case TargetScope.Member:
DiagnosticAnalyzer\SuppressMessageInfo.cs (1)
12public SuppressMessageAttributeState.TargetScope Scope;
Microsoft.CodeAnalysis.UnitTests (9)
Diagnostics\SuppressMessageTargetSymbolResolverTests.cs (9)
384_ = SuppressMessageAttributeState.ResolveTargetSymbols(compilation, "E.", SuppressMessageAttributeState.TargetScope.Member); 1277VerifyResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Namespace, language, rootNamespaceName); 1288VerifyNoResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Namespace, language, rootNamespaceName); 1299VerifyResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Type, language, rootNamespaceName); 1310VerifyNoResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Type, language, rootNamespaceName); 1321VerifyResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Member, language, rootNamespaceName); 1332VerifyNoResolution(markup, fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope.Member, language, rootNamespaceName); 1335private static void VerifyResolution(string markup, string[] fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope scope, string language, string rootNamespace) 1411private static void VerifyNoResolution(string source, string[] fxCopFullyQualifiedNames, SuppressMessageAttributeState.TargetScope scope, string language, string rootNamespace)