|
以前都是从http://cedet.sourceforge.net/下载编译cedet,可是现在总是编译出错,刚好发现emacs23自带了cedet.就按照emacser.com的介绍配置了下,但是semantic只能补全用户定义的成员.
emacs是emerge安装的23.3.1- cedet-version
- CEDET Version: 1.0
- Requested File Loaded
- Package Version Version Version
- ----------------------------------------------------------
- cedet: 1.0 ok ok
- eieio: 1.3 ok ok
- semantic: 2.0 ok ok
- srecode: 1.0 ok Not Loaded
- ede: 1.0 ok Not Loaded
- speedbar: 1.0 ok Not Loaded
复制代码
打开cpp文件以后,信息提示只解析了c++config.h文件.
(Parsing c++config.h (LL)...done)
在semanticdb的存储位置也只有这个文件的解析数据和那个cpp文件的数据.- ls ~/.emacs.d/semanticdb/
- !mnt!e!linux!code!include!semantic.cache
- !mnt!e!linux!code!semantic.cache
- !usr!lib!gcc!i686-pc-linux-gnu!4.4.5!include!g++-v4!i686-pc-linux-gnu!bits!semantic.cache
复制代码
.emacs文件 有关cedet的所有配置- (require 'cedet)
- (setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
- global-semanticdb-minor-mode
- global-semantic-idle-summary-mode
- global-semantic-mru-bookmark-mode
- ))
- (semantic-mode 1)
- (global-semantic-show-parser-state-mode 1)
复制代码
刚开始也试过把gcc的类库路径添加到semantic的解析路径的列表里.不过还是不起作用.- (defconst cedet-user-include-dirs
- (list "."))
- (setq cedet-sys-include-dirs
- (list "/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/include/g++-v4"
- ;/usr/include 等等几个路径也都添加过
- ))
- (let ((include-dirs cedet-user-include-dirs))
- (setq include-dirs (append include-dirs cedet-sys-include-dirs))
- (mapc (lambda (dir)
- (semantic-add-system-include dir 'c++-mode)
- (semantic-add-system-include dir 'c-mode))
- include-dirs))
- (setq semanticdb-default-save-directory
- (expand-file-name "~/.emacs.d/semanticdb"))
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|