是否可以让 Semantic (emacs) 自动访问所有文件?
从我从文档中可以看出,语义的工作原理是通过在访问每个文件(可能还有其邻居)时分析它们,慢慢地建立对项目中内容的了解。这太慢了。我想让它访问我的项目中的所有文件。有没有简单的方法可以做到这一点?在我能够得到像样的自动完成工作之前必须访问数百个文件似乎很疯狂。
我还生成了一个 etags 文件。我可以以某种方式利用它吗?
相关信息:Windows 上的 Emacs,版本 23.2.1
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CEDET 将通过 #include 语句自动解析所有文件引用,从而提供相当好的完成度。如果您希望在文件中跳转,您可以设置 CEDET 以使用 GNU Global、CScope,以提供按标记名称在项目中移动所需的数据库。
此外,CEDET 会在空闲时解析您的标头和附近的文件,因此最终您将在第一次使用该工具后大约 10 分钟内获得所有本地文件的完整数据库。您可以通过打开文件并调用该文件来加快速度,
该文件将立即执行,而无需等待。
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
which will go off and do that stuff without waiting.
最后,我发现最好的解决方案是使用一些 elisp 手动强制解析文件。我找到的最佳答案是这里。
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.