Fix extract refactoring for android extensions declarations (KT-11048)
Allow any target declarations in marking references. Otherwise conflicts for references resolved to xml are not considered broken. This also fix evaluate for extension fields. #KT-11048 Fixed
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ItemDetailActivity"
|
||||
tools:ignore="MergeRootFrame" >
|
||||
|
||||
<org.my.cool.Button
|
||||
android:id="@+id/MyButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Sign in" />
|
||||
|
||||
</FrameLayout>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// SUGGESTED_NAMES: view, getButton
|
||||
// SUGGESTED_RETURN_TYPES: android.view.View?, android.view.View
|
||||
// PARAM_DESCRIPTOR: public final class MyActivity : android.app.Activity defined in test in file toTopLevelFun.kt
|
||||
// PARAM_TYPES: test.MyActivity, android.app.Activity
|
||||
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
// SIBLING:
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun test() {
|
||||
val button = <selection>MyButton</selection>
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// SUGGESTED_NAMES: view, getButton
|
||||
// SUGGESTED_RETURN_TYPES: android.view.View?, android.view.View
|
||||
// PARAM_DESCRIPTOR: public final class MyActivity : android.app.Activity defined in test in file toTopLevelFun.kt
|
||||
// PARAM_TYPES: test.MyActivity, android.app.Activity
|
||||
|
||||
package test
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import kotlinx.android.synthetic.main.layout.*
|
||||
|
||||
// SIBLING:
|
||||
|
||||
class MyActivity: Activity() {
|
||||
fun test() {
|
||||
val button = view()
|
||||
}
|
||||
}
|
||||
|
||||
private fun MyActivity.view(): View? = MyButton
|
||||
Reference in New Issue
Block a user