I use emacs 23.1.1 on X86_64-pc-gnu-linux (ubuntu 10.04) and follow the famous link http://alexott.net/en/writings/emacs-devenv/EmacsCedet.html to add all the settings to .emacs. But he CANNOT do even the main job. There should be something wrong with my setup or setup.
If I try to let it display a member function, it will NOT be able to find. [automatic full use of clang as parser. So what does parser semantics use? ]
;; 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 "\Cc?" 'semantic-ia-complete-symbol) (local-set-key "\Cc>" 'semantic-complete-analyze-inline) (local-set-key "\Cc=" '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 "\Cc\-" 'senator-fold-tag) (local-set-key "\Cc\+" '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" ))
This is the source file:
#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 (); }
Cannot find data type for: "class QPushButton hello ()".
Declared type: "class QPushButton {}"
Raw data type: (type "QPushButton" (: type "class") nil nil)
Semantic could not find this data type in any of its global tables.
Semantics finds data types through a local scope or global typecache.
Local area information:
* Tag class restriction against SCOPE: (type)
* Unknown parents in the current volume.
* Currently known symbols are not known. * Unknown characters declared locally. Semantic creates and maintains a type cache for each buffer. If the type is global, then it should appear in them typecache.
To check the typecache type, type:
Mx semanticdb-typecache-dump RET [Do It]
Current type table Statistics:
0 global types in this file
0 types of includes.
If the data type is not in typecache, then your include path might be wrong.
Include a short description of the path:
This project file includes a search using the EDE object:
Buffer target: # ede-cpp-root-target / home / mike / project / shared / ">
Buffer project: # ede-cpp-root-project Test>
Backup Locator: # ede-locate-base Loc>
The system includes the path:
/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/
Include resume: /home/mike/project/shared/test-qt-semantic.cpp
test-qt-semantic.cpp contains 3 includes. Unknown Includes: 0 Unparsed Includes: 0
Designed by: 3
Unfortunately, it is unknown.