+(define-mode-local-override semantic-ctxt-imported-packages c++-mode (&optional point)
+ "Return the list of using tag types in scope of POINT."
+ (when point (goto-char (point)))
+ (let ((tagsaroundpoint (semantic-find-tag-by-overlay))
+ (namereturn nil)
+ (tmp nil)
+ )
+ ;; Collect using statements from the top level.
+ (setq tmp (semantic-find-tags-by-class 'using (current-buffer)))
+ (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
+ ;; Move through the tags around point looking for more using statements
+ (while (cdr tagsaroundpoint) ; don't search the last one
+ (setq tmp (semantic-find-tags-by-class 'using (semantic-tag-components (car tagsaroundpoint))))
+ (dolist (T tmp) (setq namereturn (cons (semantic-tag-type T) namereturn)))
+ (setq tagsaroundpoint (cdr tagsaroundpoint))
+ )
+ namereturn))
+
+(define-mode-local-override semanticdb-expand-nested-tag c++-mode (tag)
+ "Expand TAG if it has a fully qualified name.
+For types with a :parent, create faux namespaces to put TAG into."
+ (let ((p (semantic-tag-get-attribute tag :parent)))
+ (if (and p (semantic-tag-of-class-p tag 'type))
+ ;; Expand the tag
+ (let ((s (semantic-analyze-split-name p))
+ (newtag (semantic-tag-copy tag nil t)))
+ ;; Erase the qualified name.
+ (semantic-tag-put-attribute newtag :parent nil)
+ ;; Fixup the namespace name
+ (setq s (if (stringp s) (list s) (nreverse s)))
+ ;; Loop over all the parents, creating the nested
+ ;; namespace.
+ (require 'semantic/db-typecache)
+ (dolist (namespace s)
+ (setq newtag (semanticdb-typecache-faux-namespace
+ namespace (list newtag)))
+ )
+ ;; Return the last created namespace.
+ newtag)
+ ;; Else, return tag unmodified.
+ tag)))
+