Closed RimShao closed 3 years ago
@RimShao Thanks for providing an example model!
Unfortunately I can't reproduce the problem, maybe it is because of an error in module _3gpp-nr-nrm-nrcelldu
list NRCellDU {
description "Represents the information of a cell known by DU.";
reference "3GPP TS 28.541";
key id; // <-- error here: Couldn't resolve reference to Leaf 'id'.
Could you please double check and verify the problem present with models from zip? If so, could you give me a hint on how to reproduce? In our test cases we load the model file as is and invoke the serialize with parsed module as input.
@RimShao
Can reproduce it now. The problem was that we already have _3gpp-nr-nrm-gnbdufunction
and some other in our test resources sub-folders, so the wrong one was loaded.
Note: The problem was that at ../../../gnbdu3gpp:id
two elements with name id
are accessible me3gpp:id
and gnbdu3gpp:id
. super.getCrossReferenceNameFromScope
from YangCrossReferenceSerializer
returned the first best element me3gpp:id
.
io.typefox.yang.resource.YangCrossReferenceSerializer.getCrossReferenceNameFromScope(EObject, CrossReference, EObject, IScope, Acceptor)
tries to cut the first segment me3gpp:
but it does so only if it matches the prefix (here gnbdu3gpp
), otherwise it returns the full name me3gpp:id
. That is later concatenated with existing prefix gnbdu3gpp
which gives gnbdu3gpp:me3gpp:id
which is even syntactically wrong. The fix is in CrossRef serializer, but could be fixed in e.g. SerializerScopeProvider
@dhuebner
Great that the problem is reproduced and root cause is found.
@RimShao Are you able to test your case with current nightly?
@dhuebner
Where is the night build you mentioned ? Thanks a lot.
@RimShao Maven snapshot should be deployed automatically, but I will double check that. Here is the build: https://github.com/theia-ide/yang-lsp/actions/runs/878685021
@RimShao yang-lsp 0.5.0-SNAPSHOT was published Wed May 26 2021 15:32:09 GMT+0200 (CEST)
@dhuebner
Thanks a lot. the problem is fixed now.
Will you publish official 0.5.0 instead of 0.5.0-snapshot ?
@RimShao @andreasjakobik Maybe we can put some more fixes into 0.5.0 ?
if not, then maybe 0.4.1 would be a better version choice
seems 0.4.1 is better
@dhuebner Thanks for quick fix. Here is another serialization issue, but it can wait until 0.5.0 release: https://github.com/theia-ide/yang-lsp/issues/209
released with v0.4.1
Hi yang lsp generates faulty namespace in below use case, Please use attached yang files yangTransform.zip to reproduce this problem.
output:
output gnbdu3gpp:id is expected instead of gnbdu3gpp:me3gpp:id .