Add more edge cases

This commit is contained in:
Karan
2026-01-07 03:22:19 +05:30
parent 02737a10d3
commit 2a64797c1a
2 changed files with 66 additions and 15 deletions

View File

@@ -110,9 +110,10 @@ package struct ConvertJSONToCodableStruct: EditRefactoringProvider {
let baseIndentation = getBaseIndentation(from: jsonNode)
let format = BasicFormat(indentationWidth: indentation, initialIndentation: baseIndentation)
let indentedDecls = topLevelObject.asDeclSyntax(name: "JSONValue")
var formattedDecls = topLevelObject.asDeclSyntax(name: "JSONValue")
.formatted(using: format)
.description
formattedDecls.leadingTrivia = []
let indentedDecls = formattedDecls.description
// Render the change into a set of source edits.
switch preflight {