Faster startup avoiding unnecessary class loading
This commit is contained in:
committed by
Vladimir Dolzhenko
parent
f7d0be980b
commit
c853ae49a2
@@ -41,8 +41,8 @@ import org.jetbrains.kotlin.lexer.KtTokens
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtWhenEntry
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtFileElementType
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementType
|
||||
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
|
||||
|
||||
class KotlinParserDefinition : ParserDefinition {
|
||||
|
||||
@@ -50,7 +50,7 @@ class KotlinParserDefinition : ParserDefinition {
|
||||
|
||||
override fun createParser(project: Project): PsiParser = KotlinParser(project)
|
||||
|
||||
override fun getFileNodeType(): IFileElementType = KtStubElementTypes.FILE
|
||||
override fun getFileNodeType(): IFileElementType = KtFileElementType.INSTANCE
|
||||
|
||||
override fun getWhitespaceTokens(): TokenSet = KtTokens.WHITESPACES
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ import java.io.IOException;
|
||||
public class KtFileElementType extends IStubFileElementType<KotlinFileStub> {
|
||||
private static final String NAME = "kotlin.FILE";
|
||||
|
||||
public static KtFileElementType INSTANCE = new KtFileElementType();
|
||||
|
||||
public KtFileElementType() {
|
||||
super(NAME, KotlinLanguage.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.intellij.psi.tree.TokenSet;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
|
||||
public interface KtStubElementTypes {
|
||||
KtFileElementType FILE = new KtFileElementType();
|
||||
KtFileElementType FILE = KtFileElementType.INSTANCE;
|
||||
|
||||
KtClassElementType CLASS = new KtClassElementType("CLASS");
|
||||
KtFunctionElementType FUNCTION = new KtFunctionElementType("FUN");
|
||||
|
||||
Reference in New Issue
Block a user