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

'is_third_party' does not disable errors in third party libraries #366

Open
JakubFranek opened this issue Feb 23, 2025 · 3 comments
Open

Comments

@JakubFranek
Copy link

Hello

I am using vhdl-ls linter via TerosHDL integration in VS Code. I have a vhld_ls.toml file like this in the root of my repository:

[libraries]

vunit_lib.files = ['.venv/Lib/site-packages/vunit/**/*.vhd']
vunit_lib.is_third_party = true

mylib.files = ['sources/**/*.vhd']
mylib.is_third_party = false

Adding vunit_lib like this was the only way I found to have vhdl-ls recognize vunit_lib usage within my testbenches successfully.

My expectation is that the vunit_lib.is_third_party = true statement will supress all errors within vunit_lib.

The reality is hundreds of errors, all in vunit_lib:

Image

Is this a bug, working as intened, or is there perhaps a different way to ignore/supress/exclude errors in a particular folder?

I find this behavior very annoying. If I don't include vunit_lib files, I get errors in my testbench, if I do, I get errors in vunit_lib itself.

Thank you.

Kind regards
Jakub

@Schottkyc137
Copy link
Contributor

The is_third_party switch only turns off warnings for some libraries (e.g., unused declaration). So this is intended behaviour. I think the solution is to not include vunit by a glob expression, but instead spell out each file explicitly (also see the example project). I believe that vunit and others have several files for various VHDL standards. Adding both files will cause the duplicate declarations error.

@jevogel
Copy link

jevogel commented Feb 28, 2025

@JakubFranek, you can't use glob expressions to include all of the VHDL files from within the VUnit distribution, because some of them (or many of them) conflict (note the error messages "A primary unit has already been declared...").

One alternative is to export your VUnit file list and use the from_vunit_export.py script from the example project that @Schottkyc137 referenced to parse that into a vhdl_ls.toml file, then manually edit it to remove the sources that are inside of the vunit_out/preprocessed directory.

It would be great if VHDL-LS gave us an exclude_files option for each library so you could specify a glob for files and then override it for specific files that need to be left out.

@Xcodo
Copy link
Contributor

Xcodo commented Feb 28, 2025

This was discussed in #40, but only include was added. It would be great to have an exclude list too, especially for Vunit!

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

4 participants