Skip to content

Commit

Permalink
fixed NullReferenceException for generic type
Browse files Browse the repository at this point in the history
fixed internal interfaces shown in implementation
release 0.5.5
  • Loading branch information
Doraku committed Feb 23, 2020
1 parent b0fee8c commit 1329231
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
</PropertyGroup>

<PropertyGroup Label="Package">
<Version>0.5.4</Version>
<Version>0.5.5</Version>
<PackageReleaseNotes>
fixed TypeDocItem writing members of nested types
fixed nested type not showing parent type in name
fixed NullReferenceException for generic type
fixed internal interfaces shown in implementation
</PackageReleaseNotes>
</PropertyGroup>
</Project>
3 changes: 2 additions & 1 deletion source/DefaultDocumentation/DocumentationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public string GetTypeLink(DocItem item, IType type)
{
string HandleParameterizedType(ParameterizedType genericType)
{
if (_items.TryGetValue(genericType.GetDefinition().GetIdString(), out DocItem docItem) && docItem is TypeDocItem typeDocItem)
ITypeDefinition typeDefinition = genericType.GetDefinition();
if (typeDefinition != null && _items.TryGetValue(typeDefinition.GetIdString(), out DocItem docItem) && docItem is TypeDocItem typeDocItem)
{
return GetLink(docItem, typeDocItem.Type.FullName + "&lt;")
+ string.Join(GetLink(docItem, ","), genericType.TypeArguments.Select(t => GetTypeLink(item, t)))
Expand Down
2 changes: 1 addition & 1 deletion source/DefaultDocumentation/Model/TypeDocItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public override void WriteDocumentation(DocumentationWriter writer)

writer.Write(this, Documentation.GetSummary());

List<IType> interfaces = Type.DirectBaseTypes.Where(t => t.Kind == TypeKind.Interface).ToList();
List<IType> interfaces = Type.DirectBaseTypes.Where(t => t.Kind == TypeKind.Interface && t.GetDefinition().Accessibility == Accessibility.Public).ToList();

writer.WriteLine("```csharp");
writer.Write(CodeAmbience.ConvertSymbol(Type));
Expand Down
2 changes: 1 addition & 1 deletion source/DefaultDocumentation/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"DefaultDocumentation": {
"commandName": "Project",
"commandLineArgs": "/assembly:\"D:\\Projects\\DefaultEcs\\source\\DefaultEcs\\bin\\Release\\netstandard2.0\\DefaultEcs.dll\" /xml:\"D:\\Projects\\DefaultEcs\\source\\DefaultEcs\\bin\\Release\\netstandard2.0\\DefaultEcs.xml\" /output:\"D:\\Projects\\DefaultEcs\\documentation\\api\""
"commandLineArgs": "/assembly:\"D:\\Projects\\DefaultEcs\\source\\DefaultEcs\\bin\\Release\\netstandard2.1\\DefaultEcs.dll\" /xml:\"D:\\Projects\\DefaultEcs\\source\\DefaultEcs\\obj\\Release\\netstandard2.1\\DefaultEcs.xml\" /output:\"D:\\Projects\\DefaultEcs\\documentation\\api\" /home:\"\" /baselink:\"\" /linksfile:\"\""
}
}
}

0 comments on commit 1329231

Please sign in to comment.