mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When a range is a single expression/statement/decl or part of expression, also return cursor based refactorings for the start of the range. This is a stop gap until the available refactorings are properly fixed to be more lenient in general - the current fix is a little odd as eg. if all of `foo.bar()` is selected, rename will be returned as an available refactoring for `foo`. Still an improvement over completely missing cursor based refactorings, however. Resolves rdar://82060063
19 lines
904 B
Swift
19 lines
904 B
Swift
import Foo
|
|
|
|
func foo1() {
|
|
var derivedObj = FooClassDerived()
|
|
}
|
|
|
|
// REQUIRES: objc_interop
|
|
// RUN: %sourcekitd-test -req=cursor -pos=4:30 -cursor-action %s -- -F %S/Inputs/mock-sdk -I %t.tmp %s | %FileCheck %s -check-prefix=CHECK1
|
|
// RUN: %sourcekitd-test -req=cursor -pos=4:30 -length=3 -cursor-action %s -- -F %S/Inputs/mock-sdk -I %t.tmp %s | %FileCheck %s -check-prefix=CHECK1
|
|
// RUN: %sourcekitd-test -req=cursor -pos=4:20 -length=15 -cursor-action %s -- -F %S/Inputs/mock-sdk -I %t.tmp %s | %FileCheck %s -check-prefix=CHECK1
|
|
// RUN: %sourcekitd-test -req=cursor -pos=4:20 -length=16 -cursor-action %s -- -F %S/Inputs/mock-sdk -I %t.tmp %s | %FileCheck %s -check-prefix=CHECK1
|
|
|
|
// CHECK1: ACTIONS BEGIN
|
|
// CHECK1-NEXT: source.refactoring.kind.rename.global
|
|
// CHECK1-NEXT: Global Rename
|
|
// CHECK1-NEXT: cannot rename a Clang symbol from its Swift reference
|
|
|
|
// REQUIRES: OS=macosx || OS=linux-gnu
|