Search in sources :

Example 6 with PsiJavaFileStubImpl

use of com.intellij.psi.impl.java.stubs.impl.PsiJavaFileStubImpl in project intellij-community by JetBrains.

the class GroovyTraitMethodsFileIndex method index.

private static PsiJavaFileStub index(VirtualFile file, byte[] content) {
    try {
        PsiJavaFileStub root = new PsiJavaFileStubImpl("", true);
        new ClassReader(content).accept(new GrTraitMethodVisitor(file, root), EMPTY_ATTRIBUTES, ClassReader.SKIP_CODE);
        return root;
    } catch (Exception e) {
        LOG.info(file.getPath(), e);
        return null;
    }
}
Also used : PsiJavaFileStubImpl(com.intellij.psi.impl.java.stubs.impl.PsiJavaFileStubImpl) PsiJavaFileStub(com.intellij.psi.impl.java.stubs.PsiJavaFileStub) SerializerNotFoundException(com.intellij.psi.stubs.SerializerNotFoundException) IOException(java.io.IOException)

Aggregations

PsiJavaFileStubImpl (com.intellij.psi.impl.java.stubs.impl.PsiJavaFileStubImpl)6 PsiJavaFileStub (com.intellij.psi.impl.java.stubs.PsiJavaFileStub)3 IOException (java.io.IOException)3 NotNull (org.jetbrains.annotations.NotNull)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 Nullable (org.jetbrains.annotations.Nullable)2 ClassReader (org.jetbrains.org.objectweb.asm.ClassReader)2 AnnotationUtil (com.intellij.codeInsight.AnnotationUtil)1 PluginException (com.intellij.diagnostic.PluginException)1 LighterASTNode (com.intellij.lang.LighterASTNode)1 Logger (com.intellij.openapi.diagnostic.Logger)1 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 Ref (com.intellij.openapi.util.Ref)1 LanguageLevel (com.intellij.pom.java.LanguageLevel)1 com.intellij.psi (com.intellij.psi)1 PsiJavaFile (com.intellij.psi.PsiJavaFile)1 ABSTRACT (com.intellij.psi.PsiModifier.ABSTRACT)1 ClsClassImpl (com.intellij.psi.impl.compiled.ClsClassImpl)1 InnerClassSourceStrategy (com.intellij.psi.impl.compiled.InnerClassSourceStrategy)1 StubBuildingVisitor (com.intellij.psi.impl.compiled.StubBuildingVisitor)1