Get string entries from stubs (KT-23738)
This commit is contained in:
@@ -23,11 +23,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderWithTextStub;
|
||||
|
||||
public abstract class KtStringTemplateEntry extends KtElementImplStub<KotlinPlaceHolderWithTextStub<? extends KtStringTemplateEntry>> {
|
||||
public static final KtStringTemplateEntry[] EMPTY_ARRAY = new KtStringTemplateEntry[0];
|
||||
|
||||
public KtStringTemplateEntry(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
}
|
||||
|
||||
public KtStringTemplateEntry(@NotNull KotlinPlaceHolderWithTextStub<? extends KtStringTemplateEntry> stub, @NotNull IStubElementType elementType) {
|
||||
public KtStringTemplateEntry(
|
||||
@NotNull KotlinPlaceHolderWithTextStub<? extends KtStringTemplateEntry> stub,
|
||||
@NotNull IStubElementType elementType
|
||||
) {
|
||||
super(stub, elementType);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,16 @@ public class KtStringTemplateExpression extends KtElementImplStub<KotlinPlaceHol
|
||||
return visitor.visitStringTemplateExpression(this, data);
|
||||
}
|
||||
|
||||
private static final TokenSet STRING_ENTRIES_TYPES = TokenSet.create(
|
||||
KtStubElementTypes.LONG_STRING_TEMPLATE_ENTRY,
|
||||
KtStubElementTypes.SHORT_STRING_TEMPLATE_ENTRY,
|
||||
KtStubElementTypes.LITERAL_STRING_TEMPLATE_ENTRY,
|
||||
KtStubElementTypes.ESCAPE_STRING_TEMPLATE_ENTRY
|
||||
);
|
||||
|
||||
@NotNull
|
||||
public KtStringTemplateEntry[] getEntries() {
|
||||
return findChildrenByClass(KtStringTemplateEntry.class);
|
||||
return getStubOrPsiChildren(STRING_ENTRIES_TYPES, KtStringTemplateEntry.EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user