Save runtime type evaluator to userdata of codeFragment

This commit is contained in:
Natalia Ukhorskaya
2014-11-27 16:20:56 +03:00
parent deb80bc3ad
commit 73e71543c6
2 changed files with 40 additions and 2 deletions
@@ -25,6 +25,8 @@ import com.intellij.psi.tree.IElementType
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.jet.plugin.JetFileType
import java.util.HashSet
import com.intellij.openapi.util.Key
import org.jetbrains.jet.lang.types.JetType
public abstract class JetCodeFragment(
private val _project: Project,
@@ -119,6 +121,7 @@ public abstract class JetCodeFragment(
class object {
public val IMPORT_SEPARATOR: String = ","
public val RUNTIME_TYPE_EVALUATOR: Key<Function1<JetExpression, JetType?>> = Key.create("RUNTIME_TYPE_EVALUATOR")
public fun getImportsForElement(elementAtCaret: PsiElement): String {
val containingFile = elementAtCaret.getContainingFile()