From af08e4121d57967284c335ad810ffbf597b3e173 Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Mon, 28 Nov 2022 13:19:22 +0100 Subject: [PATCH] Fix fragment element types class hierarchy. They must not extend `IStubFileElementType`. #KT-55160 Fixed --- .../kotlin/psi/KtBlockCodeFragmentType.java | 13 ++++--------- .../kotlin/psi/KtExpressionCodeFragmentType.java | 13 ++++--------- .../kotlin/psi/KtTypeCodeFragmentType.java | 13 ++++--------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtBlockCodeFragmentType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtBlockCodeFragmentType.java index fe57dbba5c3..09355e5d488 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtBlockCodeFragmentType.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtBlockCodeFragmentType.java @@ -22,21 +22,16 @@ import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiBuilderFactory; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; +import com.intellij.psi.impl.source.tree.ICodeFragmentElementType; import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.idea.KotlinLanguage; import org.jetbrains.kotlin.parsing.KotlinParser; -import org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType; -public class KtBlockCodeFragmentType extends KtFileElementType { +public class KtBlockCodeFragmentType extends ICodeFragmentElementType { private static final String NAME = "kotlin.BLOCK_CODE_FRAGMENT"; public KtBlockCodeFragmentType() { - super(NAME); - } - - @NotNull - @Override - public String getExternalId() { - return NAME; + super(NAME, KotlinLanguage.INSTANCE); } @Override diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtExpressionCodeFragmentType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtExpressionCodeFragmentType.java index b562e239110..dd8224d87ea 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtExpressionCodeFragmentType.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtExpressionCodeFragmentType.java @@ -22,21 +22,16 @@ import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiBuilderFactory; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; +import com.intellij.psi.impl.source.tree.ICodeFragmentElementType; import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.idea.KotlinLanguage; import org.jetbrains.kotlin.parsing.KotlinParser; -import org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType; -public class KtExpressionCodeFragmentType extends KtFileElementType { +public class KtExpressionCodeFragmentType extends ICodeFragmentElementType { private static final String NAME = "kotlin.EXPRESSION_CODE_FRAGMENT"; public KtExpressionCodeFragmentType() { - super(NAME); - } - - @NotNull - @Override - public String getExternalId() { - return NAME; + super(NAME, KotlinLanguage.INSTANCE); } @Override diff --git a/compiler/psi/src/org/jetbrains/kotlin/psi/KtTypeCodeFragmentType.java b/compiler/psi/src/org/jetbrains/kotlin/psi/KtTypeCodeFragmentType.java index 8a450760088..4f98c1f2ff7 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/psi/KtTypeCodeFragmentType.java +++ b/compiler/psi/src/org/jetbrains/kotlin/psi/KtTypeCodeFragmentType.java @@ -22,21 +22,16 @@ import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiBuilderFactory; import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; +import com.intellij.psi.impl.source.tree.ICodeFragmentElementType; import org.jetbrains.annotations.NotNull; +import org.jetbrains.kotlin.idea.KotlinLanguage; import org.jetbrains.kotlin.parsing.KotlinParser; -import org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType; -public class KtTypeCodeFragmentType extends KtFileElementType { +public class KtTypeCodeFragmentType extends ICodeFragmentElementType { private static final String NAME = "kotlin.TYPE_CODE_FRAGMENT"; public KtTypeCodeFragmentType() { - super(NAME); - } - - @NotNull - @Override - public String getExternalId() { - return NAME; + super(NAME, KotlinLanguage.INSTANCE); } @Override