Browse Source

Drop "mirrors WPF" cross-references from comments / xmldoc

Assisted-by: Claude:claude-opus-4-7:Claude Code

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
66df6b463a
  1. 11
      ILSpy/App.axaml
  2. 12
      ILSpy/AppEnv/ILSpyTraceListener.cs
  3. 2
      ILSpy/AssemblyTree/AssemblyListPane.axaml.cs
  4. 7
      ILSpy/AssemblyTree/AssemblyTreeModel.cs
  5. 6
      ILSpy/Commands/ExportCommandAttribute.cs
  6. 6
      ILSpy/Commands/NotImplementedDialog.cs
  7. 4
      ILSpy/Controls/TreeLines.cs
  8. 14
      ILSpy/DecompilationOptions.cs
  9. 1
      ILSpy/EntityReference.cs
  10. 10
      ILSpy/Images.cs
  11. 6
      ILSpy/LanguageSettings.cs
  12. 6
      ILSpy/Languages/ILLanguage.cs
  13. 10
      ILSpy/NavigationHistory.cs
  14. 8
      ILSpy/TaskbarProgressService.cs
  15. 5
      ILSpy/TextView/DecompilerTextView.axaml
  16. 46
      ILSpy/TextView/DecompilerTextView.axaml.cs
  17. 14
      ILSpy/TextView/DocumentationRenderer.cs
  18. 1
      ILSpy/TextView/ReferenceElementGenerator.cs
  19. 8
      ILSpy/TextView/TextMarkerService.cs
  20. 5
      ILSpy/TextView/UIElementGenerator.cs
  21. 2
      ILSpy/TreeNodes/AssemblyReferenceReferencedTypesTreeNode.cs
  22. 5
      ILSpy/TreeNodes/AssemblyTreeNode.cs
  23. 3
      ILSpy/TreeNodes/MethodTreeNode.cs
  24. 4
      ILSpy/TreeNodes/ModuleReferenceTreeNode.cs
  25. 8
      ILSpy/Views/MainMenu.axaml.cs

11
ILSpy/App.axaml

@ -48,12 +48,11 @@ @@ -48,12 +48,11 @@
<StyleInclude Source="avares://AvaloniaEdit/Themes/Simple/AvaloniaEdit.xaml" />
<dockTheme:DockSimpleTheme />
<!-- Classic SharpTreeView-style +/- expander, ported from ILSpy WPF
(ILSpy/Controls/TreeView/SharpTreeView.xaml). Colors are hardcoded
because the presenter's :checked style forces Background/BorderBrush
to Transparent through TemplateBinding. The Margin offsets the
visible glyph from the presenter cell's left edge — the presenter
itself overwrites its Padding from Level * Indent in code. -->
<!-- Classic Windows-Explorer +/- expander. Colors are hardcoded because the
presenter's :checked style forces Background/BorderBrush to Transparent
through TemplateBinding. The Margin offsets the visible glyph from the
presenter cell's left edge — the presenter itself overwrites its Padding
from Level * Indent in code. -->
<Style Selector="DataGridHierarchicalPresenter /template/ ToggleButton#PART_Expander">
<Setter Property="Padding" Value="0" />
<Setter Property="Template">

12
ILSpy/AppEnv/ILSpyTraceListener.cs

