Re: [cedet-semantic] intellisense bug?
Brought to you by:
zappo
|
From: Eric M. L. <er...@si...> - 2007-03-11 01:36:45
|
This is a good find!
After making you change, I set up a couple challenging examples to
test against, and found and fixed a different bug elsewhere in the
code too when looking up data types.
I've updated semantic-analyze.el in CVS. Since an extra difficult
test loop was being made, I combined the two tests into one loop.
Try it out and let me know how it goes.
Thanks!
Eric
>>> "Jamie Macbeth" <ma...@cs...> seems to think that:
>Hi,
>
>I really dig the intellisense functionality of semantic. I want to
>try to fix what i think is a bug within
>semantic-analyze-possible-completions-default. I discovered that in
>my c code, when i try to complete on the right side of an assignment
>like this:
>
>A foo, bar;
>foo.member = ba
>
>semantic usually has no completions. it should complete bar. it
>looks like semantic is correctly parsing the left half of the
>assignment and comes up with a type constraint for the right side of
>the assignment. in semantic-analyze-possible-completions-default, the
>result of semantic-analyze-type-constraint is contained in
>"desired-type." if the completion tag "bar" is not the same type as
>"member" in the above code, it tries to determine if bar might be a
>compound type using this code ...
>
> ;; Now anything that is a compound type which could contain
> ;; additional things which are of the desired type
> (setq c (append c (semantic-find-tags-of-compound-type origc)))
>
>The problem is that semantic-find-tags-of-compound-type tries to find
>a "members" field and a tag doesn't seem to have a "members" field. i
>replaced this bit of code with the result from a full analysis of the
>tag. it seems to work. sorry if it's cumbersome and inefficient ...
>i'm a beginner at elisp
>
> (setq c (append c
> (mapcar
> (function (lambda (x)
> (if (semantic-tag-type-members
> (semantic-analyze-tag-type x (oref a scope)))
> x
> )
> )) origc )))
>
>
>is there a more elegant way to do this? please point me in the write
>direction and i can send a better patch. Also, I think we should
>include the tag if it isn't in the database, because it may or may not
>have members. we may not know, right?
[ ... ]
--
Eric Ludlam: za...@gn..., er...@si...
Home: http://www.ludlam.net Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: www.gnu.org
|