Skip to content

Commit

Permalink
fixed operator file name generation for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed Jul 4, 2020
1 parent c961f9d commit 894d239
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<PropertyGroup Label="Package">
<Version>0.6.9</Version>
<Version>0.6.10</Version>
<PackageReleaseNotes>
added Name FileNameMode (experimental, may generate name collission if multiple types have the same name in different namespaces)
</PackageReleaseNotes>
Expand Down
22 changes: 11 additions & 11 deletions source/DefaultDocumentation/Model/DocItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ private static string GetName(IEntity entity, CSharpAmbience ambience)

if (entity.SymbolKind == SymbolKind.Operator)
{
int index = fullName.IndexOf(".operator ") + 1;
if (index <= 0)
int offset = 17;
int index = fullName.IndexOf("implicit operator ");
if (index < 0)
{
index = fullName.IndexOf(".implicit operator ") + 1;
int offset = 17;
if (index <= 0)
index = fullName.IndexOf("explicit operator ");

if (index < 0)
{
index = fullName.IndexOf(".explicit operator ") + 1;
offset = 17;
index = fullName.IndexOf("operator ");
offset = fullName.IndexOf('(') - index;
}

fullName = fullName.Substring(0, index) + entity.Name + fullName.Substring(index + offset);
}
else

if (index >= 0)
{
fullName = fullName.Substring(0, index) + entity.Name + fullName.Substring(fullName.IndexOf('('));
fullName = fullName.Substring(0, index) + entity.Name + fullName.Substring(index + offset);
}
}

Expand Down

0 comments on commit 894d239

Please sign in to comment.