-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add "west gtags" extension #85984
base: main
Are you sure you want to change the base?
Add "west gtags" extension #85984
Conversation
Note that this is similar in spirit to the Linux build system's "make gtags" command, except this searches the entire workspace. This is very useful to me as a maintainer because it can be used to index all the symbol definitions everywhere, not just for a single application build or something like that the way an LSP server might offer. |
419d930
to
2f18757
Compare
This is an extension for indexing the source code in the workspace with GNU Global. See the command line help for more information about Global. Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
Document this command's existence, provide basic usage, and describe the locations of resources where additional help etc. should be found. Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks cool, I need to take a closer look at a GNU globals
compatible setup for my neovim configuration 😅. Using fzf
all the time is time consuming.
Same here! I use |
Ouch ~/zephyrproject $ du -hs G*
42M GPATH
1.2G GRTAGS
2.7G GTAGS |
is this tagging the complete workspace? |
Yes, zephyr |
no wonder then, I use ctags per git repo usually, and that is manageable, but I guess it makes sense to work on the workspace, if the workspace is "managed" and not everything. btw, wondering if the large data set impacts performance of vim for example, or any editor... |
Yep, as documented in the global page, the tags files are quite large. But the search is nearly instant, and I don't notice any perf degredations either at the command line or within emacs (which is where I normally use global -- via helm-gtags.el) |
I might be a dinosaur, but I just love indexing and searching large C code bases with GNU Global.
I've been doing it for years and have provided references on how to integrate it with west to users who ask how I search for code for years now.
I think it might be useful to have this as an out of the box feature, so add a "west gtags" command that indexes the workspace for source files and creates a global tags file that you can use to find function definitions with it. Hopefully the associated documentation commit makes the use cases clear.