Support Fragment in android-compiler-plugin

This commit is contained in:
Yan Zhulanow
2015-03-03 17:41:48 +03:00
parent d4184bd51d
commit da8369066b
68 changed files with 1160 additions and 25 deletions
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyBu<caret>
}
// EXIST: MyButton
@@ -0,0 +1,15 @@
<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" >
<view
class="org.my.cool.Button"
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyBu<caret>
}
// EXIST: MyButton
@@ -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>
@@ -0,0 +1,11 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
import kotlinx.android.synthetic.layout1.*
class MyFragment: Fragment() {
val button = log<caret>
}
// EXIST: login, loginButton
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/passwordCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.login<caret>
}
// EXIST: login
@@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -0,0 +1,15 @@
<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" >
<view
class="org.my.cool.Button"
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -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>
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.login<caret>
val button1 = this.loginButton
}
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/passwordCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,13 @@
package com.myapp
import android.app.Fragment
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyFragemnt : Fragment() {
override fun onResume() {}
val button = login<caret>
fun f() = login.toString()
}
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -0,0 +1,15 @@
<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" >
<view
class="org.my.cool.Button"
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -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>
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.login<caret>
val button1 = this.loginButton
}
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/passwordCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,11 @@
package com.myapp
import android.app.Fragment
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyFragment : Fragment() {
override fun onResume() {}
val button = login<caret>
}
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -0,0 +1,15 @@
<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" >
<view
class="org.my.cool.Button"
android:id="@+id/MyButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,9 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.MyButton<caret>
}
@@ -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>
@@ -0,0 +1,10 @@
package com.myapp
import android.app.Fragment
import kotlinx.android.synthetic.layout.*
class MyFragment: Fragment() {
val button = this.login<caret>
val button1 = this.loginButton
}
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,29 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<TextView
android:id="@+id/passwordField"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter your password" />
<EditText
android:id="@+id/passwordCaption"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textPassword" />
<Button
android:id="@+id/loginButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,17 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ItemDetailActivity"
tools:ignore="MergeRootFrame" >
<Button
android:id="@+id/login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in" />
</FrameLayout>
@@ -0,0 +1,11 @@
package com.myapp
import android.app.Fragment
import java.io.File
import kotlinx.android.synthetic.layout.*
public class MyFragment : Fragment() {
override fun onResume() {}
val button = login<caret>
}
@@ -42,21 +42,45 @@ public class AndroidCompletionTestGenerated extends AbstractAndroidCompletionTes
doTest(fileName);
}
@TestMetadata("fqNameInAttrFragment")
public void testFqNameInAttrFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/fqNameInAttrFragment/");
doTest(fileName);
}
@TestMetadata("fqNameInTag")
public void testFqNameInTag() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/fqNameInTag/");
doTest(fileName);
}
@TestMetadata("fqNameInTagFragment")
public void testFqNameInTagFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/fqNameInTagFragment/");
doTest(fileName);
}
@TestMetadata("multiFile")
public void testMultiFile() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/multiFile/");
doTest(fileName);
}
@TestMetadata("multiFileFragment")
public void testMultiFileFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/multiFileFragment/");
doTest(fileName);
}
@TestMetadata("propertiesSimple")
public void testPropertiesSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/propertiesSimple/");
doTest(fileName);
}
@TestMetadata("propertiesSimpleFragment")
public void testPropertiesSimpleFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/completion/propertiesSimpleFragment/");
doTest(fileName);
}
}
@@ -42,18 +42,36 @@ public class AndroidFindUsagesTestGenerated extends AbstractAndroidFindUsagesTes
doTest(fileName);
}
@TestMetadata("fqNameInAttrFragment")
public void testFqNameInAttrFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/fqNameInAttrFragment/");
doTest(fileName);
}
@TestMetadata("fqNameInTag")
public void testFqNameInTag() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/fqNameInTag/");
doTest(fileName);
}
@TestMetadata("fqNameInTagFragment")
public void testFqNameInTagFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/fqNameInTagFragment/");
doTest(fileName);
}
@TestMetadata("multiFile")
public void testMultiFile() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/multiFile/");
doTest(fileName);
}
@TestMetadata("multiFileFragment")
public void testMultiFileFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/multiFileFragment/");
doTest(fileName);
}
@TestMetadata("simple")
public void testSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/simple/");
@@ -65,4 +83,10 @@ public class AndroidFindUsagesTestGenerated extends AbstractAndroidFindUsagesTes
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/wrongIdFormat/");
doTest(fileName);
}
@TestMetadata("simpleFragment")
public void testSimpleFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/findUsages/simpleFragment/");
doTest(fileName);
}
}
@@ -42,21 +42,45 @@ public class AndroidGotoTestGenerated extends AbstractAndroidGotoTest {
doTest(fileName);
}
@TestMetadata("fqNameInAttrFragment")
public void testFqNameInAttrFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/fqNameInAttrFragment/");
doTest(fileName);
}
@TestMetadata("fqNameInTag")
public void testFqNameInTag() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/fqNameInTag/");
doTest(fileName);
}
@TestMetadata("fqNameInTagFragment")
public void testFqNameInTagFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/fqNameInTagFragment/");
doTest(fileName);
}
@TestMetadata("multiFile")
public void testMultiFile() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/multiFile/");
doTest(fileName);
}
@TestMetadata("multiFileFragment")
public void testMultiFileFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/multiFileFragment/");
doTest(fileName);
}
@TestMetadata("simple")
public void testSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/simple/");
doTest(fileName);
}
@TestMetadata("simpleFragment")
public void testSimpleFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/goto/simpleFragment/");
doTest(fileName);
}
}
@@ -42,21 +42,45 @@ public class AndroidRenameTestGenerated extends AbstractAndroidRenameTest {
doTest(fileName);
}
@TestMetadata("fqNameInAttrFragment")
public void testFqNameInAttrFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/fqNameInAttrFragment/");
doTest(fileName);
}
@TestMetadata("fqNameInTag")
public void testFqNameInTag() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/fqNameInTag/");
doTest(fileName);
}
@TestMetadata("fqNameInTagFragment")
public void testFqNameInTagFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/fqNameInTagFragment/");
doTest(fileName);
}
@TestMetadata("multiFile")
public void testMultiFile() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/multiFile/");
doTest(fileName);
}
@TestMetadata("multiFileFragment")
public void testMultiFileFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/multiFileFragment/");
doTest(fileName);
}
@TestMetadata("simple")
public void testSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/simple/");
doTest(fileName);
}
@TestMetadata("simpleFragment")
public void testSimpleFragment() throws Exception {
String fileName = JetTestUtils.navigationMetadata("plugins/android-idea-plugin/testData/android/rename/simpleFragment/");
doTest(fileName);
}
}