12 references to TryGetContainingDeclaration
Roslyn.Diagnostics.Analyzers (12)
AbstractApplyTraitToClass`1.cs (3)
42if (syntaxGenerator.TryGetContainingDeclaration(attribute, DeclarationKind.Method) is null) 75if (syntaxGenerator.TryGetContainingDeclaration(state.AttributeSyntax, DeclarationKind.Attribute) is not { } attribute) 80if (syntaxGenerator.TryGetContainingDeclaration(attribute, DeclarationKind.Method) is not { } method)
ExportedPartsShouldHaveImportingConstructorCodeFixProvider.cs (3)
104var declaration = generator.TryGetContainingDeclaration(exportAttribute, DeclarationKind.Class); 147var declaration = generator.TryGetContainingDeclaration(importingConstructorAttribute, DeclarationKind.Constructor); 166var declaration = generator.TryGetContainingDeclaration(constructor, DeclarationKind.Constructor);
ImportingConstructorShouldBeObsoleteCodeFixProvider.cs (5)
101var declaration = generator.TryGetContainingDeclaration(constructor, DeclarationKind.Constructor); 128var declaration = generator.TryGetContainingDeclaration(obsoleteAttributeApplication, DeclarationKind.Attribute); 149var declaration = generator.TryGetContainingDeclaration(obsoleteAttributeApplication, DeclarationKind.Attribute); 173var declaration = generator.TryGetContainingDeclaration(obsoleteAttributeApplication, DeclarationKind.Attribute); 192var declaration = generator.TryGetContainingDeclaration(obsoleteAttributeApplication, DeclarationKind.Attribute);
TestExportsShouldNotBeDiscoverableCodeFixProvider.cs (1)
58var declaration = generator.TryGetContainingDeclaration(exportingAttribute, DeclarationKind.Class);