Is it possible to get Semantic (emacs) to visit all files automatically?
Asked Answered
T

2

8

From what I can tell from the docs, semantic works by slowly building up an idea of what's in your project by analysing each file (and possibly its neighbours) as you visit them. This is too slow. I'd like to just have it visit all the files in my project. Is there an easy way to do this? Having to visit hundreds of files before I can get decent autocomplete working seems crazy.

I've also got a etags file generated. Can I leverage that somehow?

Relevant info: Emacs on Windows, version 23.2.1

Terryn answered 31/5, 2010 at 20:25 Comment(2)
Why don't you have a look at GCCSense(cx4a.org/software/gccsense) instead?Forestation
Bozhidar: do you know if this will conflict with semantic/cedet at all ?Germaine
S
7

CEDET will automatically parse all files references via #include statements, thus providing pretty good completion. If you are looking to jump around in your files, you can setup CEDET to use GNU Global, CScope, to provide the database needed to move around a project by tag name.

In addition, CEDET will parse your headers and nearby files in idle time, so eventually you will have a complete database of all your local files in about 10 minutes after using the tools the first time. You can speed it up by opening a file, and calling

 M-x semantic-debug-idle-work-function

which will go off and do that stuff without waiting.

Standpipe answered 1/6, 2010 at 11:51 Comment(1)
Thanks, Eric. I've got the idle work functions going right now. I suspect at this point that I've got small problems with my setup. I'm using the Emacs 23 integrated version of CEDET, so all the articles on setting things up include things that are no longer relevant or possible. Using simple test cases, I can't get Semantic to complete anything except the most simple in-file information (ie., no member variable completion works). I'll also try out GNU Global. Thanks!Terryn
T
1

In the end, I've found that the best solution is to brute-force the parsing of the files manually using a bit of elisp. The best answer I've found to this is here.

Terryn answered 15/8, 2014 at 15:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.