我在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