Skip to content

Publicize IProjectFileWriter implementations - #3934

Merged
siegfriedpammer merged 5 commits into
icsharpcode:masterfrom
ds5678:publicize-project-file-writer-implementations
Jul 30, 2026
Merged

Publicize IProjectFileWriter implementations#3934
siegfriedpammer merged 5 commits into
icsharpcode:masterfrom
ds5678:publicize-project-file-writer-implementations

Conversation

@ds5678

@ds5678 ds5678 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Problem

Needed for #3903

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?
    • It currently has no tests.
  • At least one test covering the code changed

ds5678 added 4 commits July 23, 2026 18:53
Refactored code to assign WriteCustomPropertyGroup and WriteCustomItemGroup delegates to local variables before null checks and invocation. This ensures thread safety by avoiding race conditions if the delegates are modified by other threads.
@christophwille
christophwille requested a review from Copilot July 29, 2026 07:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Exposes IProjectFileWriter implementations publicly and centralizes selection of the appropriate writer based on DecompilerSettings, enabling external consumers (per #3903) to choose/extend project writer behavior.

Changes:

  • Replaced inline SDK/default writer selection with a settings-based factory call.
  • Made SDK-style writer public and extensible via virtual methods (custom properties, references, TFM selection).
  • Made the default writer publicly accessible as a singleton.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
ICSharpCode.Decompiler/CSharp/ProjectDecompiler/WholeProjectDecompiler.cs Switches writer selection to a settings-based helper.
ICSharpCode.Decompiler/CSharp/ProjectDecompiler/ProjectFileWriterSdkStyle.cs Publicizes SDK-style writer and adds virtual extension points for customization.
ICSharpCode.Decompiler/CSharp/ProjectDecompiler/ProjectFileWriterDefault.cs Publicizes default writer and exposes a singleton instance.
ICSharpCode.Decompiler/CSharp/ProjectDecompiler/IProjectFileWriter.cs Adds a helper intended to select a writer based on DecompilerSettings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ICSharpCode.Decompiler/CSharp/ProjectDecompiler/IProjectFileWriter.cs Outdated
Comment thread ICSharpCode.Decompiler/CSharp/ProjectDecompiler/IProjectFileWriter.cs Outdated
@siegfriedpammer
siegfriedpammer merged commit 5fe8c1a into icsharpcode:master Jul 30, 2026
7 checks passed
@siegfriedpammer

Copy link
Copy Markdown
Member

Thank you for your contribution!

@ds5678
ds5678 deleted the publicize-project-file-writer-implementations branch July 30, 2026 05:53
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