Closed RimShao closed 6 years ago
I am a bit confused, as I think it is completely the other way around: We currently support linking against a revision statement, but not against the file name.
Anyway, I take it that you want both to be possible, so I will implement the 'revision by filename' case.
Fixed
Hi Jan,
Sorry for the late reply, now I come back to verify the use case with latest code. the problem still exists:
ERROR (org.eclipse.xtext.diagnostics.Diagnostic.Linking) 'Couldn't resolve reference to Revision '2016-09-27'.' on RevisionDate, offset 211, length 12
use case :
Module ericsson-yang-extensions { Revision “2018-02-19” { description "second version."; } }
Module Ericsson-lm { … import ericsson-yang-extensions { prefix yexte; revision-date "2018-02-19"; } }
After adding prefix and namespace in both files, fixing the caps, and replacing the quotes around the revision date with regular ones it works like a charm here:
ericsson-yangextension.yang:
module ericsson-yang-extensions {
prefix e;
namespace "urn:e";
revision "2018-02-19" {
description "second version.";
}
}
ericsson-lm.yang
module Ericsson-lm {
prefix f;
namespace "urn:e";
import ericsson-yang-extensions {
prefix yexte;
revision-date "2018-02-19";
}
}
Hi Jan,
no, it does not work.
for sure I have the prefix and namespace in both files and even the caps is not in my modeling.
now I show you my complete modeling
ericsson-yang-extensions.yang ========>
module ericsson-yang-extensions { yang-version 1.1; namespace "urn:rdns:com:ericsson:oammodel:ericsson-yang-extensions"; prefix yexte ;
organization "Ericsson AB";
contact "Ericsson first line support via email";
description "The module defines Ericsson proprietary YANG extensions.
Copyright (c) 2016 Ericsson AB. All rights reserved.
Extensions MUST be defined with the following structure in the
description statement:
- What is this statement.
- Newline,
- This statement can be a substatement of the xxx statements with
cardinality x..y.
- This statement can have the following substatements with
cardinality x..y.
- Newline.
- The argument its meaning and type. Preferably use YANG types and
constraints to define the argument's type.
";
revision "2017-06-06" {
description "Added preliminary.";
yexte:version "2";
yexte:release "1";
yexte:correction "2";
}
revision "2017-05-11" {
description "Updated supported-features, static-data
removed not-notifiable.";
yexte:version "2";
yexte:release "0";
yexte:correction "2";
}
revision "2016-12-08" {
description "Defined standard texts to be included in the description.
Made resolution a substatement of range similar to tailf:step.
Added module-conformance-import.";
yexte:version "1";
yexte:release "2";
yexte:correction "0";
}
revision "2016-09-27" {
description "Added static data";
yexte:version "1";
yexte:release "1";
yexte:correction "0";
}
revision "2016-07-01" {
description "Initial version";
yexte:version "1";
yexte:release "0";
yexte:correction "0";
}
...
}
ericsson-test-draftmodule.yang ========>
module ericsson-test-draftmodule { yang-version "1.1"; namespace "urn:rdns:com:ericsson:oammodel:ericsson-test-draftmodule"; prefix testa;
import ericsson-yang-extensions {
prefix yexte;
revision-date "2016-09-27";
}
organization "Ericsson AB";
contact "Ericsson first line support via email";
description "The EYANG Fault Management model.
Copyright (c) 2016 Ericsson AB. All rights reserved.";
}
Aha, that's by design. For linking, we only consider the latest revision of a module.
So revision-date 2017-06-06
works as expected.
See our discussion on that on https://github.com/theia-ide/yang-lsp/issues/99
Hi Jan,
When the “Revision-date” is used within import, now typefox framework support parsing the yangfile@revison-date.yang (for example ericsson-yang-extensions@2018-02-19.yang).
Module ericsson-yang-extensions@2018-02-19 { Revision “2018-02-19” { description "Added preliminary."; } }
Module Ericsson-lm {
… import ericsson-yang-extensions { prefix yexte; revision-date "2018-02-19"; }
}
In practical we have another use case : yang modeling file without specifying “@revision-date” as the file name, and the other module import with specifying the existed revision date, this case now is not supported by typefox. Example:
Module ericsson-yang-extensions { Revision “2018-02-19” { description "second version."; } }
Module Ericsson-lm { … import ericsson-yang-extensions { prefix yexte; revision-date "2018-02-19"; }
}
Can typefox be improved to support the second case ?