This commit is contained in:
Kris De Volder
2019-05-02 12:00:01 -07:00
parent 110ec90e44
commit 9866a4edb2

View File

@@ -75,11 +75,13 @@ public class TypeBasedYamlHierarchicalSymbolHandler implements HierarchicalDocum
IDocument doc = currentAst.getDocument();
if (namePath!=null) {
Node nameNode = namePath.traverseNode(node);
return new DocumentSymbol(NodeUtil.asScalar(nameNode), kind,
NodeUtil.region(doc, node).asRange(),
NodeUtil.region(doc, nameNode).asRange(),
detail
);
if (nameNode!=null) {
return new DocumentSymbol(NodeUtil.asScalar(nameNode), kind,
NodeUtil.region(doc, node).asRange(),
NodeUtil.region(doc, nameNode).asRange(),
detail
);
}
} else {
//If there's no 'namePath' then we will assume the node we found is the value of a map entry...
//and use the map's key as the symbol's name