com.intellij.extapi.psi.ASTWrapperPsiElement Java Examples

The following examples show how to use com.intellij.extapi.psi.ASTWrapperPsiElement. 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: TokenSpecNode.java    From intellij-plugin-v4 with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public PsiElement createElement(ASTNode node) {
	ASTNode idList = node.getTreeParent();
	ASTNode parent = null;

	if (idList != null) {
		parent = idList.getTreeParent();
	}
	if (parent != null) {
		if (parent.getElementType() == ANTLRv4TokenTypes.RULE_ELEMENT_TYPES.get(ANTLRv4Parser.RULE_tokensSpec)) {
			return new TokenSpecNode(node);
		} else if (parent.getElementType() == ANTLRv4TokenTypes.RULE_ELEMENT_TYPES.get(ANTLRv4Parser.RULE_channelsSpec)) {
			return new ChannelSpecNode(node);
		}
	}

	return new ASTWrapperPsiElement(node);
}
 
Example #2
Source File: ProjectViewParserDefinition.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public PsiElement createElement(ASTNode node) {
  IElementType type = node.getElementType();
  if (type instanceof ProjectViewElementType) {
    return ((ProjectViewElementType) type).createElement(node);
  }
  return new ASTWrapperPsiElement(node);
}
 
Example #3
Source File: BuildParserDefinition.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public PsiElement createElement(ASTNode node) {
  IElementType type = node.getElementType();
  if (type instanceof BuildElementType) {
    return ((BuildElementType) type).createElement(node);
  }
  return new ASTWrapperPsiElement(node);
}
 
Example #4
Source File: ShaderLabParserDefinition.java    From consulo-unity3d with Apache License 2.0 5 votes vote down vote up
@Nonnull
@Override
public PsiElement createElement(ASTNode node)
{
	System.out.println(node.getElementType());
	return new ASTWrapperPsiElement(node);
}
 
Example #5
Source File: CSharpDocParserDefinition.java    From consulo-csharp with Apache License 2.0 5 votes vote down vote up
@RequiredReadAction
@Nonnull
@Override
public PsiElement createElement(@Nonnull ASTNode node)
{
	return new ASTWrapperPsiElement(node);
}
 
Example #6
Source File: CGParserDefinition.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public PsiElement createElement(ASTNode node)
{
	return new ASTWrapperPsiElement(node);
}
 
Example #7
Source File: HamletParserDefinition.java    From intellij-haskforce with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public PsiElement createElement(ASTNode node) {
    return new ASTWrapperPsiElement(node);
}
 
Example #8
Source File: CSharpParserDefinition.java    From consulo-csharp with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public PsiElement createElement(ASTNode astNode)
{
	return new ASTWrapperPsiElement(astNode);
}
 
Example #9
Source File: SandParsingDefinition.java    From consulo with Apache License 2.0 4 votes vote down vote up
@RequiredReadAction
@Nonnull
@Override
public PsiElement createElement(@Nonnull ASTNode node) {
  return new ASTWrapperPsiElement(node);
}