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:
-2
@@ -24,8 +24,6 @@ import org.jetbrains.kotlin.load.java.sources.JavaSourceElementFactory
|
||||
import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
|
||||
|
||||
private class JavaSourceElementImpl(override val javaElement: JavaElement) : PsiSourceElement, JavaSourceElement {
|
||||
override fun isKotlinSourceElement(): Boolean = false
|
||||
|
||||
override val psi: PsiElement?
|
||||
get() = (javaElement as JavaElementImpl<*>).getPsi()
|
||||
}
|
||||
|
||||
@@ -20,9 +20,7 @@ import org.jetbrains.kotlin.psi.JetElement
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import com.intellij.psi.PsiElement
|
||||
|
||||
public class KotlinSourceElement(override val psi: JetElement) : PsiSourceElement {
|
||||
override fun isKotlinSourceElement(): Boolean = true
|
||||
}
|
||||
public class KotlinSourceElement(override val psi: JetElement) : PsiSourceElement
|
||||
|
||||
public fun JetElement?.toSourceElement(): SourceElement = if (this == null) SourceElement.NO_SOURCE else KotlinSourceElement(this)
|
||||
|
||||
|
||||
-1
@@ -19,6 +19,5 @@ package org.jetbrains.kotlin.load.kotlin
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
|
||||
public class KotlinJvmBinarySourceElement(public val binaryClass: KotlinJvmBinaryClass) : SourceElement {
|
||||
override fun isKotlinSourceElement(): Boolean = false
|
||||
override fun toString() = javaClass.name + ": " + binaryClass.toString()
|
||||
}
|
||||
|
||||
-2
@@ -23,8 +23,6 @@ import org.jetbrains.kotlin.load.java.structure.reflect.ReflectJavaElement
|
||||
|
||||
public object RuntimeSourceElementFactory : JavaSourceElementFactory {
|
||||
private class RuntimeSourceElement(override val javaElement: ReflectJavaElement) : JavaSourceElement {
|
||||
|
||||
override fun isKotlinSourceElement(): Boolean = false
|
||||
override fun toString() = javaClass.name + ": " + javaElement.toString()
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -18,6 +18,4 @@ package org.jetbrains.kotlin.load.kotlin.reflect
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
|
||||
public class ReflectAnnotationSource(public val annotation: Annotation) : SourceElement {
|
||||
override fun isKotlinSourceElement(): Boolean = false
|
||||
}
|
||||
public class ReflectAnnotationSource(public val annotation: Annotation) : SourceElement
|
||||
|
||||
@@ -16,18 +16,8 @@
|
||||
|
||||
package org.jetbrains.kotlin.descriptors;
|
||||
|
||||
import kotlin.Deprecated;
|
||||
|
||||
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() {
|
||||
@Override
|
||||
public boolean isKotlinSourceElement() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NO_SOURCE";
|
||||
|
||||
Reference in New Issue
Block a user