TypeFox / yang-lsp

A Language Server for YANG
http://www.yang-central.org
Apache License 2.0
51 stars 13 forks source link

Linking to Augment's SchemaNode fails when the resolution order is "wrong" #200

Closed dhuebner closed 3 years ago

dhuebner commented 3 years ago

Following files are involved: https://github.com/theia-ide/yang-lsp/blob/master/yang-lsp/io.typefox.yang.ide/src/test/resources/good/augment-super.yang https://github.com/theia-ide/yang-lsp/blob/master/yang-lsp/io.typefox.yang.ide/src/test/resources/good/augment-sub1.yang https://github.com/theia-ide/yang-lsp/blob/master/yang-lsp/io.typefox.yang.ide/src/test/resources/good/augment-sub0.yang

If the order of loading/resolving is as above everything works fine. But if the order is augment-sub0.yang, augment-super.yang, augment-sub1.yang a linking error is reported Couldn't resolve reference to SchemaNode 'interfaces'.

interfaces is a container inside the augment-sub0 file.

I suppose this is because: When inside augment-sub0first the belongs-to: augment-super is resolving, inside augment-super we have two includes to augment-sub0 and augment-sub1. augment-sub1 belongs to augment-super and includes augment-sub0

That complex constellation seem to be a valid case (I suppose it is because inside a test) and should work independent of resolution/loading order

dhuebner commented 3 years ago

Fixed