@ -24,10 +24,10 @@ using System.Linq; @@ -24,10 +24,10 @@ using System.Linq;
namespace ILSpy.AppEnv
{
/// <summary>
/// Trace listener that downgrades <c>Debug.Assert</c> failures from process-killing fail-fasts
/// to a regular surfaced exception. The decompiler ships a number of asserts that fire on
/// real-world (but unusual) IL — without this, hovering or decompiling such a method would
/// terminate the process. WPF ILSpy ships <c>ILSpyTraceListener</c> for the same reason.
/// Trace listener that downgrades <c>Debug.Assert</c> failures from process-killing
/// fail-fasts to a regular surfaced exception. The decompiler ships a number of asserts
/// that fire on real-world (but unusual) IL — without this, hovering or decompiling such
/// a method would terminate the process.
///
/// We route through <see cref="GlobalExceptionHandler.Show"/> so asserts land in the same
/// dialog as any other unhandled exception.
@ -47,7 +47,7 @@ namespace ILSpy.AppEnv @@ -47,7 +47,7 @@ namespace ILSpy.AppEnv
}
// Dedup repeated asserts by call site so a decompile that hits the same assert in 200
// methods only opens one dialog. Mirrors WPF ILSpyTraceListener's "ignoredStacks".
// methods only opens one dialog.
readonly HashSet<string> seenTopFrames = new();
public override void Fail(string? message)
@ -60,7 +60,7 @@ namespace ILSpy.AppEnv @@ -60,7 +60,7 @@ namespace ILSpy.AppEnv
Debug.WriteLine(" " + detailMessage);
// Strip the ILSpyTraceListener + Debug.* frames so the dialog shows the assert's
// actual call site at the top, like the WPF ILSpyTraceListener does.
// actual call site at the top.
var frames = new StackTrace(fNeedFileInfo: true).ToString()
.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
.SkipWhile(f => f.Contains("ILSpyTraceListener") || f.Contains("System.Diagnostics"))

2
ILSpy/AssemblyTree/AssemblyListPane.axaml.cs

@ -132,7 +132,7 @@ namespace ILSpy.AssemblyTree @@ -132,7 +132,7 @@ namespace ILSpy.AssemblyTree
}
// DataGrid.ScrollIntoView only brings the row to the nearest viewport edge; we want
// it centred (matching the WPF host).
// the row centred so the user's eye lands on it.
void CenterRowInView(HierarchicalNode node)
{
TreeGrid.ScrollIntoView(node, TreeGrid.Columns[0]);

7
ILSpy/AssemblyTree/AssemblyTreeModel.cs

@ -60,7 +60,7 @@ namespace ILSpy.AssemblyTree @@ -60,7 +60,7 @@ namespace ILSpy.AssemblyTree
/// <see cref="SharpTreeNode.IsSelected"/>. <see cref="SelectedItem"/> is a convenience
/// wrapper around the *primary* (last-added) entry — drives decompilation, navigation
/// history, and tree-view-path persistence — but the underlying state is single-sourced
/// here, mirroring the WPF host's MultiSelectorExtensions.SelectionBinding pattern.
/// here.
/// </summary>
[IgnoreDataMember]
public ObservableCollection<SharpTreeNode> SelectedItems { get; } = [];
@ -240,9 +240,8 @@ namespace ILSpy.AssemblyTree @@ -240,9 +240,8 @@ namespace ILSpy.AssemblyTree
/// <summary>
/// Finds the tree node corresponding to <paramref name="reference"/> — used by
/// hyperlink clicks in the decompiler view to route to the right entity.
/// Mirrors <c>ICSharpCode.ILSpy.AssemblyTree.AssemblyTreeModel.FindTreeNode</c> but only
/// covers the references the Avalonia tree currently knows how to model.
/// hyperlink clicks in the decompiler view to route to the right entity. Currently
/// only covers the reference kinds the tree knows how to model.
/// </summary>
public ILSpyTreeNode? FindTreeNode(object? reference)
{

6
ILSpy/Commands/ExportCommandAttribute.cs

@ -42,9 +42,9 @@ namespace ILSpy.Commands @@ -42,9 +42,9 @@ namespace ILSpy.Commands
}
/// <summary>
/// Marks a command for inclusion in the main menu. Mirrors the WPF attribute so
/// the metadata-driven menu construction code from the WPF host can be ported with
/// minimal changes.
/// Marks a command for inclusion in the main menu. The metadata drives where in the
/// menu hierarchy the entry appears, what icon / accelerator it carries, and which
/// command instance is invoked.
/// </summary>
[MetadataAttribute]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]

6
ILSpy/Commands/NotImplementedDialog.cs

