ก่อนอื่นคุณต้องเริ่มต้น CEDET และ ede
(global-ede-mode 1)
(add-to-list 'semantic-default-submodes 'global-semanticdb-minor-mode 1)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode 1)
(add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode 1)
(add-to-list 'semantic-default-submodes 'global-semantic-highlight-func-mode 1)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-summary-mode t)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode t)
(add-to-list 'semantic-default-submodes 'global-srecode-minor-mode t)
(add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode t)
(semantic-mode) ;; Active le mode semantic
(require 'stickyfunc-enhance) ;; multilines concatene dans la header line
(require 'cedet-cscope)
(require 'ecb)
(ede-cpp-root-project "projName"
:name "projName Project"
:file "~/workspaces/projName/proj.txt" ;; an arbitrary file
:include-path '("/src/main/src"
"/src/main/include"
"/src/test/src"
"/src/test/include"
... )
:system-include-path '("/usr/include/ ~/workspaces/install/proj3/lib/ /usr/include/boost/")
:spp-table '(("isUnix" . "") ("BOOST_TEST_DYN_LINK" . "")))
;; cedet semantic
(semanticdb-enable-gnu-global-databases 'c-mode t)
(semanticdb-enable-gnu-global-databases 'c++-mode t)
;; You can add this to improve the parse of macro-heavy code:
(require 'semantic/bovine/c)
(add-to-list 'semantic-lex-c-preprocessor-symbol-file "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/stddef.h")
จากนั้นคุณสามารถใช้ส่วนหัวของ บริษัท ( https://github.com/randomphrase/company-c-headers )
(require 'company-c-headers)
(add-to-list 'company-backends 'company-c-headers)
(add-to-list 'company-c-headers-path-system "/usr/include/c++/4.4.7/ /home/me/DEPEDENCIES/LIBXX/lib/ /home/me/DEPEDENCIES/LIBYY/lib /usr/include/boost/"))
Type
มีเขตข้อมูลint foo
และchar bar
semantic และ บริษัท ทำงานนอกกรอบ