>>> Yuri Lenskiy <yuri.lenskiy@...> seems to think that:
>Eric M. Ludlam writes:
> > >>> Yuri Lenskiy <yuri.lenskiy@...> seems to think that:
> > >Hello,
> > >
> > >I have installed CEDET Semantic, and have gone through quite a lengthy
> > >configuration battle with it. I ended up writing a loop that iterates
> > >through every file in /usr/include/c++/4.3.3/bits/ and adds it to my
> > >semantic-lex-c-preprocessor-symbol-files variable in an effort to get
> > >proper autocompletion for the STL (i.e., typing std::string::re should
> > >give me autocompletion).
> > >
> > >My solutions having not worked, I was wondering if anyone could point
> > >me to a working method for parsing the STL for autocompletion. Thank
> > >you in advance for any help you can offer, as I have been trying to
> > >solve this for an extremely long time.
> > [ ... ]
> >
> > Hi,
> >
> > If your code looks like this:
> >
> > --------
> > // Start of file
> > #include <string>
> >
> > int main() {
> > std::string::re
> >
> > }
> > -------
> >
> > Then your problem is because semantic isn't very good an handling
> > name resolution in a type name like that. If instead you did:
> >
> > --------
> > // Start of file
> > #include <string>
> >
> > int main() {
> > std::string s;
> >
> > s.
> > }
> > -------
> >
> > and completed after the s, then you would get a lot of stuff.
> >
> > A quick look indicates to me that the typedef resolution is getting
> > things confused while trying to handle the namespace expansion. As no
> > one had asked to get this working before, it took me a while to figure
> > out what is going on. I was able to check in a change to CVS to make
> > this particular case work for my STL libraries. I haven't done much
> > other testing though.
> >
> > Eric
> >
> > --
> > Eric Ludlam: eric@...
> > Siege: http://www.siege-engine.com Emacs: http://cedet.sourceforge.net
>
>First and foremost, thank you very much for your prompt response. When I do type:
>------------------
>#include <string>
>
>int main()
>{
> std::string s;
>
> s.
>------------------ (with the closing brace at the end of
>main() included) I still get no completion; the error is "cannot find
>types for std::string s" when I initiate
>semantic-ia-complete-symbol-menu. I compiled a custom kernel, and
>evaluating semantic-lex-c-preprocessor-symbol-file returns
>"/usr/include/c++/4.3.3/x86_64-unknown-linux-gnu/bits/c++config.h".
>I have tried adding iostream and string to
>semantic-lex-c-preprocessor-symbol-file without effect.
>
>Thank you again for your response,
[ ... ]
Hi,
For STL, there should be little need to setup complex
semantic-lex-c-preprocessor-symbol-file settings. That is for setting
up custom macros.
The next logical step for you is to start debugging the environment
semantic creates to try and figure out what is going on. If you are
using a CVS version of CEDET, that would be best so we can share code.
The best place to start is with:
M-x semantic-analyze-debug-assist RET
and see what suggestions it has. I'd guess it is a combination of
some unparsed header, and the typecache.
After looking at the state of the includes, you can see the
typecache for your file with this.
M-x semanticdb-typecache-dump RET
This goes into a data-debug mode. Look into the includestream for
std:, then for string. It ought to be a typedef. Check out the name
of that typedef and make sure that also shows up in the list of tags.
If you can't trace the types, then semantic can't either. Then look
into the header files to deduce what the syntax is that is preventing
Semantic from parsing it.
Good Luck
Eric
--
Eric Ludlam: eric@...
Siege: http://www.siege-engine.com Emacs: http://cedet.sourceforge.net
|