-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Does not find system or local VAPIs #293
Comments
VLS needs a way of understanding your project's compiler flags and we get this through |
Thanks; did I miss that being documented somewhere? Also, that doesn't explain to me why VAPIs installed with the compiler (like |
Without compiler flags, libvala doesn't know whether you're using Posix profile, so the VAPI won't be included. In this case, the errors you see should be exactly the same as if you ran |
It may not be documented as well as it could be: vala-language-server/README.md Lines 75 to 80 in 3b5fe94
https://github.com/vala-lang/vala-language-server/blob/master/README.md#editors We try to emit warnings in your editor if we can't find your compiler args. This could be improved: vala-language-server/src/server.vala Lines 427 to 435 in 3b5fe94
|
Ah yes, good point about the compiler flags. Thanks for the documentation pointers. Is there some way I can pass the compiler flags to VLS manually? (So then I could set them in my Codium workspace, potentially.) |
You can write your own Outside of switching to Meson (which is what the vast majority of Vala projects use), this would be a feature request. I can think of a few possibilities:
|
Something simple would be nice, like 2. In this case I would have been quite happy to write a quick per-project config file, and have that minor maintenance burden. I think at this stage there probably won't be many new autotools Vala projects (although automake has good Vala support). You might be interested to know that in the end I decided to use Python instead of Vala for this project: I started translating C into Vala, but while this was as easy as ever, I realised that in this case it would be no harder to rewrite the code from scratch than to translate some highly-involved C into "good" Vala (translating it into "bad, C-style" Vala would be easy, but not great progress). The final choice (of Python), was just because I am more familiar with writing this kind of (command-line, POSIXy) code in (typed) Python right now, and I find it quicker to write than Vala. |
Describe the bug
I am fairly new to VLS/vala-vscode (I was trying them in Codium to upgrade my Vala editing experience).
I cannot see where the VAPI path is set: I can't find any sort of configuration or command-line option I could be passing to
vala-language-server
.I am getting warnings from Codium that "Posix" cannot be found, which baffles me, as of course it is installed as part of Vala; and there's no problem finding "GLib":
Also, a few VAPIs in the same directory as my source code are not found.
After some more research, I tried turning on debug in VLS, which gave me the following:
It does not find any other GIR information, and I notice that it only seems to find namespaces mentioned in GIRs, not in VAPIs. I also found this issue: #220 but the symptoms I am getting are not the same: my Vala source file is being built, just VLS is not (apparently) finding the namespace information.
Software
OS and version (e.g. Ubuntu 20.04): Ubuntu 22.04
Code editor (e.g. VSCode): Codium
Vala Language Server (e.g. git commit, or PPA/AUR version): 3b5fe94
Vala version (
valac --version
): 0.56.0To Reproduce
Source code repo: https://github.com/rrthomas/mmv/tree/vala
Steps to reproduce the behavior:
mmv.vala
.Thanks very much for VLS! I already did some useful refactoring.
The text was updated successfully, but these errors were encountered: