Closed huyuwen closed 4 years ago
I submitted a fix for the serialization part (#178).
Why would you like to link all possible nodes to the asterisk? Do you want to find the nodes in the parsed AST? Or is it rather about language server features like go to definition?
Here we have a module which has a must xpath expression
When yang-lsp loading this xpath, the stack will go through the following methods XpathResolver.computeType() -> XpathResolver.findNodes() findNodes() will return 2 children nodes correctly. [name, api]
But when Linker get the result from resolver.apply() https://github.com/theia-ide/yang-lsp/blob/8c45e2c6320c3192646e067f7aa123a66b23faff/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/scoping/Linker.xtend#L32 The candidate only have one EObjectDescription.
This is due to XpathResolver.getEObjectDescription() only return the head of XpathType.nodes. https://github.com/theia-ide/yang-lsp/blob/8c45e2c6320c3192646e067f7aa123a66b23faff/yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/scoping/xpath/XpathResolver.xtend#L475
In this case, * actually only link to the first returned schema node. There will have two consequnces.