use of com.intellij.lang.properties.parsing.PropertyListStubElementType in project intellij-community by JetBrains.
the class PropertiesRootBlock method buildChildren.
@Override
protected List<Block> buildChildren() {
final List<Block> result = new ArrayList<>();
ASTNode child = myNode.getFirstChildNode();
while (child != null) {
if (!(child instanceof PsiWhiteSpace)) {
if (child.getElementType() instanceof PropertyListStubElementType) {
ASTNode propertyNode = child.getFirstChildNode();
while (propertyNode != null) {
if (propertyNode.getElementType() instanceof PropertyStubElementType) {
collectPropertyBlock(propertyNode, result);
} else if (PropertiesTokenTypes.END_OF_LINE_COMMENT.equals(propertyNode.getElementType()) || PropertiesTokenTypes.BAD_CHARACTER.equals(propertyNode.getElementType())) {
result.add(new PropertyBlock(propertyNode, null));
}
propertyNode = propertyNode.getTreeNext();
}
} else if (PropertiesTokenTypes.BAD_CHARACTER.equals(child.getElementType())) {
result.add(new PropertyBlock(child, null));
}
}
if (PropertiesTokenTypes.END_OF_LINE_COMMENT.equals(child.getElementType())) {
result.add(new PropertyBlock(child, null));
}
child = child.getTreeNext();
}
return result;
}
Aggregations