Skip to content

Commit

Permalink
Display params keyword on parameter tooltips in decompiled code
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Dec 9, 2023
1 parent 8b7439a commit 83ff9ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dnSpy/dnSpy.Decompiler/CSharp/CSharpFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,10 @@ public void WriteToolTip(ISourceVariable? variable) {
OutputWrite(isLocal ? dnSpy_Decompiler_Resources.ToolTip_Local : dnSpy_Decompiler_Resources.ToolTip_Parameter, BoxedTextColor.Text);
OutputWrite(DescriptionParenClose, BoxedTextColor.Punctuation);
WriteSpace();
if (pd is not null && pd.CustomAttributes.IsDefined("System.ParamArrayAttribute")) {
OutputWrite(Keyword_params, BoxedTextColor.Keyword);
WriteSpace();
}
Write(variable.Type, !isLocal ? pd : null, null, null, forceReadOnly: (variable.Flags & SourceVariableFlags.ReadOnlyReference) != 0, attributeProvider: pd);
WriteSpace();
WriteIdentifier(TypeFormatterUtils.GetName(variable), isLocal ? BoxedTextColor.Local : BoxedTextColor.Parameter);
Expand Down
4 changes: 4 additions & 0 deletions dnSpy/dnSpy.Decompiler/VisualBasic/VisualBasicFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,10 @@ public void WriteToolTip(ISourceVariable? variable) {
OutputWrite(Keyword_ByRef, BoxedTextColor.Keyword);
WriteSpace();
}
if (pd is not null && pd.CustomAttributes.IsDefined("System.ParamArrayAttribute")) {
OutputWrite(Keyword_params, BoxedTextColor.Keyword);
WriteSpace();
}
WriteIdentifier(TypeFormatterUtils.GetName(variable), isLocal ? BoxedTextColor.Local : BoxedTextColor.Parameter);
if (pd is not null)
WriteToken(pd);
Expand Down

0 comments on commit 83ff9ce

Please sign in to comment.