diff --git a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java index 8b775bdac5e..3696e7dc73b 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -64,6 +64,8 @@ public interface KtNodeTypes { IElementType TYPE_ARGUMENT_LIST = KtStubElementTypes.TYPE_ARGUMENT_LIST; IElementType VALUE_ARGUMENT_LIST = KtStubElementTypes.VALUE_ARGUMENT_LIST; IElementType VALUE_ARGUMENT = KtStubElementTypes.VALUE_ARGUMENT; + IElementType CONTRACT_EFFECT_LIST = KtStubElementTypes.CONTRACT_EFFECT_LIST; + IElementType CONTRACT_EFFECT = KtStubElementTypes.CONTRACT_EFFECT; IElementType LAMBDA_ARGUMENT = KtStubElementTypes.LAMBDA_ARGUMENT; IElementType VALUE_ARGUMENT_NAME = KtStubElementTypes.VALUE_ARGUMENT_NAME; IElementType TYPE_REFERENCE = KtStubElementTypes.TYPE_REFERENCE; diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffect.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffect.kt new file mode 100644 index 00000000000..0a06a0ec568 --- /dev/null +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffect.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.psi + +import com.intellij.lang.ASTNode +import org.jetbrains.kotlin.psi.stubs.KotlinContractEffectStub +import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes + +//class KtContractEffect(node: ASTNode) : KtDeclarationImpl(node) { +// +//} + +class KtContractEffect: KtElementImplStub { // TODO: check constructors + public constructor(node: ASTNode): super(node) + public constructor(stub: KotlinContractEffectStub): super(stub, KtStubElementTypes.CONTRACT_EFFECT) +} \ No newline at end of file diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffectList.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffectList.kt new file mode 100644 index 00000000000..30297b0092c --- /dev/null +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtContractEffectList.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.psi + +import com.intellij.lang.ASTNode +import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub +import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes + +//class KtContractEffectList(node: ASTNode): KtDeclarationImpl(node) { +// +//} + +class KtContractEffectList : KtElementImplStub> { + public constructor(node: ASTNode): super(node) + public constructor(stub: KotlinPlaceHolderStub): super(stub, KtStubElementTypes.CONTRACT_EFFECT_LIST) +} \ No newline at end of file diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/StubInterfaces.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/StubInterfaces.kt index 4368d57234e..e910a1b67d9 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/StubInterfaces.kt +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/StubInterfaces.kt @@ -64,6 +64,8 @@ interface KotlinValueArgumentStub : KotlinPlaceHolderStub {} + interface KotlinAnnotationEntryStub : StubElement { fun getShortName(): String? fun hasValueArguments(): Boolean diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectElementType.kt new file mode 100644 index 00000000000..03a4b6e123a --- /dev/null +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectElementType.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.psi.stubs.elements + +import com.intellij.psi.PsiElement +import com.intellij.psi.stubs.StubElement +import com.intellij.psi.stubs.StubInputStream +import com.intellij.psi.stubs.StubOutputStream +import org.jetbrains.kotlin.psi.KtContractEffect +import org.jetbrains.kotlin.psi.stubs.KotlinContractEffectStub +import org.jetbrains.kotlin.psi.stubs.impl.KotlinContractEffectStubImpl + +class KtContractEffectElementType(debugName: String, psiClass: Class) : + KtStubElementType(debugName, psiClass, KotlinContractEffectStub::class.java) { + override fun serialize(stub: KotlinContractEffectStub, dataStream: StubOutputStream) { +// TODO("Not yet implemented") + } + + override fun deserialize(dataStream: StubInputStream, parentStub: StubElement?): KotlinContractEffectStub { +// TODO("Not yet implemented") + return KotlinContractEffectStubImpl(parentStub, this) + } + + override fun createStub(psi: KtContractEffect, parentStub: StubElement?): KotlinContractEffectStub { +// TODO("Not yet implemented") + return KotlinContractEffectStubImpl(parentStub, this) + } +} \ No newline at end of file diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectListElementType.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectListElementType.kt new file mode 100644 index 00000000000..cbd09693690 --- /dev/null +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtContractEffectListElementType.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.psi.stubs.elements + +import com.intellij.lang.ASTNode +import org.jetbrains.kotlin.psi.KtContractEffectList + +class KtContractEffectListElementType(debugName: String) : + KtPlaceHolderStubElementType(debugName, KtContractEffectList::class.java) { +} \ No newline at end of file diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java index 3aae198cdf0..e16e20644d2 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java @@ -107,6 +107,12 @@ public interface KtStubElementTypes { KtValueArgumentElementType VALUE_ARGUMENT = new KtValueArgumentElementType<>("VALUE_ARGUMENT", KtValueArgument.class); + KtPlaceHolderStubElementType CONTRACT_EFFECT_LIST = + new KtContractEffectListElementType("CONTRACT_EFFECT_LIST"); + + KtContractEffectElementType CONTRACT_EFFECT = + new KtContractEffectElementType("CONTRACT_EFFECT", KtContractEffect.class); + KtValueArgumentElementType LAMBDA_ARGUMENT = new KtValueArgumentElementType<>("LAMBDA_ARGUMENT", KtLambdaArgument.class); diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinContractEffectStubImpl.kt b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinContractEffectStubImpl.kt new file mode 100644 index 00000000000..3a49926617d --- /dev/null +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/stubs/impl/KotlinContractEffectStubImpl.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.psi.stubs.impl + +import com.intellij.psi.PsiElement +import com.intellij.psi.stubs.StubElement +import org.jetbrains.kotlin.psi.KtContractEffect +import org.jetbrains.kotlin.psi.stubs.KotlinContractEffectStub +import org.jetbrains.kotlin.psi.stubs.elements.KtContractEffectElementType + +class KotlinContractEffectStubImpl( + parent: StubElement?, + elementType: KtContractEffectElementType +) : KotlinPlaceHolderStubImpl(parent, elementType), KotlinContractEffectStub { +} \ No newline at end of file