Commit Graph

6 Commits

Author SHA1 Message Date
Rintaro Ishizaki
7177055bdc [Refactoring] Skip failed witness decls in "add codable implementation"
When there are problems in the properties in the target type, witness
methods may not be synthesized. Don't try to add such methods.

https://github.com/apple/swift/issues/72387
2024-03-18 23:49:24 +09:00
Rintaro Ishizaki
39606e6269 [refactoring] Rework "add codable implementation" refactoring
* Support extensions including conditional conformance
* Correct access modifiers
* More correct lookup for the synthesized declarations
* Avoid printing decls in nested types (rdar://98025945)
2024-03-13 13:34:32 +09:00
Allan Shortlidge
8079d9cf45 AST: Fix whitespace for switch statements under -print-ast.
No test changes because the tests for `-print-ast` don't match whitespace.
2023-07-31 21:27:46 -07:00
Anthony Latsis
7f6d3bcd41 ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it 2023-05-13 02:55:49 +03:00
Rintaro Ishizaki
1cfffb8094 [CodeSynthesis] Improve synthesized Decodable.init(from:) for enums
Since this implementation is exposed to users, we want to make it nice.

* Don't use 'unsafelyUnwrapped' which is usually not recommended to use
* Don't access 'container.allKeys' multiple times as it's a computed
  property

rdar://89150202
2022-03-08 15:56:22 -08:00
Louis D'hauwe
5d36507a2f [Refactoring] Add Codable refactoring action
Inserts the synthesized implementation.
As part of this, fix some ASTPrinter bugs.

rdar://87904700
2022-02-02 14:14:23 -08:00