[sourcekitd-test] Support refactoring based on a byte offset location

If an offset position but no line/column combination is given to `sourcekitd-test` when requesting a refactoring action, compute the line/column from the offset.
This commit is contained in:
Alex Hoppen
2021-06-08 11:55:50 +02:00
parent daa8aacd64
commit 80bfcf5dad
2 changed files with 22 additions and 10 deletions

View File

@@ -129,6 +129,7 @@ func hasCallToAsyncAlternative() {
// CHECK1-NEXT: ACTIONS END
// RUN: %sourcekitd-test -req=cursor -pos=1:16 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK2
// RUN: %sourcekitd-test -req=cursor -offset=16 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK2
// RUN: %sourcekitd-test -req=cursor -pos=12:8 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK3
// RUN: %sourcekitd-test -req=cursor -pos=21:5 -cursor-action %s -- %s | %FileCheck %s -check-prefix=CHECK4