Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import "well-known" modules #29

Open
ibarrere opened this issue Feb 4, 2021 · 5 comments
Open

Unable to import "well-known" modules #29

ibarrere opened this issue Feb 4, 2021 · 5 comments

Comments

@ibarrere
Copy link

ibarrere commented Feb 4, 2021

Hi there, first of all great tool, it helps me a lot!

I use it with Cisco NSO primarily, and most of my modules have a set of imports for things like ietf-yang-types, tailf-ncs, etc at the beginning, but yangster doesn't seem to be able to resolve those. They are underlined and hovering over them prints up "Couldn't resolve reference to AbstractModule 'ietf-yang-types'.(org.eclipse.xtext.diagnostics.Diagnostic.Linking)".

Is there any way to fix this or at least ignore these errors?

Thanks!

@jnyany
Copy link

jnyany commented Feb 24, 2021

Hi there, I have the same problem too. Anybody knows the solution.

@nckbgov
Copy link

nckbgov commented Mar 5, 2021

To manage such situations
with the actual state of the extension,
I specify external modules in the settings files:

~/.yang/yang.settings

{
"yangPath": "/my/home/yang/libs/rift.zip"
}

For those who use NSO, here are some path examples:

{
"yangPath": "/home/vagrant/ncs-5.5/src/ncs/yang"
}

or even:

{
"yangPath": "/home/vagrant/ncs-5.5/src/ncs/yang:/home/vagrant/ncs-run/packages"
}

More about this:

https://github.com/theia-ide/yang-lsp/blob/master/docs/Settings.md

@ibarrere
Copy link
Author

ibarrere commented Mar 5, 2021

@nckbgov cool, thank you for the feedback. I will give this a try.

@ibakard
Copy link

ibakard commented Mar 16, 2021

@nckbgov Your advice works.

However, the $HOME or ~/ in "yangPath" path are not resolved. In result, yang.settings in project folder cannot be put in a git repo used by different people. Similarly, yang.settings in ~/.yang folder will not be set by a project git repo. Not quite convenient.

@akaevgen
Copy link

akaevgen commented Apr 20, 2023

Has anyone solved the problem?

My Setup is Win10 + WSL
VS Code + WSL Extension + Yangster

There are no problem when module name typed completly, but Yangster cant't resole modules while typing =(

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants