parent
3bd730355e
commit
76fba19c0b
@ -36,14 +36,29 @@ export class XmlTreeDataProvider implements TreeDataProvider<any> {
|
||||
treeItem.label = `${element.localName} = "${element.nodeValue}"`;
|
||||
}
|
||||
|
||||
if (this._isElement(element) && this._getChildAttributeArray(<Element>element).length > 0) {
|
||||
else {
|
||||
const childAttributes = this._getChildAttributeArray(<Element>element);
|
||||
const childElements = this._getChildElementArray(<Element>element);
|
||||
const totalChildren = (childAttributes.length + childElements.length);
|
||||
|
||||
if (totalChildren > 0) {
|
||||
treeItem.label += " (";
|
||||
|
||||
if (childAttributes.length > 0) {
|
||||
treeItem.label += `attributes: ${childAttributes.length}, `;
|
||||
treeItem.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
||||
}
|
||||
|
||||
if (this._isElement(element) && this._getChildElementArray(<Element>element).length > 0) {
|
||||
if (childElements.length > 0) {
|
||||
treeItem.label += `children: ${childElements.length}, `;
|
||||
treeItem.collapsibleState = TreeItemCollapsibleState.Collapsed;
|
||||
}
|
||||
|
||||
treeItem.label = treeItem.label.substr(0, treeItem.label.length - 2);
|
||||
treeItem.label += ")";
|
||||
}
|
||||
}
|
||||
|
||||
treeItem.command = {
|
||||
command: constants.nativeCommands.revealLine,
|
||||
title: "",
|
||||
|
Loading…
Reference in New Issue
Block a user