Browse Source

ILAst and IL get bracket-matching via CSharpBracketSearcher

Language.BracketSearcher defaulted to DefaultBracketSearcher
(no-op); only CSharpLanguage overrode it. Switching the active
language to ILAst or IL left caret-on-bracket inert.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
7ef3c4b85c
  1. 5
      ILSpy/Languages/ILAstLanguage.cs
  2. 4
      ILSpy/Languages/ILLanguage.cs

5
ILSpy/Languages/ILAstLanguage.cs

@ -57,6 +57,11 @@ namespace ILSpy.Languages
this.name = name; this.name = name;
} }
// ILAst output uses the same `{}/()/[]` bracket conventions as C#, plus C#-style
// `//` comments and `"..."` strings. Reusing CSharpBracketSearcher gives the
// language correct bracket highlighting without a per-grammar implementation.
public override ILSpy.TextView.IBracketSearcher BracketSearcher { get; } = new CSharpBracketSearcher();
/// <summary> /// <summary>
/// Fires after a <see cref="DecompileMethod"/> run installs a fresh <see cref="Stepper"/>. /// Fires after a <see cref="DecompileMethod"/> run installs a fresh <see cref="Stepper"/>.
/// The Debug Steps pane subscribes here so it can rebind its TreeView to the new /// The Debug Steps pane subscribes here so it can rebind its TreeView to the new

4
ILSpy/Languages/ILLanguage.cs

@ -41,6 +41,10 @@ namespace ILSpy.Languages
public override string FileExtension => ".il"; public override string FileExtension => ".il";
// Disassembled IL uses the same `{}/()/[]` bracket conventions plus C#-style
// `//` comments and `"..."` strings — reuse CSharpBracketSearcher's logic.
public override ILSpy.TextView.IBracketSearcher BracketSearcher { get; } = new CSharpBracketSearcher();
// DisplaySettings (ShowMetadataTokens / ShowRawRVAOffsetAndBytes / // DisplaySettings (ShowMetadataTokens / ShowRawRVAOffsetAndBytes /
// DecodeCustomAttributeBlobs / ShowMetadataTokensInBase10) aren't wired yet — once // DecodeCustomAttributeBlobs / ShowMetadataTokensInBase10) aren't wired yet — once
// they are, plumb them in here. All four default to false. // they are, plumb them in here. All four default to false.

Loading…
Cancel
Save