Function: semantic-analyze-scoped-types-default

semantic-analyze-scoped-types-default is a byte-compiled function defined in scope.el.gz.

Signature

(semantic-analyze-scoped-types-default POSITION)

Documentation

Return a list of types currently in scope at POSITION.

Use semantic-ctxt-scoped-types to find types.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/scope.el.gz
(defun semantic-analyze-scoped-types-default (position)
  "Return a list of types currently in scope at POSITION.
Use `semantic-ctxt-scoped-types' to find types."
  (require 'semantic/db-typecache)
  (save-excursion
    (goto-char position)
    (let ((code-scoped-types nil))
      ;; Let's ask if any types are currently scoped.  Scoped
      ;; classes and types provide their public methods and types
      ;; in source code, but are unrelated hierarchically.
      (let ((sp (semantic-ctxt-scoped-types)))
	(while sp
	  ;; Get this thing as a tag
	  (let ((tmp (cond
		      ((stringp (car sp))
		       (or (semanticdb-typecache-find (car sp))
			   ;; If we did not find it in the typecache,
			   ;; look in the tags we found so far
			   (car (semantic-deep-find-tags-by-name
				 (car sp)
				 code-scoped-types))))
		      ((semantic-tag-p (car sp))
		       (if (semantic-tag-prototype-p (car sp))
			   (or (semanticdb-typecache-find (semantic-tag-name (car sp)))
			       (car (semantic-deep-find-tags-by-name
				     (semantic-tag-name (car sp))
				     code-scoped-types)))
			 (car sp)))
		      (t nil))))
	    (when tmp
	      (setq code-scoped-types
		    (cons tmp code-scoped-types))))
	  (setq  sp (cdr sp))))
      (setq code-scoped-types (nreverse code-scoped-types))

      (when code-scoped-types
	(semanticdb-typecache-merge-streams code-scoped-types nil))

      )))