Skip to content

nfc: Clean up multiple enumerations of IEnumerable<> in WriteSolutionFile().#1

Closed
petercrabtree wants to merge 7 commits into
masterfrom
fix/ilspcmd-solution-references
Closed

nfc: Clean up multiple enumerations of IEnumerable<> in WriteSolutionFile().#1
petercrabtree wants to merge 7 commits into
masterfrom
fix/ilspcmd-solution-references

Conversation

@petercrabtree
Copy link
Copy Markdown
Owner

Link to issue(s) this covers

Problem

Link to, or brief information about the issue

Solution

  • Any comments on the approach taken, its consistency with surrounding code, etc.
  • Which part of this PR is most in need of attention/improvement?
  • At least one test covering the code changed

Copy link
Copy Markdown
Owner Author

petercrabtree commented Jul 6, 2025

@petercrabtree petercrabtree marked this pull request as ready for review July 6, 2025 23:00
Copilot AI review requested due to automatic review settings July 6, 2025 23:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the codebase to target .NET 10.0 and adds support for new C# 13 features (inline arrays, params collections, overflow checks), along with numerous related adjustments in project files, build scripts, resource files, and decompiler internals.

  • Upgrade target frameworks, SDK versions, and NuGet feeds to .NET 10.0
  • Introduce inline array support and params‐collections in the decompiler
  • Add “CheckForOverflowUnderflow” option and integrate it throughout project writers and transforms

Reviewed Changes

Copilot reviewed 119 out of 121 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
publishlocaldev.ps1, publish.ps1, global.json, *.csproj Bump all build and publish scripts and projects to .NET 10.0
ILSpy/Options/DecompilerSettings.cs Add ParamsCollections and InlineArrays flags; refactor Clone
ICSharpCode.Decompiler/Solution/SolutionCreator.cs Change WriteSolutionFile to accept List
ILSpy/Search/SearchPane.xaml.cs Rename Clone usage to direct settings assignment
ICSharpCode.Decompiler/TypeSystem/MetadataFile.cs Add PropertyAndEventBackingFieldLookup injection
ICSharpCode.Decompiler/IL/Transforms/InlineArrayTransform.cs Add new inline array IL transform
Files not reviewed (1)
  • ILSpy/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (3)

global.json:3

  • Update project documentation (README, CONTRIBUTING, CI config) to note the new .NET 10.0 SDK requirement so developers are aware of the upgrade.
    "version": "10.0.0",

ILSpy/Search/SearchPane.xaml.cs:481

  • Assigning the shared decompilerSettings instance instead of a clone means later requests may see modified settings; use Clone() or a deep copy to isolate each request.
				request.DecompilerSettings = decompilerSettings;

ILSpy/Options/DecompilerSettings.cs:58

  • [nitpick] The new override delegates to base.Clone(), but ensure that all nested mutable fields (like CSharpFormattingOptions) are also deeply cloned, otherwise instances may inadvertently share state.
		public override DecompilerSettings Clone()

Comment thread ILSpy/Util/SettingsService.cs Outdated
});
};
}
;
Copy link

Copilot AI Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Remove the stray semicolon on its own line after the closing brace; it is an empty statement and may confuse readers.

Suggested change
;

Copilot uses AI. Check for mistakes.
public static class SolutionCreator
{
private static readonly XNamespace ProjectFileNamespace = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");
static readonly XNamespace ProjectFileNamespace = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");
Copy link

Copilot AI Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Add an explicit access modifier (private or internal) to the static field to clarify intended visibility and maintain consistency with other members.

Suggested change
static readonly XNamespace ProjectFileNamespace = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");
private static readonly XNamespace ProjectFileNamespace = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");

Copilot uses AI. Check for mistakes.
…File().

(This is potentially expensive and the method is public, just a minor code smell.)
I accept any sideways glance for the allocation-averse code
@petercrabtree petercrabtree force-pushed the fix/ilspcmd-solution-references branch 4 times, most recently from 393b848 to f32c93f Compare July 8, 2025 01:50
@petercrabtree petercrabtree force-pushed the fix/ilspcmd-solution-references branch from f32c93f to fdb0703 Compare July 8, 2025 02:07
@petercrabtree petercrabtree deleted the fix/ilspcmd-solution-references branch October 18, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants