reddit / emacs

Why does Projectile create a TAGS file and how do I turn it off?

OldMansKid · 2022-10-13 13:52
I constantly get a pop up telling me TAGS is modified, do I want to reload it. This is annoying, how can I turn it off?
WelkinSL · 2022-10-13 14:06
I do not use projectile but maybe this? `projectile-find-file-hook-function` https://emacs.stackexchange.com/questions/58667/why-tags-file-is-loaded-visited-automatically-if-it-exists-in-project-root-direc And you probably want to keep it cause it is needed for goto definition and other functionalities: https://www.emacswiki.org/emacs/EmacsTags
OldMansKid · 2022-10-13 14:26
It can do that? I think I'm using lsp-mode to find definitions. I'm working on cmake projects.
slashkehrin · 2022-10-13 14:29
What language are you programming? Maybe this is the fault of an interaction between Projectile and a specific language mode. This would be something I would've turned of instantly, but I couldn't find anything to do with tags in my config. (use-package projectile :ensure t :config (projectile-mode +1) (setq projectile-use-git-grep t) (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map) (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map))
OldMansKid · 2022-10-13 14:38
I use lsp-mode + clangd on some hobby cmake C++ projects. I use emacs on Android's termux at work, so I use it at home as well, but I use the gtk version on my laptop.
big_lentil · 2022-10-13 15:03
You probably have the language server configured incorrectly if you keep getting that message. I'd assume what's happening is that you use goto definition/find references functionality (xref), the language server for some reason can't do that, so xref uses the etags backend, which uses the TAGS file, which is auto-generated by projectile when needed. The end result is things work but you get the occasional "TAGS regenerated" message. You should look into whether your language server is actually indexing your codebase(s) and fix that if possible. You can also just keep using the tags file, there's probably an option to always say yes to that message, and it's a perfectly fine tool.
OldMansKid · 2022-10-13 15:19
Sounds likely. I'll investigate, thanks for the info.