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

Library work not allowed anymore #355

Open
Martinhinnerson opened this issue Dec 6, 2024 · 3 comments
Open

Library work not allowed anymore #355

Martinhinnerson opened this issue Dec 6, 2024 · 3 comments

Comments

@Martinhinnerson
Copy link

Hi!
I work in a project where library 'work' is expected to be used globally for all files. After updating vhdl_ls it does not work anymore since the library 'work' is not allowed in the vhdl_ls.toml anymore.

I tried building vhdl_ls locally and just remove the check in vhdl_lang/src/config.rs that returns an error if work is used, and that seems to work.

What was the reason to disallow this?
If you cant remove it again, would it be possible to have a config option to allow library work again?

@Xcodo
Copy link
Contributor

Xcodo commented Dec 6, 2024

Work can still be used in VHDL use statements, where it means "the current library". See this blog post for a brief explanation.

You don't need to change your VHDL files to use VHDL-LS, refering to modules as use work. is fine.

However, work is not allowed in the vhdl_ls.toml configuration file as the name of the library. Instead you can use any other name, for instance work_lib would be valid.

@Martinhinnerson
Copy link
Author

Thanks for the reply. I’m aware that work is not really a library, but I tried naming it defaultlib in the vhdl_ls.toml and it didn’t work. The language server did not recognize anything imported as work.

How does vhdl_ls know what is the ”current library”?

@Schottkyc137
Copy link
Contributor

Schottkyc137 commented Dec 7, 2024

How does vhdl_ls know what is the ”current library”?

When you have a vhdl_ls.toml file, you associate a library to each file:

[libraries]
libA.files = [
    "foo.vhd",
    "bar.vhd",
]

libB.files = [
    "baz.vhd",
    "foobar.vhd",
]

When you edit foo.vhd, the work library will be set to libA. So visible symbols from the work library will include symbols from foo.vhd and bar.vhd. Similarly, if you edit stuff in baz.vhd, the work library is libB and therefore symbols from baz.vhd and foobar.vhd

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

3 participants