>>> peng yu <yupeng820921@...> seems to think that:
>Hi, Eric.
>
>I use smart completion in my C and C++ code, it is very cool.
>
>Now I need to write python code, but I found semantic can only get the "top
>level" variable and function's name to complete. If I define a python
>function in a class, I can not get its completion. It is because semantic
>can not support or something of my configuration is wrong?
Hi,
Every language has a different support level in Semantic. Because I
code in C/C++ for work, and Emacs Lisp for fun, these languages have
the best, most complete support. Java probably comes in a close
second, as that is what David used when he was developing in Semantic.
While it is true that the existence of a python parser enables many
aspects of smart completion to start working, it is incomplete. Local
variables are found via a local-variable parser that needs special
attention. In cedet/semantic/wisent/wisent-java.el, you can see how
java extracts local variables by calling back into the parser. For
python, it always returns nil.
Someone who knows Python and who is interested in learning the
wisent python parser would need to go in and add support for this
aspect. Presumably, the steps are to first implement an "up-block"
concept to find the current code block, then implement any missing
pieces of the python parser for reading local variables, then overload
the local variable method.
Bits of this are described on the add a language web page.
http://cedet.sourceforge.net/addlang.shtml
Based on what successes you've had so far, I'd guess the overhead to
do this is small.
If someone wants to tackle this, you will need to assign your work
to the FSF to be included in CEDET if the code is more than 10 lines
long.
Thanks!
Eric
--
Eric Ludlam: eric@...
Siege: http://www.siege-engine.com Emacs: http://cedet.sourceforge.net
|