Closed antigluten closed 2 months ago
Thanks for review, @ahoppen!
Need help with the testToStoredWithReturnStatementAndTrailingCommentOnNewLine
, I have no idea how to handle the trailing trivia that contains comments, so to not break another test
Test: testToStoredWithReturnStatementAndTrailingCommentOnNewLine
let baseline: DeclSyntax = """
var defaultColor: Color {
return Color()
/* some text */
}
"""
let expected: DeclSyntax = """
let defaultColor: Color = Color()
/* some text */
"""
Test: testToStoredWithReturnStatementAndTrailingComment
let baseline: DeclSyntax = """
var defaultColor: Color {
return Color() /* some text */
}
"""
let expected: DeclSyntax = """
let defaultColor: Color = Color() /* some text */
"""
How about adding the trivia of the dropped braces to the initializer?
Ie something like
initializer.leadingTrivia = accessorBlock.leftBrace.leadingTrivia + accessorBlock.leftBrace.trailing + initializer.leadingTrivia
initializer.trailingTrivia += accessorBlock.rightBrace.leadingTrivia + accessorBlock.rightBrace.trailing
@ahoppen, done
@swift-ci Please test
@swift-ci please test
@swift-ci please test windows
@swift-ci Please test Linux
Resolves swiftlang/sourcekit-lsp#1245