Revert "add isKotlinSourceElement method to Source interface in order to recognize kotlin source elements during compilation"

This reverts commit c342f6870a.
This commit is contained in:
Michael Nedzelsky
2015-09-23 17:37:12 +03:00
parent 031a42ccf4
commit 2c952dcc22
6 changed files with 2 additions and 21 deletions
@@ -24,8 +24,6 @@ import org.jetbrains.kotlin.load.java.sources.JavaSourceElementFactory
import org.jetbrains.kotlin.load.java.sources.JavaSourceElement import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
private class JavaSourceElementImpl(override val javaElement: JavaElement) : PsiSourceElement, JavaSourceElement { private class JavaSourceElementImpl(override val javaElement: JavaElement) : PsiSourceElement, JavaSourceElement {
override fun isKotlinSourceElement(): Boolean = false
override val psi: PsiElement? override val psi: PsiElement?
get() = (javaElement as JavaElementImpl<*>).getPsi() get() = (javaElement as JavaElementImpl<*>).getPsi()
} }
@@ -20,9 +20,7 @@ import org.jetbrains.kotlin.psi.JetElement
import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.descriptors.SourceElement
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
public class KotlinSourceElement(override val psi: JetElement) : PsiSourceElement { public class KotlinSourceElement(override val psi: JetElement) : PsiSourceElement
override fun isKotlinSourceElement(): Boolean = true
}
public fun JetElement?.toSourceElement(): SourceElement = if (this == null) SourceElement.NO_SOURCE else KotlinSourceElement(this) public fun JetElement?.toSourceElement(): SourceElement = if (this == null) SourceElement.NO_SOURCE else KotlinSourceElement(this)
@@ -19,6 +19,5 @@ package org.jetbrains.kotlin.load.kotlin
import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.descriptors.SourceElement
public class KotlinJvmBinarySourceElement(public val binaryClass: KotlinJvmBinaryClass) : SourceElement { public class KotlinJvmBinarySourceElement(public val binaryClass: KotlinJvmBinaryClass) : SourceElement {
override fun isKotlinSourceElement(): Boolean = false
override fun toString() = javaClass.name + ": " + binaryClass.toString() override fun toString() = javaClass.name + ": " + binaryClass.toString()
} }
@@ -23,8 +23,6 @@ import org.jetbrains.kotlin.load.java.structure.reflect.ReflectJavaElement
public object RuntimeSourceElementFactory : JavaSourceElementFactory { public object RuntimeSourceElementFactory : JavaSourceElementFactory {
private class RuntimeSourceElement(override val javaElement: ReflectJavaElement) : JavaSourceElement { private class RuntimeSourceElement(override val javaElement: ReflectJavaElement) : JavaSourceElement {
override fun isKotlinSourceElement(): Boolean = false
override fun toString() = javaClass.name + ": " + javaElement.toString() override fun toString() = javaClass.name + ": " + javaElement.toString()
} }
@@ -18,6 +18,4 @@ package org.jetbrains.kotlin.load.kotlin.reflect
import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.descriptors.SourceElement
public class ReflectAnnotationSource(public val annotation: Annotation) : SourceElement { public class ReflectAnnotationSource(public val annotation: Annotation) : SourceElement
override fun isKotlinSourceElement(): Boolean = false
}
@@ -16,18 +16,8 @@
package org.jetbrains.kotlin.descriptors; package org.jetbrains.kotlin.descriptors;
import kotlin.Deprecated;
public interface SourceElement { public interface SourceElement {
@Deprecated("This is a hack in order to preliminary support internal visibility in multi-module projects")
boolean isKotlinSourceElement();
SourceElement NO_SOURCE = new SourceElement() { SourceElement NO_SOURCE = new SourceElement() {
@Override
public boolean isKotlinSourceElement() {
return false;
}
@Override @Override
public String toString() { public String toString() {
return "NO_SOURCE"; return "NO_SOURCE";