From 29b23e79f32791e456a5b4a453277f0f0b3e984d Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Mon, 5 Oct 2020 11:09:27 +0200 Subject: [PATCH] Register EXPRESSION_CODE_FRAGMENT, BLOCK_CODE_FRAGMENT in KtStubElementTypes Stubbed type has to be register earlier (see IStubFileElementType#checkNotInstantiatedTooLate) Relates to ^KT-28732 --- compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java | 4 ++-- .../kotlin/psi/stubs/elements/KtStubElementTypes.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java index 47e5e470581..a6d8340ef7e 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/psi/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -161,6 +161,6 @@ public interface KtNodeTypes { IElementType SCRIPT = KtStubElementTypes.SCRIPT; IFileElementType TYPE_CODE_FRAGMENT = KtStubElementTypes.TYPE_CODE_FRAGMENT; - IFileElementType EXPRESSION_CODE_FRAGMENT = new KtExpressionCodeFragmentType(); - IFileElementType BLOCK_CODE_FRAGMENT = new KtBlockCodeFragmentType(); + IFileElementType EXPRESSION_CODE_FRAGMENT = KtStubElementTypes.EXPRESSION_CODE_FRAGMENT; + IFileElementType BLOCK_CODE_FRAGMENT = KtStubElementTypes.BLOCK_CODE_FRAGMENT; } 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 0bd3db12f51..6e5d61e95ef 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 @@ -90,6 +90,8 @@ public interface KtStubElementTypes { new KtPlaceHolderStubElementType<>("FUNCTION_TYPE", KtFunctionType.class); KtTypeCodeFragmentType TYPE_CODE_FRAGMENT = new KtTypeCodeFragmentType(); + KtExpressionCodeFragmentType EXPRESSION_CODE_FRAGMENT = new KtExpressionCodeFragmentType(); + KtBlockCodeFragmentType BLOCK_CODE_FRAGMENT = new KtBlockCodeFragmentType(); KtTypeProjectionElementType TYPE_PROJECTION = new KtTypeProjectionElementType("TYPE_PROJECTION");