Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 654
RealityMonster Avatar asked May 31 '10 20:05

RealityMonster


2 Answers

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.

like image 134
Eric Avatar answered Sep 17 '22 14:09

Eric


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.

like image 43
RealityMonster Avatar answered Sep 19 '22 14:09

RealityMonster