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
>>> Nikolaj Schumacher <n_schumacher@...> seems to think that:
>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,
>Content-Disposition: inline; filename=semantic-find-type.patch
>cvs diff: warning: failed to open /Users/nik/.cvspass for reading: No such file or directory
>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-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)
>- ;; Search the database
>- (semanticdb-find-tags-by-name name)
>- ;; This T means to find files for matching symbols
>- ;; Search just this file
>- name (current-buffer))))))
>+ (append (and scope (semantic-find-tags-by-name name scope))
>+ (if (and (fboundp 'semanticdb-minor-mode-p)
>+ ;; Search the database
>+ (semanticdb-find-tags-by-name name)
>+ ;; This T means to find files for matching symbols
>+ ;; Search just this file
>+ name (current-buffer))))))
> (semantic-analyze-select-best-tag retlist tagclass))))))
[ ... ]
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org