Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR handles IPC default values to avoid ambiguity by changing the DefaultReturn property type from object? to string? and updating the code generation logic accordingly. The change ensures that default values are always treated as string representations of code rather than having ambiguous interpretation between code and string literals.
Key changes:
- Changed
DefaultReturnproperty type fromobject?tostring?in IPC attributes - Updated attribute documentation with clear examples of string-to-code conversion
- Simplified code generation by removing complex type-based formatting logic
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| IFakeIpcObject.cs | Updated test interface to use escaped string literals for default values |
| IpcPropertyAttribute.cs | Changed DefaultReturn type to string? and updated documentation |
| IpcMethodAttribute.cs | Changed DefaultReturn type to string? and updated documentation |
| IpcPublicGenerator.cs | Removed exception handling wrapper code |
| SemanticAttributeHelper.cs | Added string type handling and cleaned up unused imports |
| IpcSemanticAttributeHelper.cs | Updated method signatures to use string? instead of object? |
| IpcShapeAttributeNamedValues.cs | Simplified formatting logic for default return values |
| IpcPublicAttributeNamedValues.cs | Removed complex type-based formatting method |
| Diagnostics.cs | Updated array syntax to use collection expressions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lindexi
approved these changes
Sep 10, 2025
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.
虽然让源生成器生成符合预期的代码更难一些,要多层引号,但不会再有歧义了,字符串里的东西一定是代码而不可能既可能是代码又可能是字符串