Publicize IProjectFileWriter implementations - #3934
Merged
siegfriedpammer merged 5 commits intoJul 30, 2026
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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.
Member
|
Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Needed for #3903
Solution
IProjectFileWriterallows getting a project file writer based onDecompilerSettings.