[Aync Refactoring] Better handle comment trailing whitespace

Use `getCommentRange` to trim off the comment's
trailing whitespace, avoiding outputting
extraneous empty lines.

rdar://82072147
This commit is contained in:
Hamish Knight
2021-09-03 16:36:33 +01:00
parent dc60996f89
commit 9b493970aa
5 changed files with 22 additions and 30 deletions

View File

@@ -835,7 +835,6 @@ func testPreserveComments2() {
// PRESERVE-COMMENTS-ERROR-NEXT: // f
// PRESERVE-COMMENTS-ERROR-NEXT: print("fun")
// PRESERVE-COMMENTS-ERROR-NEXT: // g
// PRESERVE-COMMENTS-ERROR-NEXT: {{ }}
// PRESERVE-COMMENTS-ERROR-NEXT: }
// RUN: %refactor -convert-to-async -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=PRESERVE-TRAILING-COMMENT-FN %s