Read action added in Android plugins

This commit is contained in:
Andrey Breslav
2014-10-01 16:38:06 +04:00
committed by Yan Zhulanow
parent e9e96657c3
commit 562b563e7e
2 changed files with 7 additions and 2 deletions
@@ -24,6 +24,8 @@ import com.intellij.openapi.components.ServiceManager
import com.intellij.psi.PsiField
import com.intellij.psi.PsiClass
import org.jetbrains.jet.utils.emptyOrSingletonList
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.util.Computable
trait AndroidResource
@@ -49,7 +51,9 @@ fun isAndroidSyntheticFile(f: PsiFile?): Boolean {
}
public fun isAndroidSyntheticElement(element: PsiElement?): Boolean {
return isAndroidSyntheticFile(element?.getContainingFile())
return isAndroidSyntheticFile(ApplicationManager.getApplication()!!.runReadAction(Computable {
element?.getContainingFile()
}))
}
public fun isRClassField(element: PsiElement): Boolean {