From: Eric Ludlam Date: Sun, 22 Mar 2015 21:36:16 +0000 (-0400) Subject: semantic: Incorporate local scope when finding type X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=85713839e192ed03ba028c760688ae23b134cd5c;p=emacs.git semantic: Incorporate local scope when finding type * lisp/cedet/semantic/analyze/fcn.el (semantic-analyze-tag-type): When first search fails, calc scope from the originating tag, and try again. --- diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el index 1abbca5158e..24f71bbf84c 100644 --- a/lisp/cedet/semantic/analyze/fcn.el +++ b/lisp/cedet/semantic/analyze/fcn.el @@ -183,7 +183,16 @@ Optional SCOPE represents a calculated scope in which the types might be found. This can be nil. If NOMETADEREF, then do not dereference metatypes. This is used by the analyzer debugger." - (semantic-analyze-type (semantic-tag-type tag) scope nometaderef)) + (or + (semantic-analyze-type (semantic-tag-type tag) scope nometaderef) + ;; If we didn't find it the 'quick' way with the passed in scope, + ;; perhaps the type is using a shorthand only available from the + ;; location of TAG, which might be a member of some struct far away + ;; from the original source that spawned the search. + (let ((tagscope (semantic-calculate-scope-for-tag tag))) + (when tagscope + (semantic-analyze-type (semantic-tag-type tag) + tagscope nometaderef))))) (defun semantic-analyze-type (type-declaration &optional scope nometaderef) "Return the semantic tag for TYPE-DECLARATION.