Skip to content
Open
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
26 changes: 26 additions & 0 deletions ICSharpCode.Decompiler/Output/TextTokenWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,35 @@ public override void WriteKeyword(Role role, string keyword)
return;
}
}
if (keyword == "override")
{
var overriddenMember = GetOverrideMemberFromNodeStack();
if (overriddenMember != null)
{
var baseMember = InheritanceHelper.GetBaseMember(overriddenMember);
if (baseMember != null)
{
output.WriteReference(baseMember, keyword);
return;
}
}
}
output.Write(keyword);
}

IMember? GetOverrideMemberFromNodeStack()
{
foreach (var node in nodeStack)
{
if (node is EntityDeclaration entityDeclaration
&& entityDeclaration.GetSymbol() is IMember { IsOverride: true } member)
{
return member;
}
}
return null;
}

static bool NeedsFold(AstNode node)
{
if (node == null)
Expand Down
6 changes: 3 additions & 3 deletions ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ILSpyCmdProgram
include = generateDiagrammerCmd + "-include";

[Option(generateDiagrammerCmd, "Generates an interactive HTML diagrammer app from selected types in the target assembly" +
" - to the --outputdir or in a 'diagrammer' folder next to to the assembly by default.", CommandOptionType.NoValue)]
" - to the --outputdir or in a 'diagrammer' folder next to the assembly by default.", CommandOptionType.NoValue)]
public bool GenerateDiagrammer { get; }

[Option(include, "An optional regular expression matching Type.FullName used to whitelist types to include in the generated diagrammer.", CommandOptionType.SingleValue)]
Expand All @@ -171,8 +171,8 @@ class ILSpyCmdProgram
public bool ReportExcludedTypes { get; set; }

[Option(generateDiagrammerCmd + "-docs", "The path or file:// URI of the XML file containing the target assembly's documentation comments." +
" You only need to set this if a) you want your diagrams annotated with them and b) the file name differs from that of the assmbly." +
" To enable XML documentation output for your assmbly, see https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/#create-xml-documentation-output",
" You only need to set this if a) you want your diagrams annotated with them and b) the file name differs from that of the assembly." +
" To enable XML documentation output for your assembly, see https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/#create-xml-documentation-output",
CommandOptionType.SingleValue)]
public string XmlDocs { get; set; }

Expand Down
6 changes: 3 additions & 3 deletions ICSharpCode.ILSpyCmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Options:
--disable-updatecheck If using ilspycmd in a tight loop or fully automated scenario, you might want
to disable the automatic update check.
--generate-diagrammer Generates an interactive HTML diagrammer app from selected types in the target
assembly - to the --outputdir or in a 'diagrammer' folder next to to the
assembly - to the --outputdir or in a 'diagrammer' folder next to the
assembly by default.
--generate-diagrammer-include An optional regular expression matching Type.FullName used to whitelist types
to include in the generated diagrammer.
Expand All @@ -70,8 +70,8 @@ Options:
your regular expressions.
--generate-diagrammer-docs The path or file:// URI of the XML file containing the target assembly's
documentation comments. You only need to set this if a) you want your diagrams
annotated with them and b) the file name differs from that of the assmbly. To
enable XML documentation output for your assmbly, see
annotated with them and b) the file name differs from that of the assembly. To
enable XML documentation output for your assembly, see
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/xmldoc/#create-xml-documentation-output
--generate-diagrammer-strip-namespaces Optional space-separated namespace names that are removed for brevity from XML
documentation comments. Note that the order matters: e.g. replace
Expand Down