com.intellij.psi.stubs.DefaultStubBuilder Java Examples

The following examples show how to use com.intellij.psi.stubs.DefaultStubBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RmlFileStubElementType.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@NotNull
@Override
public StubBuilder getBuilder() {
    return new DefaultStubBuilder() {
        @NotNull
        @Override
        protected StubElement createStubForFile(@NotNull PsiFile file) {
            if (file instanceof RmlFile) {
                return new RmlFileStub((RmlFile) file, ((RmlFile) file).isComponent());
            } else if (file instanceof RmlInterfaceFile) {
                return new RmlFileStub((RmlInterfaceFile) file, ((RmlInterfaceFile) file).isComponent());
            }
            return super.createStubForFile(file);
        }
    };
}
 
Example #2
Source File: NASMFileElementType.java    From JetBrains-NASM-Language with MIT License 5 votes vote down vote up
@NotNull
@Override
public StubBuilder getBuilder() {
    return new DefaultStubBuilder() {
        @NotNull
        @Override
        protected StubElement createStubForFile(@NotNull PsiFile file) {
            if (file instanceof NASMFile) {
                return new NASMFileStub((NASMFile)file);
            }
            return super.createStubForFile(file);
        }
    };
}
 
Example #3
Source File: OclFileStubElementType.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@NotNull
@Override
public StubBuilder getBuilder() {
    return new DefaultStubBuilder() {
        @NotNull
        @Override
        protected StubElement createStubForFile(@NotNull PsiFile file) {
            if (file instanceof OclFile) {
                return new OclFileStub((OclFile) file);
            }
            return super.createStubForFile(file);
        }
    };
}
 
Example #4
Source File: FileStub.java    From bamboo-soy with Apache License 2.0 5 votes vote down vote up
@Override
public StubBuilder getBuilder() {
  return new DefaultStubBuilder() {
    @Override
    protected StubElement createStubForFile(@NotNull PsiFile file) {
      return new FileStub((SoyFile) file);
    }
  };
}
 
Example #5
Source File: FileStub.java    From protobuf-jetbrains-plugin with Apache License 2.0 5 votes vote down vote up
@Override
public StubBuilder getBuilder() {
    return new DefaultStubBuilder() {
        @Override
        protected StubElement createStubForFile(@NotNull PsiFile file) {
            return new FileStub((ProtoPsiFileRoot) file);
        }
    };
}
 
Example #6
Source File: HaskellFileStubElementType.java    From intellij-haskforce with Apache License 2.0 5 votes vote down vote up
@Override
public StubBuilder getBuilder() {
    return new DefaultStubBuilder() {
        @NotNull
        @Override
        protected StubElement createStubForFile(@NotNull PsiFile file) {
            if (file instanceof HaskellFile) {
                return new HaskellFileStub((HaskellFile)file);
            }
            return super.createStubForFile(file);
        }
    };
}
 
Example #7
Source File: CSharpFileStubElementType.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@Override
public StubBuilder getBuilder()
{
	return new DefaultStubBuilder()
	{
		@Nonnull
		@Override
		protected StubElement createStubForFile(@Nonnull PsiFile file)
		{
			if(file instanceof CSharpFileImpl)
			{
				return new CSharpFileStub((CSharpFileImpl) file);
			}
			return super.createStubForFile(file);
		}

		@Override
		public boolean skipChildProcessingWhenBuildingStubs(@Nonnull ASTNode parent, @Nonnull ASTNode node)
		{
			// skip any lazy parseable elements, like preprocessors or code blocks etc
			if(node.getElementType() instanceof ILazyParseableElementType)
			{
				return true;
			}
			return false;
		}
	};
}