本文整理汇总了Java中com.intellij.psi.StubBuilder类的典型用法代码示例。如果您正苦于以下问题:Java StubBuilder类的具体用法?Java StubBuilder怎么用?Java StubBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StubBuilder类属于com.intellij.psi包,在下文中一共展示了StubBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doTest
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
public void doTest() throws Exception {
final List<String> data = TestUtils.readInput(getTestDataPath() + "/" + getTestName(true) + ".test");
String fileText = data.get(0);
PsiFile psiFile = TestUtils.createPseudoPhysicalGroovyFile(getProject(), fileText);
ASTNode node = psiFile.getNode();
Assert.assertNotNull(node);
IElementType type = node.getElementType();
Assert.assertTrue(type instanceof IStubFileElementType);
IStubFileElementType stubFileType = (IStubFileElementType) type;
StubBuilder builder = stubFileType.getBuilder();
StubElement element = builder.buildStubTree(psiFile);
StringBuffer buffer = new StringBuffer();
getStubsTreeImpl(element, buffer, "");
String stubTree = buffer.toString().trim();
assertEquals(data.get(1), stubTree);
}
示例2: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder()
{
return new DefaultStubBuilder()
{
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file)
{
if(file instanceof CSharpFileImpl)
{
return new CSharpFileStub((CSharpFileImpl) file);
}
return super.createStubForFile(file);
}
};
}
示例3: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder()
{
return new DefaultStubBuilder()
{
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file)
{
if(file instanceof MsilFile)
{
return new MsilFileStub((MsilFile) file);
}
return super.createStubForFile(file);
}
};
}
示例4: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder()
{
return new DefaultStubBuilder()
{
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file)
{
if(file instanceof JSFile)
{
return new JSFileStubImpl((JSFile) file, file.getName());
}
return super.createStubForFile(file);
}
};
}
示例5: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
if (file instanceof RmlFile) {
return new RmlFileStub((RmlFile) file);
}
return super.createStubForFile(file);
}
};
}
示例6: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
return new FileStub((SoyFile) file);
}
};
}
示例7: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
return new FusionFileStub((FusionFile) file);
}
};
}
示例8: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
return new FileStub((ProtoPsiFileRoot) file);
}
};
}
示例9: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@NotNull
@Override
protected StubElement createStubForFile(@NotNull final PsiFile file) {
if (file instanceof GroovyFile) {
return new GrFileStub((GroovyFile)file);
}
return super.createStubForFile(file);
}
};
}
示例10: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
@NotNull
@Override
protected StubElement createStubForFile(@NotNull PsiFile file) {
if (file instanceof SchemaFile) {
SchemaFile schemaFile = (SchemaFile) file;
Qn namespace = NamespaceManager.getNamespace(schemaFile);
return new SchemaFileStubImpl(schemaFile, StringRef.fromNullableString(namespace == null ? null : namespace.toString()));
} else return super.createStubForFile(file);
}
};
}
示例11: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@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);
}
};
}
示例12: skipNode
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static boolean skipNode(@NotNull StubBuilder builder, @NotNull ASTNode parent, @NotNull ASTNode node) {
if (builder instanceof DefaultStubBuilder) {
return ((DefaultStubBuilder)builder).skipChildProcessingWhenBuildingStubs(parent, node);
}
else if (builder instanceof LightStubBuilder) {
return ((LightStubBuilder)builder).skipChildProcessingWhenBuildingStubs(parent, node);
}
else {
return builder.skipChildProcessingWhenBuildingStubs(parent, node.getElementType());
}
}
示例13: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
public StubBuilder getBuilder() {
return new DefaultStubBuilder() {
protected StubElement createStubForFile(@NotNull final PsiFile file) {
if (file instanceof GroovyFile) {
return new GrFileStub((GroovyFile)file);
}
return super.createStubForFile(file);
}
};
}
示例14: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
@Override
public StubBuilder getBuilder() {
return new LuaFileStubBuilder();
}
示例15: getBuilder
import com.intellij.psi.StubBuilder; //导入依赖的package包/类
public StubBuilder getBuilder() {
return new DefaultStubBuilder();
}