-
Notifications
You must be signed in to change notification settings - Fork 26
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 show variables in completion but functions in C file #181
Comments
fwiw the GNU Global project seems to know about this it says here: https://www.gnu.org/software/global/plans.html
|
Yup, it works fine when using ctags through global when creating the database. I did this to let it use ctags: I don't know if that is really the right way to go. |
Hi. You could look into the gtags config file A gtags "label" is just a set of gtags settings in edit: If you look into the code of |
It is not just a set of settings that is named 'ctags' coincidentally. Global is using the ctags binary with that settings when the label is set to ctags. Anyway, if I create the database using citre with GTAGSLABEL unset, what citre is running according to the readme yields:
So why is it not showing this as completion? |
It is if you look into it. The default config file on my system is
See
This is the command Citre use to find references, not definitions or completions. But from the output, a possible guess is the line I'd suggest the following test to know exactly where does the problem happen.
|
This is probably because the database files are saved in
so it does not get them. I continue with the other points regardless.
But with
But (without GTAGSLABEL again):
Btw I found this [1] and isn't this the same problem we have here? If so and given that the Global team seems to know about this (Treat variable definitions as a definition tag (GTAGS). in [2]) shouldn't the command be different when global searches for completions? Maybe run once with and once without [1] https://stackoverflow.com/questions/26957779/gnu-global-do-not-see-a-variables |
I think yes.
Yes. I've tested this and it's doable. But although this is a improvement for auto-completion, we still cannot find definitions of such symbols using global. So at the end, a global user may still want to use the ctags plugin parser. |
Describe the bug
When in a C file I get completion candidates for functions just fine, but I don't get suggestion for variables.
Here is a small test example. I use the global backend and the
mytext
variable is not suggested from corfu:on the other hand it completes the function
myInBufferFunction
:(don't mind the header file, I was just testing around if it has something to do with whether the function is defined in-buffer or in another file - it does not)
Heres my config regarding citre:
To Reproduce
If you are pretty sure about the cause, or you are pretty sure it's a easy fix, or you are pretty sure it can be easily reproduced by developers, you can delete this section. Otherwise, write steps to reproduce, and it should start by
$ emacs -Q
.Steps to reproduce:
$ emacs -Q
System information
Additional context
I tried with ggtags-mode and it is showing the variables, so it must be a setting or something in citre.
fwiw I seems like the variable tag isn't in the tag file at all:
after creating the GTAGS etc. files with ggtags-mode I get:
This is because ggtags can tell global to use ctags as a backend for creating tag files. If I don't do that, is creates a GTAGS file with the same issue. However, creating a tags database with citre or ggtags (without ctags backend) results in
So it finds them with -s, which is
Whyever global thinks mytext has no definiton, is citre using the wrong arguments for global?
The text was updated successfully, but these errors were encountered: