mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use proper element type for building stubs in LightStubBuilder
This commit is contained in:
@@ -22,10 +22,10 @@ import com.intellij.openapi.fileTypes.FileType;
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.StubBuilder;
|
||||
import com.intellij.psi.impl.source.PsiFileImpl;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.tree.IFileElementType;
|
||||
import com.intellij.psi.tree.ILightStubFileElementType;
|
||||
import com.intellij.psi.tree.IStubFileElementType;
|
||||
import com.intellij.util.containers.Stack;
|
||||
import gnu.trove.TIntStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -45,10 +45,10 @@ public class LightStubBuilder implements StubBuilder {
|
||||
LOG.error("File is not of LanguageFileType: " + fileType + ", " + file);
|
||||
return null;
|
||||
}
|
||||
Language language = ((LanguageFileType)fileType).getLanguage();
|
||||
final IFileElementType contentType = LanguageParserDefinitions.INSTANCE.forLanguage(language).getFileNodeType();
|
||||
if (!(contentType instanceof IStubFileElementType)) {
|
||||
LOG.error("File is not of IStubFileElementType: " + contentType + ", " + file);
|
||||
assert file instanceof PsiFileImpl;
|
||||
final IFileElementType contentType = ((PsiFileImpl)file).getElementTypeForStubBuilder();
|
||||
if (contentType == null) {
|
||||
LOG.error("File is not of IStubFileElementType: " + file);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user