Eric, thanks for you precious help.
I still have some questions... :-P
> In order for the context analyzer to work, the struct must be
> complete (you need a semi-colon at the end)
Oh, sorry for the typo. Anyway I was writing by heart... the real code
that I tried did have the semicolon.
Maybe it's that I was not calling bovinate.
> and the function must also be parenthetically correct at least once
> during a parse phase.
So I must fist write the skeleton of the function whose code I'm
writing, complete with curly braces {}, and then write inside it? Good
to know! No big deal.
> Once you fix that, you can use "M-x bovinate" to force the system
> to synchronize your new file.
That's it! I was looking for a function to reparse the file, and I
couldn't find one (I only looked among the functions starting with
"semantic-").
So let me be sure I've got it: there is NO parsing done in the
background? i.e. any time I change a prototype I must manually call
bovinate? Never mind, I'll set up a shortcut.
>
> Next, there is an existing bug where you need at least one
> character after the . or -> before the local context parser will
> work.
>
That doesn't seem to be true... if I only write
my_struct m;
m.
it displays all the members, which seems correct.
I have some issues I'd like to point to your attention:
- I noticed that semantic-analyze-possible-completions was not
available with M-x until I called M-x speedbar. Is that normal?
- If I write the first letter of a member variable (say 'r'), e.g.
my_struct m;
m.r
and then call semantic-analyze-possible-completions, the completions
do appear (starting with the letter r), but the cursor is moved
before r, thus forcing me to write C-e to go to the end of the line
(and then write the rest of the name).
- IMHO Semantic would be better if it allowed you to move inside the
completion buffer with C-n C-p, and to select the completion you
want (e.g. by pressing ENTER). i.e. so far it only lists the
possible completions, but once you've chosen one, you must type it
by hand.
- char my_char;
....
my_char = 'a';
When I place the cursor on the second occurrence of my_char, its
type is not displayed on the minibuffer. It would be nice to know
the type of a variable without finding its declaration.
- why does M-x bovinate not leave the focus (cursor) in the current
window? It seems I must call bovinate very often, and each time I
must do C-x o to get back... this is unpractical.
- When I type a function call, the arguments correctly appear in the
minibuffer, but the current argument is not highlighted. e.g. if I
have written
f(3,4,
I would like the third argument in the minibuffer to be more
evident, maybe bold.
These problems make me feel I am using semantic in a way it was not
supposed to be used (e.g as if it were Microsoft's Visual Studio, or
WholeTomato's Visual Assist under Windows).
Are you aware of these problems and planning to fix them?
> [ ... ]
>
> >2) In case Semantic can display possible completions: how does it
> >choose them? I mean, I should only see the public members if I'm
> >outside of the class; also the private ones if I'm inside; the
> >protected members if I am inside a derived class, and so on...
> >And what about static members, which should only be available in a static
> >member function?
>
> Right now the analyzer only works inside a function,
I can't see a problem with it... provided you mean "member functions"
also.
> and as I mentioned above, only after you have typed in at least one
> character.
>
> In addition, it will only find completions in your project. It
> will not find completions from system files unless you add them to
> the project.
Let me be sure I've got it. IN order to have completion of the members
of stl::vector and stl::string I must do
(setq semanticdb-project-roots
(list "/usr/include/c++/3.2/"))
in my .emacs?
> Lastly, it will not find completions in files you have not visited
> at least once with Emacs.
No big deal. So I must manually visit "vector" and "string".
Are you planning to fix that?;
> There are also some other cases where completions might not be
> found related to parent classes, and namespaces. Right now the
> completion engine is not language specific, and does not yet have
> many extension mechanisms.
Ok.
Thanks again,
ciao
Maurizio
|