Re: [cedet-semantic] semantic-analyze-current-context search failure
Brought to you by:
zappo
|
From: Eric M. L. <er...@si...> - 2007-06-19 02:54:54
|
Thanks for the info. I will investigate your option 1. In order to
allow the use of alternate back ends that only support search by name,
I had tried to get rid of more complex searches.
By searching only the scope with the complex search, then the same
advantage would be lost for searches in a more global scope via DBs
that are lacking in that feature.
Anyway, stuff to figure out.
Do you happen to have a simple example that shows the problem I can
work with?
Thanks!
Eric
>>> Nikolaj Schumacher <n_s...@we...> seems to think that:
>--=-=-=
>
>Hello,
>
>I've tried to use `semantic-analyze-current-context', but I kept getting
>strings instead of tags in many cases.
>
>I believe the reason for this is in `semantic-analyze-find-tag', which
>searches the current scope _by name_. This however returned the
>constructor instead of a class name in my case (which was discarded
>later), thus the database was never searched.
>
>There are two ways to fix this:
>
>1) Search the scope using `semantic-find-tags-by-name-and-class' (which
>doesn't exist yet) instead of `semantic-find-tags-by-name'.
>
>2) Always search both scope and database and concat the result.
>
>I've attached #2 as a patch to illustrate. #1 would be more efficient,
>though.
>
>regards,
>Nikolaj Schumacher
>
>
>--=-=-=
>Content-Type: text/x-patch
>Content-Disposition: inline; filename=semantic-find-type.patch
>Content-Description: patch
>
>cvs diff: warning: failed to open /Users/nik/.cvspass for reading: No such file or directory
>Index: semantic-analyze.el
>===================================================================
>RCS file: /cvsroot/cedet/cedet/semantic/semantic-analyze.el,v
>retrieving revision 1.53
>diff -d -u -r1.53 semantic-analyze.el
>--- semantic-analyze.el 17 May 2007 15:46:42 -0000 1.53
>+++ semantic-analyze.el 15 Jun 2007 20:29:55 -0000
>@@ -137,7 +137,7 @@
> (eq (semantic-tag-class ans) 'type)
> (not (semantic-tag-type-members ans)))
> (semantic-analyze-find-tag
>- (semantic-tag-name ans) nil scope))
>+ (semantic-tag-name ans) 'type scope))
> (t nil)))))
>
> ;;; SELECTING/MERGING
>@@ -251,17 +251,17 @@
> ;; If NAME is solo, then do our searches for it here.
> ((stringp namelst)
> (let ((retlist
>- (or (and scope (semantic-find-tags-by-name name scope))
>- (if (and (fboundp 'semanticdb-minor-mode-p)
>- (semanticdb-minor-mode-p))
>- ;; Search the database
>- (semanticdb-strip-find-results
>- (semanticdb-find-tags-by-name name)
>- ;; This T means to find files for matching symbols
>- t)
>- ;; Search just this file
>- (semantic-find-tags-by-name
>- name (current-buffer))))))
>+ (append (and scope (semantic-find-tags-by-name name scope))
>+ (if (and (fboundp 'semanticdb-minor-mode-p)
>+ (semanticdb-minor-mode-p))
>+ ;; Search the database
>+ (semanticdb-strip-find-results
>+ (semanticdb-find-tags-by-name name)
>+ ;; This T means to find files for matching symbols
>+ t)
>+ ;; Search just this file
>+ (semantic-find-tags-by-name
>+ name (current-buffer))))))
>
> (semantic-analyze-select-best-tag retlist tagclass))))))
>
[ ... ]
--
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
|