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

VLS not reading meson.build or compile_commands.json?? #290

Open
Charadon opened this issue Mar 30, 2023 · 7 comments
Open

VLS not reading meson.build or compile_commands.json?? #290

Charadon opened this issue Mar 30, 2023 · 7 comments
Labels
unconfirmed Unconfirmed bug

Comments

@Charadon
Copy link

Charadon commented Mar 30, 2023

Describe the bug
For some reason, I keep getting the error:
The namespace name 'Gtk' could not be found (vala)
Even though it compiles correctly.
I've tried copying the compile_commands.json into src and the root of the folder with no success.

Software
OS and version (e.g. Ubuntu 20.04): Slackware 15.0
Code editor (e.g. VSCode): Vim with coc-nvim
Vala Language Server (e.g. git commit, or PPA/AUR version): 0.48.7
Vala version (valac --version): 0.54.6

To Reproduce
This code should replicate it.
https://pagure.io/charadon/grpmi

Steps to reproduce the behavior:

  1. Open src/main.vala in vim
  2. You should get the error

Any help for trying to figure out what's wrong would be appreciated, as this is the first time i've ran into this issue. And what's more odd, is that this bug doesn't affect my other vala project: https://pagure.io/charadon/Dungeon-Vala

Me not get it

@Charadon
Copy link
Author

I think I figured it out. It fails if the project hasn't been set up with git yet.

@Prince781
Copy link
Member

git shouldn't have anything to do with this. I can't reproduce your issue.

@Prince781 Prince781 added the unconfirmed Unconfirmed bug label Mar 30, 2023
@Charadon
Copy link
Author

git shouldn't have anything to do with this. I can't reproduce your issue.

I've managed to reproduce it by not using git. If I don't have a git repo initialized (renaming .git to .git_backup for example), it won't work anymore, but if I have git, it will work again. Is git being used to find the top level of the project directory?

@Prince781
Copy link
Member

No. We don't use git for that.

@Charadon
Copy link
Author

No. We don't use git for that.

Then I dunno. I can keep reproducing it by just getting rid of the git repo. It might be something with coc-nvim maybe?

@Prince781
Copy link
Member

A few questions:

  1. What's the working directory that you open the file from?
  2. Can you send a log of VLS's output?

@Charadon
Copy link
Author

Charadon commented Apr 2, 2023

I think I figured it out. And it's most likely a quirk in coc-nvim. Basically, I had a recursive git repo thing going on (Git repo inside a git repo). And in the sub directory I had the program in, it didn't have it's own git repo set up yet. So coc-nvim was probably look at the toplevel of the git repo (which would be the "meta" repo) and couldn't find meson.build or compile_commands.json and would as such, fail.

Now as for the questions above. I can really only tell you i'm opening the source file from the directory that the meson.build is in. As for VLS's output, I don't know how to get that from coc-nvim. I've checked every log command coc-nvim has, and vala appears to not spew any errors (Or any output aside from the fact it launched)

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

No branches or pull requests

2 participants