我在X86_64-pc-gnu-linux(ubuntu 10.04)上使用emacs 23.1.1并按照着名链接http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html将所有配置添加到.emacs。 但它甚至不能做基本的工作。我的设置或配置肯定有问题。emacs cedet语义与Qt4如何配置
如果我试图让它显示成员函数,它无法找到。 [自动完成使用clang作为解析器。那么语法分析器使用的是什么? ]
;; Load CEDET
(load-file "~/backup/cedet-trunk/common/cedet.el")
(global-ede-mode 1)
;(semantic-load-enable-code-helpers)
(semantic-load-enable-excessive-code-helpers)
;(semantic-load-enable-semantic-debugging-helpers)
(global-srecode-minor-mode 1)
(global-semantic-tag-folding-mode 1)
(require 'semantic-tag-folding)
(global-semantic-idle-scheduler-mode 1)
(global-semantic-idle-completions-mode 1)
(global-semantic-idle-summary-mode 1)
(global-semantic-idle-completions-mode)
(require 'semantic-ia)
(require 'eassist)
(require 'semantic-gcc)
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
(setq qt4-base-dir "/usr/include/qt4")
(setq qt4-gui-dir (concat qt4-base-dir "/QtGui"))
(setq qt4-core-dir (concat qt4-base-dir "/QtCore"))
(semantic-add-system-include qt4-base-dir 'c++-mode)
(semantic-add-system-include qt4-gui-dir 'c++-mode)
(semantic-add-system-include qt4-core-dir 'c++-mode)
(add-to-list 'auto-mode-alist (cons qt4-base-dir 'c++-mode))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir
"/Qt/qconfig.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qconfig-large.h"))
(add-to-list 'semantic-lex-c-preprocessor-symbol-file (concat qt4-base-dir "/Qt/qglobal.h"))
(defun my-cedet-hook()
(local-set-key [(control return)] 'semantic-ia-complete-symbol-menu)
(local-set-key "\C-c?" 'semantic-ia-complete-symbol)
(local-set-key "\C-c>" 'semantic-complete-analyze-inline)
(local-set-key "\C-c=" 'semantic-decoration-include-visit)
(local-set-key "\C-cj" 'semantic-ia-fast-jump)
(local-set-key "\C-cb" 'semantic-mrub-switch-tags)
(local-set-key "\C-cd" 'semantic-ia-show-doc)
(local-set-key "\C-cs" 'semantic-ia-show-summary)
(local-set-key "\C-cp" 'semantic-analyze-proto-impl-toggle)
(local-set-key "\C-cr" 'semantic-symref)
(local-set-key "\C-c\-" 'senator-fold-tag)
(local-set-key "\C-c\+" 'senator-unfold-tag)
)
(add-hook 'c-mode-common-hook 'my-cedet-hook)
(add-hook 'lisp-mode-hook 'my-cedet-hook)
(add-hook 'emacs-lisp-mode-hook 'my-cedet-hook)
(ede-cpp-root-project "Test"
:name "Test Project"
:file "~/project/shared/test-qt-semantic.cpp"
:include-path '("/"
)
:system-include-path '("/usr/include/qt4"
"/usr/include/qt4/Qt"
"/usr/include/qt4/QtGui"
"/usr/include/qt4/QtCore"
))
这是源文件:
#include <QApplication>
#include <QPushButton>
#include <QString>
int main (int argc, char ** argv)
{
QApplication app (argc, argv);
QPushButton hello ("Hello, World!");
hello.resize (100, 30);
hello.show();
QString id("hi");
return app.exec();
}
无法找到数据类型: “类QPushButton你好()”。
声明的类型是:“类QPushButton {}”
原始数据类型是:(“QPushButton”型(:类型“类”)无无)语义找不到任何其全球的这种数据类型表。
语义通过本地作用域或全局012pec配置类型来定位数据类型。
本地范围信息:
*标记类约束对范围:(型)
*没有已知的父母在目前的范围。
*目前没有已知的符号在范围内。 *没有已知的符号在本地声明。
语义为每个缓冲区创建并维护一个类型缓存。
如果类型是全局类型,那么它应该出现在它们的类型中。
要检查typecache,类型:M-X semanticdb-typecache转储RET [做它]
当前typecache统计:
0类型的全球在此文件
0类型从包括。如果数据类型不在typecache中,那么您的include 路径可能不正确。
包括路径摘要:
该文件的项目包括搜索由EDE对象处理:
缓冲目标:#义德-CPP-根本目标的/ home /麦克风/项目/共享/>
缓冲区项目:#义德-CPP根项目测试>
备份定位:#义德 - 定位基禄>该系统包括路径是:
/usr/include/qt4/ /usr/include/qt4/QtGui/ /usr/include/qt4/QtCore/ /usr/include/c++/4.4/ /usr/include/c++/4.4/x86_64-linux-gnu/ /usr/include/c++/4.4/backward/ /usr/local/include/ /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/ /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include-fixed/ /usr/include/
包含摘要:/home/mike/project/shared/test-qt-semantic.cpp
test-qt-semantic.cpp包含3个包含。
未知包括:0
不可析包括:0
解析的包括:3
没有包括未知。
鉴于他们没有cedet用户邮件列表,我建议尝试[cedet-devel](http://sourceforge.net/mailarchive/forum.php?forum_name=cedet-devel)。 (我也试图在CEDET上开始,到目前为止这已经很艰难) – 2012-08-08 13:57:03