Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix analyzer [RCS1046](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1046) to report `async void` methods without `Async` suffix ([PR](https://github.com/dotnet/roslynator/pull/1790))
- Fix analyzer [RCS1265](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1265) to not report catch clauses with a `when` filter ([PR](https://github.com/dotnet/roslynator/pull/1789))
- Fix analyzer [RCS0034](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS0034) for types with a primary constructor and multiple constraint clauses ([PR](https://github.com/dotnet/roslynator/pull/1791))
- [CLI] Fix GitLab output format to use relative paths, forward slashes, and 1-based line numbers ([PR](https://github.com/dotnet/roslynator/pull/1792))
- Fix analyzer [RCS1231](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1231) to not report `CancellationToken` in sync methods returning `Task` ([PR](https://github.com/dotnet/roslynator/pull/1802))
- [CLI] Fix GitLab output format to use relative paths, forward slashes, and 1-based line numbers ([PR](https://github.com/dotnet/roslynator/pull/1792))
- [CLI] Fix `generate-doc` to omit internal interfaces from type declarations and the Implements section ([PR](https://github.com/dotnet/roslynator/pull/1801))

## [4.16.0] - 2026-08-08

Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/Documentation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ Roslynator.Documentation.DocumentationGenerator</Description>
</AssemblyAttribute>
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Documentation/DocumentationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ void GenerateMemberContent(DocumentationWriter writer, ISymbol symbol, int headi
}
case MemberDocumentationParts.Implements:
{
writer.WriteImplementedInterfaceMembers(symbol.FindImplementedInterfaceMembers());
writer.WriteImplementedInterfaceMembers(symbol.FindImplementedInterfaceMembers().Where(f => f.IsPubliclyVisible()));
break;
}
case MemberDocumentationParts.Attributes:
Expand Down
5 changes: 3 additions & 2 deletions src/Documentation/DocumentationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ public virtual void WriteDefinition(ISymbol symbol)
| SymbolDisplayTypeDeclarationOptions.IncludeModifiers
| SymbolDisplayTypeDeclarationOptions.BaseList,
additionalOptions: additionalOptions,
shouldDisplayAttribute: (s, a) => DocumentationModel.Filter.IsMatch(s, a));
shouldDisplayAttribute: (s, a) => DocumentationModel.Filter.IsMatch(s, a),
shouldDisplayInterface: f => f.IsPubliclyVisible());

StringBuilder sb = StringBuilderCache.GetInstance(attributesParts.Length + definitionParts.Length);

Expand Down Expand Up @@ -1491,7 +1492,7 @@ void WriteOverrides(ISymbol symbol)

void WriteImplements(ISymbol symbol)
{
using (IEnumerator<ISymbol> en = symbol.FindImplementedInterfaceMembers().GetEnumerator())
using (IEnumerator<ISymbol> en = symbol.FindImplementedInterfaceMembers().Where(f => f.IsPubliclyVisible()).GetEnumerator())
{
if (en.MoveNext())
{
Expand Down
6 changes: 5 additions & 1 deletion src/Documentation/SymbolDefinitionDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public static ImmutableArray<SymbolDisplayPart> GetDisplayParts(
SymbolDisplayFormat format,
SymbolDisplayTypeDeclarationOptions typeDeclarationOptions = SymbolDisplayTypeDeclarationOptions.None,
SymbolDisplayAdditionalOptions additionalOptions = SymbolDisplayAdditionalOptions.None,
Func<ISymbol, AttributeData, bool> shouldDisplayAttribute = null)
Func<ISymbol, AttributeData, bool> shouldDisplayAttribute = null,
Func<INamedTypeSymbol, bool> shouldDisplayInterface = null)
{
ImmutableArray<SymbolDisplayPart> parts;

Expand Down Expand Up @@ -62,6 +63,9 @@ public static ImmutableArray<SymbolDisplayPart> GetDisplayParts(
{
interfaces = interfaces.RemoveAll(f => f.SpecialType == SpecialType.System_Collections_IEnumerable);
}

if (shouldDisplayInterface is not null)
interfaces = interfaces.RemoveAll(f => !shouldDisplayInterface(f));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Documentation/SymbolDefinitionWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,8 @@ public virtual void WriteDefinition(ISymbol symbol, SymbolDisplayFormat format)
format ?? DefinitionFormat,
typeDeclarationOptions: GetTypeDeclarationOptions(),
additionalOptions: GetAdditionalOptions(),
shouldDisplayAttribute: (s, a) => Filter.IsMatch(s, a));
shouldDisplayAttribute: (s, a) => Filter.IsMatch(s, a),
shouldDisplayInterface: f => Filter.IsMatch(f));

WriteDefinition(symbol, parts);
}
Expand Down
10 changes: 8 additions & 2 deletions src/Documentation/TypeDocumentationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,20 @@ public IEnumerable<INamedTypeSymbol> GetImplementedInterfaces(bool omitIEnumerab
{
foreach (INamedTypeSymbol interfaceType in allInterfaces)
{
if (interfaceType.SpecialType != SpecialType.System_Collections_IEnumerable)
if (interfaceType.IsPubliclyVisible()
&& interfaceType.SpecialType != SpecialType.System_Collections_IEnumerable)
{
yield return interfaceType;
}
}
}
else
{
foreach (INamedTypeSymbol interfaceType in allInterfaces)
yield return interfaceType;
{
if (interfaceType.IsPubliclyVisible())
yield return interfaceType;
}
}
}
}
Expand Down
Loading