[FE] Remove dependecy on :core:descriptors from :compiler:psi
This commit is contained in:
committed by
TeamCityServer
parent
1d6b4d1d3c
commit
00c60bf569
@@ -13,7 +13,7 @@ dependencies {
|
||||
val compile by configurations
|
||||
val compileOnly by configurations
|
||||
|
||||
compile(project(":core:descriptors"))
|
||||
compile(project(":core:compiler.common"))
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":compiler:frontend.common"))
|
||||
compile(project(":kotlin-script-runtime"))
|
||||
|
||||
@@ -26,10 +26,8 @@ import com.intellij.psi.impl.source.tree.FileElement
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.psi.tree.IElementType
|
||||
import com.intellij.testFramework.LightVirtualFile
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import java.util.*
|
||||
|
||||
abstract class KtCodeFragment(
|
||||
@@ -195,11 +193,9 @@ abstract class KtCodeFragment(
|
||||
|
||||
companion object {
|
||||
const val IMPORT_SEPARATOR: String = ","
|
||||
val RUNTIME_TYPE_EVALUATOR: Key<Function1<KtExpression, KotlinType?>> = Key.create("RUNTIME_TYPE_EVALUATOR")
|
||||
|
||||
val FAKE_CONTEXT_FOR_JAVA_FILE: Key<Function0<KtElement>> = Key.create("FAKE_CONTEXT_FOR_JAVA_FILE")
|
||||
|
||||
private val LOG = Logger.getInstance(KtCodeFragment::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
var KtCodeFragment.externalDescriptors: List<DeclarationDescriptor>? by CopyablePsiUserDataProperty(Key.create("EXTERNAL_DESCRIPTORS"))
|
||||
@@ -9,11 +9,10 @@ import com.intellij.lang.ASTNode
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getChildOfType
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinContractEffectStub
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
import org.jetbrains.kotlin.types.checker.findCorrespondingSupertype
|
||||
|
||||
class KtContractEffect: KtElementImplStub<KotlinContractEffectStub> {
|
||||
constructor(node: ASTNode): super(node)
|
||||
constructor(stub: KotlinContractEffectStub): super(stub, KtStubElementTypes.CONTRACT_EFFECT)
|
||||
}
|
||||
|
||||
fun KtContractEffect.getExpression(): KtExpression = getChildOfType()!!
|
||||
fun KtContractEffect.getExpression(): KtExpression = getChildOfType()!!
|
||||
|
||||
@@ -12,8 +12,6 @@ import com.intellij.psi.*
|
||||
import com.intellij.psi.stubs.StubElement
|
||||
import com.intellij.psi.tree.TokenSet
|
||||
import org.jetbrains.kotlin.KtNodeTypes
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
import org.jetbrains.kotlin.lexer.KotlinLexer
|
||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
@@ -664,16 +662,6 @@ fun isTopLevelInFileOrScript(element: PsiElement): Boolean {
|
||||
}
|
||||
}
|
||||
|
||||
fun KtModifierKeywordToken.toVisibility(): DescriptorVisibility {
|
||||
return when (this) {
|
||||
KtTokens.PUBLIC_KEYWORD -> DescriptorVisibilities.PUBLIC
|
||||
KtTokens.PRIVATE_KEYWORD -> DescriptorVisibilities.PRIVATE
|
||||
KtTokens.PROTECTED_KEYWORD -> DescriptorVisibilities.PROTECTED
|
||||
KtTokens.INTERNAL_KEYWORD -> DescriptorVisibilities.INTERNAL
|
||||
else -> throw IllegalArgumentException("Unknown visibility modifier:$this")
|
||||
}
|
||||
}
|
||||
|
||||
fun KtFile.getFileOrScriptDeclarations() = if (isScript()) script!!.declarations else declarations
|
||||
|
||||
fun KtExpression.getBinaryWithTypeParent(): KtBinaryExpressionWithTypeRHS? {
|
||||
|
||||
Reference in New Issue
Block a user