Hi, Eric.

The below is the result of semantic-analyze-debug-assist. I defined a structure type named TEST2_TYPE in the file test2.h. And it seems semantic do not find where the head file at.

I also used global-semantic-decoration-mode, and found if a head file is in the current directory it is not high light, if a head file is not in the current direcotry it is high light.

What the problem maybe?

Thanks.

Unable to find datatype for: "class TEST2_TYPE test2".
Declared type is: "class TEST2_TYPE {}"
Raw data type is: ("TEST2_TYPE" type (:type "class") nil nil)

Semantic could not find this data type in any of its global tables.

Semantic locates datatypes through either the local scope, or the global
typecache.

Local Scope Information:
 * Tag Class Constraint against SCOPE: (type)
 * No known parents in current scope.
 * No known symbols currently in scope.
 * No known symbols declared locally.
Semantic creates and maintains a type cache for each buffer.
If the type is a global type, then it should appear in they typecache.
To examine the typecache, type:

  M-x semanticdb-typecache-dump RET   [ Do It ]

Current typecache Statistics:
      0 types global in this file
      1 types from includes.

If the datatype is not in the typecache, then your include
path may be incorrect. 

Include Summary: /home/yupeng/work/emacs/test2/test2.c

test2.c contains 3 includes.
   Unknown Includes:  2
   Unparsed Includes: 0
   Parsed Includes:   1

A likely cause of an unfound tag is missing include files.
The following includes were not found:
  test2.h
  test1.h

You can fix the include path for c-mode by using this function:

M-x semantic-customize-system-include-path RET   [ Do It ]

which customizes the mode specific variable for the mode-local
variable `semantic-dependency-system-include-path'.


在2009-01-23,"Eric M. Ludlam" <eric@siege-engine.com> 写道:
>Hi,
>
>  Your setup does look fine.  The next step in understanding what
>might be wrong is to, when at a point where completion does not seem
>to work, run the following command:
>
>M-x semantic-analyze-debug-assist RET
>
>  It will list out everything Semantic tried to do.  It will list if
>the header file you expect was found, and what symbols it thinks ought
>to be available.  That may help identify if it is a file locate thing,
>or a C pre-processor issue.
>
>Another useful mode is `global-semantic-decoration-mode' which will
>highlight your headers based on if they were found or not.  That will
>be more directly involved in identifying how your setup is working.
>
>Eric
>
>>>> yupeng82921 <yupeng82921@163.com> seems to think that:
>>Hi, Eric.
>>
>>I have studied the global info in cedet.info, in my comprehension, when I s=
>>etup an ede project and set ede-locate-setup-options correctly and create a=
>> global database in my project root directory,  semantic can find all the h=
>>ead file automatically. Thus if I don't specify include-path in ede project=
>>, semantic also can find the define of any structure and complete its membe=
>>rs (I'm a C programmer).
>>
>>Does my comprehension right?
>>I configure my .emacs as bellow, but I can not get a structure member's com=
>>pletion if it is defined in other directory.
>>
>>Is there something wrong in my configuration or semantic still need specifi=
>>c include path in ede project?
>>
>>thanks.
>>
>>;; Load CEDET
>>(load-file "~/lisp/cedet/common/cedet.el")
>>;; Enable EDE (Project Management) features
>>(global-ede-mode 1)
>>;; Enable EDE for a pre-existing C++ project
>>(ede-cpp-root-project "test2" :file "~/work/emacs/test2/test2.c")
>>(setq ede-locate-setup-options
>>           '(ede-locate-global
>>         ede-locate-base))
>>(semantic-load-enable-minimum-features)
>>(setq semanticdb-default-save-directory (expand-file-name "~/.semanticdb"))=
>> =20
>>(require 'semanticdb-global)
>>(semanticdb-enable-gnu-global-databases 'c-mode)
>>
>>
>>
>>=D4=DA2009-01-22=A3=AC"Eric M. Ludlam" <eric@siege-engine.com> =D0=B4=B5=C0=
>>=A3=BA
>>>Hi,
>>>
>>>  To start using GNU Global to find files with EDE, you just need to
>>>customize the variable `ede-locate-setup-options'.  All project types
>>>use the same locate system for finding files.
>>>
>>>  There is a section on GNU Global in cedet/common/cedet.info that
>>>explains integrating GNU Global into the various CEDET tools.
>>>
>>>Good Luck
>>>Eric
>>>
>>>>>> yupeng82921 <yupeng82921@163.com> seems to think that:
>>>>
>>>>hi, Eric.
>>>>
>>>>You'd ever said semantic can use gnu global to find head file for C or C+=
>>+ program. To do that we should set up an EDE project and configure the var=
>>iable "ede-locate-setup-options".
>>>>
>>>>Now I create an EDE project like this:
>>>>(ede-cpp-root-project "test2.c" :file "/home/yupeng/work/emacs/test2/test=
>>2.c"
>>>>     :include-path '( "")
>>>>     :system-include-path '( "" )
>>>>     :spp-table '( ("MOOSE" . "")
>>>>                   ("CONST" . "const") ) )
>>>>
>>>>But I don't know how to configure "ede-locate-setup-options". Is there so=
>>me example to reference?
>>>  [ ... ]
>>
>
>-- 
>          Eric Ludlam:                       eric@siege-engine.com
>   Siege: www.siege-engine.com          Emacs: http://cedet.sourceforge.net



网易邮箱,中国第一大电子邮件服务商