diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/DocumentationRules/SA1600CSharp7UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/DocumentationRules/SA1600CSharp7UnitTests.cs index 3d7c8a6bc..13de48cd6 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/DocumentationRules/SA1600CSharp7UnitTests.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp7/DocumentationRules/SA1600CSharp7UnitTests.cs @@ -3,9 +3,214 @@ namespace StyleCop.Analyzers.Test.CSharp7.DocumentationRules { + using System.Threading.Tasks; + using Microsoft.CodeAnalysis; + using Microsoft.CodeAnalysis.CSharp; using StyleCop.Analyzers.Test.DocumentationRules; + using Xunit; public class SA1600CSharp7UnitTests : SA1600UnitTests { + private string currentTestSettings; + + [Fact] + public async Task TestPrivateProtectedDelegateWithoutDocumentationAsync() + { + await this.TestNestedDelegateDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedDelegateWithDocumentationAsync() + { + await this.TestNestedDelegateDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedMethodWithoutDocumentationAsync() + { + await this.TestMethodDeclarationDocumentationAsync("private protected", false, true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedMethodWithDocumentationAsync() + { + await this.TestMethodDeclarationDocumentationAsync("private protected", false, false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedConstructorWithoutDocumentationAsync() + { + await this.TestConstructorDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedConstructorWithDocumentationAsync() + { + await this.TestConstructorDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedFieldWithoutDocumentationAsync() + { + await this.TestFieldDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + + // Re-test with the 'documentPrivateElements' setting enabled (doesn't impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentPrivateElements"": true + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + + // Re-test with the 'documentInternalElements' setting disabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentInternalElements"": false + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", false, false).ConfigureAwait(false); + + // Re-test with the 'documentPrivateFields' setting enabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentPrivateFields"": true + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedFieldWithDocumentationAsync() + { + await this.TestFieldDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + + // Re-test with the 'documentPrivateElements' setting enabled (doesn't impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentPrivateElements"": true + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + + // Re-test with the 'documentInternalElements' setting disabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentInternalElements"": false + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + + // Re-test with the 'documentPrivateFields' setting enabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentPrivateFields"": true + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedPropertyWithoutDocumentationAsync() + { + await this.TestPropertyDeclarationDocumentationAsync("private protected", false, true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedPropertyWithDocumentationAsync() + { + await this.TestPropertyDeclarationDocumentationAsync("private protected", false, false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedIndexerWithoutDocumentationAsync() + { + await this.TestIndexerDeclarationDocumentationAsync("private protected", false, true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedIndexerWithDocumentationAsync() + { + await this.TestIndexerDeclarationDocumentationAsync("private protected", false, false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedEventWithoutDocumentationAsync() + { + await this.TestEventDeclarationDocumentationAsync("private protected", false, true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedEventWithDocumentationAsync() + { + await this.TestEventDeclarationDocumentationAsync("private protected", false, false, true).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedEventFieldWithoutDocumentationAsync() + { + await this.TestEventFieldDeclarationDocumentationAsync("private protected", true, false).ConfigureAwait(false); + } + + [Fact] + public async Task TestPrivateProtectedEventFieldWithDocumentationAsync() + { + await this.TestEventFieldDeclarationDocumentationAsync("private protected", false, true).ConfigureAwait(false); + } + + protected override string GetSettings() + { + return this.currentTestSettings ?? base.GetSettings(); + } + + protected override Project CreateProjectImpl(string[] sources, string language, string[] filenames) + { + var project = base.CreateProjectImpl(sources, language, filenames); + var parseOptions = (CSharpParseOptions)project.ParseOptions; + return project.WithParseOptions(parseOptions.WithLanguageVersion(LanguageVersion.CSharp7_2)); + } + + protected override async Task TestTypeWithoutDocumentationAsync(string type, bool isInterface) + { + await base.TestTypeWithoutDocumentationAsync(type, isInterface).ConfigureAwait(false); + + await this.TestNestedTypeDeclarationDocumentationAsync(type, "private protected", true, false).ConfigureAwait(false); + } + + protected override async Task TestTypeWithDocumentationAsync(string type) + { + await base.TestTypeWithDocumentationAsync(type).ConfigureAwait(false); + + await this.TestNestedTypeDeclarationDocumentationAsync(type, "private protected", false, true).ConfigureAwait(false); + } } } diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs index fc1b6e156..ad5fb3922 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs @@ -210,6 +210,24 @@ public async Task TestFieldWithoutDocumentationAsync() await this.TestFieldDeclarationDocumentationAsync("protected internal", true, false).ConfigureAwait(false); await this.TestFieldDeclarationDocumentationAsync("public", true, false).ConfigureAwait(false); + // Re-test with the 'documentInternalElements' setting disabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentInternalElements"": false + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync(string.Empty, false, false).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("private", false, false).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("protected", true, false).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("internal", false, false).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("protected internal", true, false).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("public", true, false).ConfigureAwait(false); + // Re-test with the 'documentPrivateFields' setting enabled (does impact fields) this.currentTestSettings = @" { @@ -257,6 +275,24 @@ public async Task TestFieldWithDocumentationAsync() await this.TestFieldDeclarationDocumentationAsync("protected internal", false, true).ConfigureAwait(false); await this.TestFieldDeclarationDocumentationAsync("public", false, true).ConfigureAwait(false); + // Re-test with the 'documentInternalElements' setting disabled (does impact fields) + this.currentTestSettings = @" +{ + ""settings"": { + ""documentationRules"": { + ""documentInternalElements"": false + } + } +} +"; + + await this.TestFieldDeclarationDocumentationAsync(string.Empty, false, true).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("private", false, true).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("protected", false, true).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("internal", false, true).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("protected internal", false, true).ConfigureAwait(false); + await this.TestFieldDeclarationDocumentationAsync("public", false, true).ConfigureAwait(false); + // Re-test with the 'documentPrivateFields' setting enabled (does impact fields) this.currentTestSettings = @" { @@ -819,7 +855,7 @@ protected override CodeFixProvider GetCSharpCodeFixProvider() return new SA1600CodeFixProvider(); } - private async Task TestTypeDeclarationDocumentationAsync(string type, string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestTypeDeclarationDocumentationAsync(string type, string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" {0} {1} @@ -840,7 +876,7 @@ private async Task TestTypeDeclarationDocumentationAsync(string type, string mod await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, type), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestNestedTypeDeclarationDocumentationAsync(string type, string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestNestedTypeDeclarationDocumentationAsync(string type, string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -873,7 +909,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, type), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestDelegateDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestDelegateDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" {0} delegate void @@ -890,7 +926,7 @@ private async Task TestDelegateDeclarationDocumentationAsync(string modifiers, b await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestNestedDelegateDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestNestedDelegateDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -919,7 +955,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestMethodDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceMethod, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestMethodDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceMethod, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -961,7 +997,7 @@ public interface IInterface {{ void MemberName(); }} await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, explicitInterfaceText), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestInterfaceMethodDeclarationDocumentationAsync(bool hasDocumentation) + protected async Task TestInterfaceMethodDeclarationDocumentationAsync(bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -990,7 +1026,7 @@ public interface InterfaceName await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestInterfacePropertyDeclarationDocumentationAsync(bool hasDocumentation) + protected async Task TestInterfacePropertyDeclarationDocumentationAsync(bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1025,7 +1061,7 @@ string MemberName await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestInterfaceEventDeclarationDocumentationAsync(bool hasDocumentation) + protected async Task TestInterfaceEventDeclarationDocumentationAsync(bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1054,7 +1090,7 @@ public interface InterfaceName await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestInterfaceIndexerDeclarationDocumentationAsync(bool hasDocumentation) + protected async Task TestInterfaceIndexerDeclarationDocumentationAsync(bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1083,7 +1119,7 @@ public interface InterfaceName await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestConstructorDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestConstructorDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1116,7 +1152,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestDestructorDeclarationDocumentationAsync(bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestDestructorDeclarationDocumentationAsync(bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1147,7 +1183,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestPropertyDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceProperty, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestPropertyDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceProperty, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1187,7 +1223,7 @@ public interface IInterface {{ string MemberName {{ get; set; }} }} await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, explicitInterfaceText), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestIndexerDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceIndexer, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestIndexerDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceIndexer, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1227,7 +1263,7 @@ public interface IInterface {{ string this[string key] {{ get; set; }} }} await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, explicitInterfaceText), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestEventDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceEvent, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestEventDeclarationDocumentationAsync(string modifiers, bool isExplicitInterfaceEvent, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1289,7 +1325,7 @@ public interface IInterface {{ event System.Action MyEvent; }} await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, explicitInterfaceText), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestFieldDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestFieldDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1318,7 +1354,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestEventFieldDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) + protected async Task TestEventFieldDeclarationDocumentationAsync(string modifiers, bool requiresDiagnostic, bool hasDocumentation) { var testCodeWithoutDocumentation = @" /// /// A summary @@ -1347,7 +1383,7 @@ public class OuterClass await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false); } - private async Task TestTypeWithoutDocumentationAsync(string type, bool isInterface) + protected virtual async Task TestTypeWithoutDocumentationAsync(string type, bool isInterface) { await this.TestTypeDeclarationDocumentationAsync(type, string.Empty, true, false).ConfigureAwait(false); await this.TestTypeDeclarationDocumentationAsync(type, "internal", true, false).ConfigureAwait(false); @@ -1361,7 +1397,7 @@ private async Task TestTypeWithoutDocumentationAsync(string type, bool isInterfa await this.TestNestedTypeDeclarationDocumentationAsync(type, "public", true, false).ConfigureAwait(false); } - private async Task TestTypeWithDocumentationAsync(string type) + protected virtual async Task TestTypeWithDocumentationAsync(string type) { await this.TestTypeDeclarationDocumentationAsync(type, string.Empty, false, true).ConfigureAwait(false); await this.TestTypeDeclarationDocumentationAsync(type, "internal", false, true).ConfigureAwait(false); diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevel.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevel.cs index 940671ec4..da0fe193e 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevel.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevel.cs @@ -14,6 +14,9 @@ internal enum AccessLevel /// Private access. Private, + /// Private protected access. + PrivateProtected, + /// Protected access. Protected, diff --git a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevelHelper.cs b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevelHelper.cs index b6c927695..1737cc53a 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevelHelper.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers/Helpers/AccessLevelHelper.cs @@ -22,6 +22,7 @@ internal static class AccessLevelHelper [AccessLevel.Internal] = "internal", [AccessLevel.ProtectedInternal] = "protected internal", [AccessLevel.Protected] = "protected", + [AccessLevel.PrivateProtected] = "private protected", [AccessLevel.Private] = "private", }; @@ -30,6 +31,7 @@ internal static class AccessLevelHelper /// A value representing the access level. internal static AccessLevel GetAccessLevel(SyntaxTokenList modifiers) { + bool isPrivate = false; bool isProtected = false; bool isInternal = false; foreach (var modifier in modifiers) @@ -39,7 +41,16 @@ internal static AccessLevel GetAccessLevel(SyntaxTokenList modifiers) case SyntaxKind.PublicKeyword: return AccessLevel.Public; case SyntaxKind.PrivateKeyword: - return AccessLevel.Private; + if (isProtected) + { + return AccessLevel.PrivateProtected; + } + else + { + isPrivate = true; + } + + break; case SyntaxKind.InternalKeyword: if (isProtected) { @@ -56,6 +67,10 @@ internal static AccessLevel GetAccessLevel(SyntaxTokenList modifiers) { return AccessLevel.ProtectedInternal; } + else if (isPrivate) + { + return AccessLevel.PrivateProtected; + } else { isProtected = true; @@ -65,7 +80,11 @@ internal static AccessLevel GetAccessLevel(SyntaxTokenList modifiers) } } - if (isProtected) + if (isPrivate) + { + return AccessLevel.Private; + } + else if (isProtected) { return AccessLevel.Protected; } @@ -112,6 +131,9 @@ internal static Accessibility ToAccessibility(this AccessLevel accessLevel) case AccessLevel.Protected: return Accessibility.Protected; + case AccessLevel.PrivateProtected: + return Accessibility.ProtectedAndInternal; + case AccessLevel.Private: return Accessibility.Private;