@ -26,9 +26,9 @@ namespace ILSpy.Commands @@ -26,9 +26,9 @@ namespace ILSpy.Commands
{
/// <summary>
/// Lightweight modal "Not yet implemented" dialog. Used by menu commands whose underlying
/// feature (Options dialog, About page, GAC browser, save dialogs, &hellip;) hasn't been ported
/// from WPF to Avalonia yet — the menu still surfaces the entry so the structure mirrors
/// the WPF host, but invocation tells the user clearly that the feature is unavailable.
/// feature (Options dialog, About page, GAC browser, save dialogs, &hellip;) isn't yet
/// available — the menu still surfaces the entry so the structure stays consistent, but
/// invocation tells the user clearly that the feature is unavailable.
/// </summary>
internal static class NotImplementedDialog
{

4
ILSpy/Controls/TreeLines.cs

@ -24,8 +24,8 @@ using ICSharpCode.ILSpyX.TreeView; @@ -24,8 +24,8 @@ using ICSharpCode.ILSpyX.TreeView;
namespace ILSpy.Controls
{
// Classic Windows-Explorer tree-lines, ported from ILSpy WPF SharpTreeView's LinesRenderer.
// Drawn as a layer behind the DataGridHierarchicalPresenter content so it can reach across
// Classic Windows-Explorer tree-lines: drawn as a layer behind the
// DataGridHierarchicalPresenter content so it can reach across
// the indent area for ancestor verticals. X positions assume:
// - presenter Indent step = 16 px (DataGridHierarchicalPresenterIndent)
// - expander column width = 13 px (DataGridHierarchicalExpanderSize override)

14
ILSpy/DecompilationOptions.cs

@ -23,23 +23,23 @@ using ICSharpCode.Decompiler; @@ -23,23 +23,23 @@ using ICSharpCode.Decompiler;
namespace ILSpy
{
/// <summary>
/// Options passed to <see cref="Languages.Language"/>'s Decompile* methods.
/// Stripped-down compared to the WPF host: no project export, no display-settings plumbing,
/// no view-state restoration — just enough to drive a single decompilation into a text view.
/// Options passed to <see cref="Languages.Language"/>'s Decompile* methods. Just enough
/// to drive a single decompilation into a text view — project-export and view-state
/// restoration aren't wired up yet.
/// </summary>
public sealed class DecompilationOptions
{
public DecompilerSettings DecompilerSettings { get; }
public CancellationToken CancellationToken { get; set; }
/// <summary>Mirrors WPF: full module decompilation rather than just the selected member.</summary>
/// <summary>Decompile the whole module rather than just the selected member.</summary>
public bool FullDecompilation { get; set; }
/// <summary>Mirrors WPF: target directory for project export. Always null in the
/// Avalonia host today (no save dialog wired up); kept for signature parity.</summary>
/// <summary>Target directory for project export. Always null today since no save
/// dialog is wired up; kept on the signature for future use.</summary>
public string? SaveAsProjectDirectory { get; set; }
/// <summary>Mirrors WPF: escape invalid C# identifiers so the output compiles.</summary>
/// <summary>Escape invalid C# identifiers so the output compiles.</summary>
public bool EscapeInvalidIdentifiers { get; set; }
public DecompilationOptions(DecompilerSettings settings)

1
ILSpy/EntityReference.cs

@ -27,7 +27,6 @@ namespace ILSpy @@ -27,7 +27,6 @@ namespace ILSpy
/// <summary>
/// Unresolved metadata reference — a (module, handle) pair plus a protocol that says how
/// to interpret the target (e.g. "decompile" jumps to the declaration in C# view).
/// Mirrors <c>ICSharpCode.ILSpy.EntityReference</c> from the WPF host.
/// </summary>
[DebuggerDisplay("EntityReference Module={Module}, Handle={Handle}, Protocol={Protocol}")]
public sealed class EntityReference

10
ILSpy/Images.cs

@ -130,8 +130,8 @@ namespace ILSpy.Images @@ -130,8 +130,8 @@ namespace ILSpy.Images
var key = (baseImage, overlay, isStatic, isExtension);
if (iconCache.TryGetValue(key, out var cached))
return cached;
// Order matches the WPF host: extension behind static behind accessibility, on top
// of an 80%-scaled base when any overlay shrinks it out of the way.
// Layer order: extension behind static behind accessibility, on top of an
// 80%-scaled base when any overlay shrinks it out of the way.
var overlays = new List<IImage>(3);
if (isExtension)
overlays.Add(OverlayExtension);
@ -169,9 +169,9 @@ namespace ILSpy.Images @@ -169,9 +169,9 @@ namespace ILSpy.Images
}
/// <summary>
/// Composed tree-node icon: a base symbol with N overlays drawn on top in order. The base
/// can optionally be scaled to a fraction of the cell (mirrors the WPF host's "shrink to
/// 80% top-left" trick when an accessibility overlay sits in the bottom-right corner).
/// Composed tree-node icon: a base symbol with N overlays drawn on top in order. The
/// base can optionally be scaled to a fraction of the cell — used to shrink the base
/// to 80% top-left when an accessibility overlay sits in the bottom-right corner.
/// </summary>
sealed class LayeredImage : IImage
{

6
ILSpy/LanguageSettings.cs

@ -26,9 +26,9 @@ using ICSharpCode.ILSpyX.Settings; @@ -26,9 +26,9 @@ using ICSharpCode.ILSpyX.Settings;
namespace ILSpy
{
/// <summary>
/// Mirrors the WPF LanguageSettings: holds the API visibility filter and the active
/// output language id. The View menu binds checkmarks straight to the three Api*
/// boolean projections of <see cref="ShowApiLevel"/>.
/// Holds the API visibility filter and the active output language id. The View menu
/// binds checkmarks straight to the three Api* boolean projections of
/// <see cref="ShowApiLevel"/>.
/// </summary>
public sealed partial class LanguageSettings : ObservableObject, IChildSettings
{

6
ILSpy/Languages/ILLanguage.cs

@ -41,9 +41,9 @@ namespace ILSpy.Languages @@ -41,9 +41,9 @@ namespace ILSpy.Languages
public override string FileExtension => ".il";
// WPF wires DisplaySettings here (ShowMetadataTokens / ShowRawRVAOffsetAndBytes /
// DecodeCustomAttributeBlobs / ShowMetadataTokensInBase10). Avalonia hasn't ported
// DisplaySettings yet, so we mirror the WPF defaults (all false).
// DisplaySettings (ShowMetadataTokens / ShowRawRVAOffsetAndBytes /
// DecodeCustomAttributeBlobs / ShowMetadataTokensInBase10) aren't wired yet — once
// they are, plumb them in here. All four default to false.
protected virtual ReflectionDisassembler CreateDisassembler(ITextOutput output, DecompilationOptions options)
{
output.IndentationString = options.DecompilerSettings.CSharpFormattingOptions.IndentationString;

10
ILSpy/NavigationHistory.cs

@ -22,12 +22,10 @@ using System.Collections.Generic; @@ -22,12 +22,10 @@ using System.Collections.Generic;
namespace ILSpy.Navigation
{
/// <summary>
/// Two-stack browser-style history. Mirrors the WPF
/// <c>ICSharpCode.ILSpy.NavigationHistory&lt;T&gt;</c> behaviour: rapid successive
/// <see cref="Record"/> calls (within 0.5 s) replace the current entry instead of pushing,
/// so a tree refresh that re-selects the same node doesn't pollute the back stack with
/// duplicates. Equality is reference-based — fine for tree nodes which are reused for the
/// lifetime of an assembly load.
/// Two-stack browser-style history. Rapid successive <see cref="Record"/> calls (within
/// 0.5 s) replace the current entry instead of pushing, so a tree refresh that re-selects
/// the same node doesn't pollute the back stack with duplicates. Equality is reference-
/// based — fine for tree nodes which are reused for the lifetime of an assembly load.
/// </summary>
internal sealed class NavigationHistory<T> where T : class
{

8
ILSpy/TaskbarProgressService.cs

@ -35,10 +35,10 @@ namespace ILSpy @@ -35,10 +35,10 @@ namespace ILSpy
}
/// <summary>
/// Window-level taskbar progress indicator. Mirrors WPF's
/// <c>System.Windows.Shell.TaskbarItemInfo</c> just enough for the decompile spinner —
/// only the <see cref="TaskbarProgressState.Indeterminate"/> / <c>None</c> cycle is wired
/// up so far. On non-Windows hosts the state is still tracked but the OS hook is a no-op.
/// Window-level taskbar progress indicator — currently only the
/// <see cref="TaskbarProgressState.Indeterminate"/> / <c>None</c> cycle is wired up,
/// driven by the decompile spinner. On non-Windows hosts the state is tracked but the
/// OS hook is a no-op.
/// </summary>
[Export]
[Shared]

5
ILSpy/TextView/DecompilerTextView.axaml

@ -9,9 +9,8 @@ @@ -9,9 +9,8 @@
x:Class="ILSpy.TextView.DecompilerTextView"
x:DataType="textView:DecompilerTabPageModel">
<!-- Wait-adorner pattern ported from ILSpy/TextView/DecompilerTextView.xaml: a translucent
overlay above the editor with a centred title + progress bar + cancel button while a
decompilation is in flight. -->
<!-- Wait-adorner: a translucent overlay above the editor with a centred title +
progress bar + cancel button while a decompilation is in flight. -->
<Grid>
<ae:TextEditor Name="Editor"
IsReadOnly="True"

46
ILSpy/TextView/DecompilerTextView.axaml.cs

@ -47,11 +47,11 @@ namespace ILSpy.TextView @@ -47,11 +47,11 @@ namespace ILSpy.TextView
public partial class DecompilerTextView : UserControl
{
// Two-track output of BuildHoverContent: rich content opens the sticky Popup with the
// WPF distance corridor; plain content uses Avalonia's ToolTip attached property.
// pointer-distance corridor; plain content uses Avalonia's ToolTip attached property.
readonly record struct HoverContent(Control Control, bool IsRich);
// Local-reference highlight colours, mirroring ILSpy/Themes/generic.xaml. Use the same
// light-yellow "GreenYellow" for matches and a softer green for the actual definition.
// Local-reference highlight colours: light-yellow "GreenYellow" for matches and a
// softer green for the actual definition.
static readonly Color LocalMatchBackground = Colors.GreenYellow;
static readonly Color LocalDefinitionBackground = Color.FromArgb(0x80, 0xA0, 0xFF, 0xA0);
@ -90,10 +90,10 @@ namespace ILSpy.TextView @@ -90,10 +90,10 @@ namespace ILSpy.TextView
textMarkerService = new TextMarkerService(Editor.TextArea.TextView);
Editor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
// Hover detection mirrors WPF ILSpy: subscribe to AvaloniaEdit's built-in
// PointerHover routed event (fires after the cursor settles inside a small box for
// ~400 ms) and resolve the segment fresh at hover-time using the live pointer
// position. PointerMoved still drives the rich popup's distance corridor.
// Subscribe to AvaloniaEdit's built-in PointerHover routed event (fires after the
// cursor settles inside a small box for ~400 ms) and resolve the segment fresh at
// hover-time using the live pointer position. PointerMoved still drives the rich
// popup's distance corridor.
ToolTip.SetPlacement(Editor.TextArea.TextView, PlacementMode.Pointer);
ToolTip.SetBetweenShowDelay(Editor.TextArea.TextView, 0);
Editor.TextArea.TextView.AddHandler(
@ -244,10 +244,9 @@ namespace ILSpy.TextView @@ -244,10 +244,9 @@ namespace ILSpy.TextView
localReferenceMarks.Clear();
}
// Mirror WPF DecompilerTextView.GetPositionFromMousePosition: live cursor + full
// ScrollOffset, queried at hover-event time. Returns null if the pointer is past the
// end of the line (so we don't snap back to the last visual column when the user is
// hovering empty trailing space — matches WPF's behaviour exactly).
// Live cursor + full ScrollOffset, queried at hover-event time. Returns null if the
// pointer is past the end of the line so we don't snap back to the last visual
// column when the user is hovering empty trailing space.
AvaloniaEdit.TextViewPosition? GetPositionFromPointer(PointerEventArgs e)
{
var textView = Editor.TextArea.TextView;
@ -262,9 +261,9 @@ namespace ILSpy.TextView @@ -262,9 +261,9 @@ namespace ILSpy.TextView
void OnTextViewPointerHover(object? sender, PointerEventArgs e)
{
// Mirrors WPF DecompilerTextView.TextViewMouseHover: the existing popup gets a veto
// (it can refuse to be replaced if it's "interacting" with the user — keyboard focus
// in WPF), then we resolve a fresh segment under the live pointer.
// The existing popup gets a veto (it can refuse to be replaced if it's
// interacting with the user), then we resolve a fresh segment under the live
// pointer.
if (!TryCloseExistingPopup(mouseClick: false))
return;
if (DataContext is not DecompilerTabPageModel model || model.References == null)
@ -287,18 +286,17 @@ namespace ILSpy.TextView @@ -287,18 +286,17 @@ namespace ILSpy.TextView
OpenPlainTooltip(content.Value.Control);
}
// Mirrors WPF DecompilerTextView.TryCloseExistingPopup. Closes any open tooltip / rich
// popup before a new hover takes over. Returns false when a rich popup wants to stay
// open — at which point the caller should bail rather than steal it. <paramref name="mouseClick"/>
// forces the close even if the popup is interacting with the user (used on click, on
// document change, etc.).
// Closes any open tooltip / rich popup before a new hover takes over. Returns false
// when a rich popup wants to stay open — at which point the caller should bail
// rather than steal it. <paramref name="mouseClick"/> forces the close even if the
// popup is interacting with the user (used on click, on document change, etc.).
bool TryCloseExistingPopup(bool mouseClick)
{
if (richPopup.IsOpen)
{
// TODO: WPF refuses to close here when the FlowDocumentTooltip has keyboard
// focus (the user is reading / clicking links inside it). We don't track
// keyboard focus on the popup yet, so the popup is always replaceable.
// TODO: refuse to close while the popup has keyboard focus (the user is
// reading / clicking links inside it). Not tracked yet — for now the popup
// is always replaceable.
_ = mouseClick;
CloseRichPopup();
return true;
@ -309,8 +307,8 @@ namespace ILSpy.TextView @@ -309,8 +307,8 @@ namespace ILSpy.TextView
void OnTextViewPointerHoverStopped(object? sender, PointerEventArgs e)
{
// Plain tooltips close on hover stop. The rich popup's lifetime is governed by the
// distance corridor on PointerMoved, mirroring WPF's TextEditorMouseMove.
// Plain tooltips close on hover stop. The rich popup's lifetime is governed by
// the distance corridor on PointerMoved.
if (!richPopup.IsOpen)
CloseTooltip();
}

14
ILSpy/TextView/DocumentationRenderer.cs

@ -40,10 +40,8 @@ namespace ILSpy.TextView @@ -40,10 +40,8 @@ namespace ILSpy.TextView
{
/// <summary>
/// Renders an entity signature plus its XML documentation into an Avalonia control tree
/// suitable for hosting inside a hover popup. Direct port of WPF
/// <c>ILSpy/TextView/DocumentationUIBuilder.cs</c> — the parsing logic and section/list
/// structure mirror the WPF builder, but blocks are emitted as <see cref="SelectableTextBlock"/>
/// /<see cref="StackPanel"/> children instead of <c>FlowDocument</c> blocks.
/// suitable for hosting inside a hover popup. Output is a tree of
/// <see cref="SelectableTextBlock"/> + <see cref="StackPanel"/> children.
/// </summary>
public sealed class DocumentationRenderer
{
@ -100,8 +98,8 @@ namespace ILSpy.TextView @@ -100,8 +98,8 @@ namespace ILSpy.TextView
public string? ParameterName { get; set; }
/// <summary>
/// Wraps the accumulated content in a chrome border + scroll viewer (mirrors WPF
/// <c>FlowDocumentTooltip</c>) and returns the final control tree for use in a popup.
/// Wraps the accumulated content in a chrome border + scroll viewer and returns the
/// final control tree for use in a popup.
/// </summary>
public Control CreateView(double maxWidth = 600, double maxHeight = 400)
{
@ -562,8 +560,8 @@ namespace ILSpy.TextView @@ -562,8 +560,8 @@ namespace ILSpy.TextView
ignoreWhitespace = true;
}
// Walks RichText highlighted sections and emits one Run per uniformly-coloured span.
// Mirrors WPF AvalonEdit's RichText.CreateRuns, but uses Avalonia inlines.
// Walks RichText highlighted sections and emits one Avalonia Run per
// uniformly-coloured span.
internal static void AppendRichText(InlineCollection inlines, RichText rich)
{
foreach (var section in rich.GetHighlightedSections(0, rich.Length))

1
ILSpy/TextView/ReferenceElementGenerator.cs

@ -26,7 +26,6 @@ namespace ILSpy.TextView @@ -26,7 +26,6 @@ namespace ILSpy.TextView
/// <summary>
/// Creates clickable hyperlink elements in the text view from a
/// <see cref="TextSegmentCollection{ReferenceSegment}"/> emitted by the decompiler.
/// Mirrors <c>ICSharpCode.ILSpy.TextView.ReferenceElementGenerator</c>.
/// </summary>
sealed class ReferenceElementGenerator : VisualLineElementGenerator
{

8
ILSpy/TextView/TextMarkerService.cs

@ -31,10 +31,10 @@ namespace ILSpy.TextView @@ -31,10 +31,10 @@ namespace ILSpy.TextView
{
/// <summary>
/// Manages background-coloured text marks over the editor — used for local-reference
/// highlighting today, and a useful primitive for future features (errors, search hits, ...).
/// Slimmed down from the WPF host's <c>TextMarkerService</c>: only the colored background
/// path is implemented; underline marker types (squiggly / dotted / solid) and per-marker
/// foreground / typeface tweaks are deliberately omitted until something actually needs them.
/// highlighting today, and a useful primitive for future features (errors, search hits,
/// …). Currently only the coloured-background path is implemented; underline marker
/// types (squiggly / dotted / solid) and per-marker foreground / typeface tweaks are
/// deliberately omitted until something actually needs them.
/// </summary>
sealed class TextMarkerService : IBackgroundRenderer
{

5
ILSpy/TextView/UIElementGenerator.cs

@ -29,9 +29,8 @@ namespace ILSpy.TextView @@ -29,9 +29,8 @@ namespace ILSpy.TextView
/// <summary>
/// Embeds inline UI elements produced by <see cref="ISmartTextOutput.AddUIElement"/> in
/// the rendered text. Mirrors the WPF host's UIElementGenerator: the element factory is
/// stored as a <see cref="Lazy{Control}"/> so the actual control is constructed on the
/// UI thread when the row is first realised.
/// the rendered text. The element factory is stored as a <see cref="Lazy{Control}"/> so
/// the actual control is constructed on the UI thread when the row is first realised.
/// </summary>
sealed class UIElementGenerator : VisualLineElementGenerator, IComparer<Pair>
{

2
ILSpy/TreeNodes/AssemblyReferenceReferencedTypesTreeNode.cs

@ -30,7 +30,7 @@ namespace ILSpy.TreeNodes @@ -30,7 +30,7 @@ namespace ILSpy.TreeNodes
/// <summary>
/// "Referenced Types (N)" subnode under <see cref="AssemblyReferenceTreeNode"/>.
/// Lists every <c>TypeRef</c> + <c>ExportedType</c> that the parent assembly imports
/// from the referenced one, mirroring the WPF host.
/// from the referenced one.
/// </summary>
public sealed class AssemblyReferenceReferencedTypesTreeNode : ILSpyTreeNode
{

5
ILSpy/TreeNodes/AssemblyTreeNode.cs

@ -167,7 +167,7 @@ namespace ILSpy.TreeNodes @@ -167,7 +167,7 @@ namespace ILSpy.TreeNodes
/// <summary>
/// Finds the <see cref="NamespaceTreeNode"/> for the given namespace string, or
/// <c>null</c> if no children are loaded yet or the namespace has no top-level types
/// in this assembly. Mirrors <c>ICSharpCode.ILSpy.TreeNodes.AssemblyTreeNode.FindNamespaceNode</c>.
/// in this assembly.
/// </summary>
public NamespaceTreeNode? FindNamespaceNode(string namespaceName)
{
@ -179,8 +179,7 @@ namespace ILSpy.TreeNodes @@ -179,8 +179,7 @@ namespace ILSpy.TreeNodes
/// <summary>
/// Finds the <see cref="TypeTreeNode"/> for the given top-level type definition.
/// Walks the assembly's namespaces (loading them as needed) and matches by
/// <see cref="TypeTreeNode.Handle"/>. Mirrors WPF's <c>FindTypeNode</c> but without
/// the eager <c>typeDict</c> cache.
/// <see cref="TypeTreeNode.Handle"/>.
/// </summary>
public TypeTreeNode? FindTypeNode(ITypeDefinition type)
{

3
ILSpy/TreeNodes/MethodTreeNode.cs

@ -54,7 +54,8 @@ namespace ILSpy.TreeNodes @@ -54,7 +54,8 @@ namespace ILSpy.TreeNodes
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
=> language.DecompileMethod(MethodDefinition, output, options);
// Stable identity for SessionSettings.ActiveTreeViewPath; matches the WPF host's format.
// Stable identity for SessionSettings.ActiveTreeViewPath; format must round-trip
// across launches so the saved path can be restored.
public override string ToString()
=> "Method " + new ICSharpCode.Decompiler.IL.ILAmbience {
ConversionFlags = ConversionFlags.ShowTypeParameterList

4
ILSpy/TreeNodes/ModuleReferenceTreeNode.cs

@ -33,8 +33,8 @@ namespace ILSpy.TreeNodes @@ -33,8 +33,8 @@ namespace ILSpy.TreeNodes
/// <summary>
/// Module reference inside <see cref="ReferenceFolderTreeNode"/>. Modern .NET assemblies
/// almost never have module references (multi-file assemblies were a .NET Framework
/// feature) — the node is here for parity with the WPF host so non-PE / multi-module
/// edge cases still render correctly.
/// feature) — the node is here so non-PE / multi-module edge cases still render
/// correctly.
/// </summary>
sealed class ModuleReferenceTreeNode : ILSpyTreeNode
{

8
ILSpy/Views/MainMenu.axaml.cs

@ -143,8 +143,8 @@ public partial class MainMenu : UserControl @@ -143,8 +143,8 @@ public partial class MainMenu : UserControl
// Wire up the keyboard accelerator if the export declared one. HotKey
// registers the window-scoped shortcut; InputGesture is what actually
// renders the gesture text on the right side of the menu item — both are
// needed to mirror the WPF host's "Ctrl+O" appearance + key handling.
// renders the gesture text on the right side of the menu item — both
// are needed for "Ctrl+O" to appear AND fire from the keyboard.
if (TryParseGesture(entry.Metadata?.InputGestureText, out var gesture))
{
menuItem.HotKey = gesture;
@ -191,8 +191,8 @@ public partial class MainMenu : UserControl @@ -191,8 +191,8 @@ public partial class MainMenu : UserControl
{
// At this point InitMainMenu has already appended any MEF-driven Window-menu commands
// (CloseAllDocuments / ResetLayout). Append tool-pane toggles after a separator so
// they sit at the bottom, matching the WPF host's Window menu order.
// (Tab pages are not yet exposed observably on Avalonia DockWorkspace; revisit later.)
// they sit at the bottom of the Window menu.
// (Tab pages aren't yet exposed observably on DockWorkspace; revisit later.)
if (dockWorkspace.ToolPaneMenuItems.Count == 0)
return;
if (windowMenuItem.Items.Count > 0)

Loading…
Cancel
Save