comparison lisp/cedet/semantic/scope.el @ 104446:df08b7ab0ba0

lisp/cedet/semantic/analyze.el: Add local vars for autoloading. (semantic-analyze-current-context): Autoload. lisp/cedet/semantic/ctxt.el: Add local vars for autoloading. Don't eval-when-compile semantic/db (semantic-ctxt-current-mode): Autoload. (semantic-up-context): Require semantic/find. lisp/cedet/semantic/find.el (semantic-current-tag-parent) (semantic-find-tags-by-scope-protection): Autoload. lisp/cedet/semantic/format.el (semantic-format-tag-prototype) (semantic-format-tag-summarize): Autoload. lisp/cedet/semantic/idle.el: Declare external functions. (semantic-idle-work-for-one-buffer, semantic-idle-work-core-handler): Require semantic/db-mode. (semantic-idle-work-core-handler): Synch to upstream. (semantic-idle-scheduler-refresh-tags): Require semantic/decorate/mode. (semantic-idle-summary-find-current-symbol-tag): Require semantic/db-find. (semantic-idle-summary-current-symbol-info-context): Require semantic/analyze. (semantic-idle-summary-maybe-highlight, semantic-idle-tag-highlight): Require pulse. (semantic-idle-completion-list-default): Require semantic/complete. lisp/cedet/semantic/lex-spp.el: Require semantic. (semantic-lex-spp-analyzer-push-tokens-for-symbol): Synch to upstream. (semantic-lex-spp-first-token-arg-list): Use split-string. lisp/cedet/semantic/lex.el: Declare semantic-elapsed-time. Add local vars for autoloading. (semantic-lex-test): Require semantic. (semantic-lex): Autoload. (semantic-flex): Use semantic-lex-keyword-p to avoid compiler warning. lisp/cedet/semantic/sb.el: Require semantic/sort. Declare semanticdb-minor-mode-p. (semantic-sb-fetch-tag-table): Require semantic/db-mode. lisp/cedet/semantic/scope.el: eval-when-compile semantic/find. Declare external functions. (semantic-analyze-scope-nested-tags-default): Require semantic/analyze. (semantic-analyze-show): Require semantic/analyze. (semantic-calculate-scope): Require semantic/db-typecache. lisp/cedet/semantic/sort.el: Add local vars for autoloading. Declare semanticdb-find-tags-external-children-of-type. (semantic-flatten-tags-table, semantic-tag-external-member-parent): Autoload. (semantic-tag-external-member-children-default): Require semantic/db-find. lisp/cedet/semantic/symref.el: Require semantic. Declare data-debug-new-buffer and data-debug-insert-object-slots. (semantic-symref-data-debug-last-result): Require eieio-datadebug. lisp/cedet/semantic/tag-file.el: Declare external functions. (semantic-go-to-tag): Call semanticdb-table-child-p only if semantic/db is loaded. (semantic-dependency-tag-file): Require semantic/dep. lisp/cedet/semantic/tag-ls.el: Require semantic. Add local variables for autoloading. (semantic-tag-prototype-p): Autoload. lisp/cedet/semantic/tag-write.el: Require semantic. lisp/cedet/semantic/tag.el: Update external function declarations and requirements, removing autoloaded functions. Add local vars for autoloading. (semantic-tag-components): Autoload. lisp/cedet/semantic/texi.el: Declare lookup-words. eval-when-compile semantic/find. lisp/cedet/semantic/util.el: Update file header. lisp/cedet/semantic/analyze/complete.el: Add local variables for autoloading. (semantic-analyze-possible-completions, semantic-analyze-type-constants): Autoload.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 03 Sep 2009 03:58:13 +0000
parents 52067a6bf088
children ee7637f5d6de
comparison
equal deleted inserted replaced
104445:43eb1ff3a976 104446:df08b7ab0ba0
47 47
48 (require 'semantic/db) 48 (require 'semantic/db)
49 (require 'semantic/analyze/fcn) 49 (require 'semantic/analyze/fcn)
50 (require 'semantic/ctxt) 50 (require 'semantic/ctxt)
51 51
52 (eval-when-compile (require 'semantic/find)) ; For semantic-find-* macros
53
54 (declare-function data-debug-show "eieio-datadebug")
55 (declare-function semantic-analyze-find-tag "semantic/analyze")
56 (declare-function semantic-analyze-princ-sequence "semantic/analyze")
57 (declare-function semanticdb-typecache-merge-streams "semantic/db-typecache")
58 (declare-function semanticdb-typecache-add-dependant "semantic/db-typecache")
52 59
53 ;;; Code: 60 ;;; Code:
54 61
55 (defclass semantic-scope-cache (semanticdb-abstract-cache) 62 (defclass semantic-scope-cache (semanticdb-abstract-cache)
56 ((tag :initform nil 63 ((tag :initform nil
173 types available.") 180 types available.")
174 181
175 (defun semantic-analyze-scoped-types-default (position) 182 (defun semantic-analyze-scoped-types-default (position)
176 "Return a list of types currently in scope at POSITION. 183 "Return a list of types currently in scope at POSITION.
177 Use `semantic-ctxt-scoped-types' to find types." 184 Use `semantic-ctxt-scoped-types' to find types."
185 (require 'semantic/db-typecache)
178 (save-excursion 186 (save-excursion
179 (goto-char position) 187 (goto-char position)
180 (let ((code-scoped-types nil)) 188 (let ((code-scoped-types nil))
181 ;; Lets ask if any types are currently scoped. Scoped 189 ;; Lets ask if any types are currently scoped. Scoped
182 ;; classes and types provide their public methods and types 190 ;; classes and types provide their public methods and types
219 identify it's scope via overlay instead. 227 identify it's scope via overlay instead.
220 Optional SCOPETYPES are additional scoped entities in which our parent might 228 Optional SCOPETYPES are additional scoped entities in which our parent might
221 be found. 229 be found.
222 This only finds ONE immediate parent by name. All other parents returned 230 This only finds ONE immediate parent by name. All other parents returned
223 are from nesting data types." 231 are from nesting data types."
232 (require 'semantic/analyze)
224 (save-excursion 233 (save-excursion
225 (if position (goto-char position)) 234 (if position (goto-char position))
226 (let* ((stack (reverse (semantic-find-tag-by-overlay (point)))) 235 (let* ((stack (reverse (semantic-find-tag-by-overlay (point))))
227 (tag (car stack)) 236 (tag (car stack))
228 (pparent (car (cdr stack))) 237 (pparent (car (cdr stack)))
574 583
575 (defun semantic-analyze-scoped-inherited-tag-map (type fcn scope) 584 (defun semantic-analyze-scoped-inherited-tag-map (type fcn scope)
576 "Map all parents of TYPE to FCN. Return tags of all the types. 585 "Map all parents of TYPE to FCN. Return tags of all the types.
577 Argument SCOPE specify additional tags that are in scope 586 Argument SCOPE specify additional tags that are in scope
578 whose tags can be searched when needed, OR it may be a scope object." 587 whose tags can be searched when needed, OR it may be a scope object."
588 (require 'semantic/analyze)
579 (let* (;; PARENTS specifies only the superclasses and not 589 (let* (;; PARENTS specifies only the superclasses and not
580 ;; interfaces. Inheriting from an interfaces implies 590 ;; interfaces. Inheriting from an interfaces implies
581 ;; you have a copy of all methods locally. I think. 591 ;; you have a copy of all methods locally. I think.
582 (parents (semantic-tag-type-superclasses type)) 592 (parents (semantic-tag-type-superclasses type))
583 ps pt 593 ps pt
645 "Calculate the scope at POINT. 655 "Calculate the scope at POINT.
646 If POINT is not provided, then use the current location of point. 656 If POINT is not provided, then use the current location of point.
647 The class returned from the scope calculation is variable 657 The class returned from the scope calculation is variable
648 `semantic-scope-cache'." 658 `semantic-scope-cache'."
649 (interactive) 659 (interactive)
650 (if (not (and (featurep 'semanticdb) semanticdb-current-database)) 660 (if (not (and (featurep 'semantic/db) semanticdb-current-database))
651 nil ;; Don't do anything... 661 nil ;; Don't do anything...
662 (require 'semantic/db-typecache)
652 (if (not point) (setq point (point))) 663 (if (not point) (setq point (point)))
653 (when (interactive-p) 664 (when (interactive-p)
654 (semantic-fetch-tags) 665 (semantic-fetch-tags)
655 (semantic-scope-reset-cache) 666 (semantic-scope-reset-cache)
656 ) 667 )
712 ))) 723 )))
713 ;; Make sure we become dependant on the typecache. 724 ;; Make sure we become dependant on the typecache.
714 (semanticdb-typecache-add-dependant scopecache) 725 (semanticdb-typecache-add-dependant scopecache)
715 ;; Handy debug output. 726 ;; Handy debug output.
716 (when (interactive-p) 727 (when (interactive-p)
728 (require 'eieio-datadebug)
717 (data-debug-show scopecache) 729 (data-debug-show scopecache)
718 ) 730 )
719 ;; Return ourselves 731 ;; Return ourselves
720 scopecache)))) 732 scopecache))))
721 733
781 793
782 ;;; DUMP 794 ;;; DUMP
783 ;; 795 ;;
784 (defmethod semantic-analyze-show ((context semantic-scope-cache)) 796 (defmethod semantic-analyze-show ((context semantic-scope-cache))
785 "Insert CONTEXT into the current buffer in a nice way." 797 "Insert CONTEXT into the current buffer in a nice way."
798 (require 'semantic-analyze)
786 (semantic-analyze-princ-sequence (oref context scopetypes) "-> ScopeTypes: " ) 799 (semantic-analyze-princ-sequence (oref context scopetypes) "-> ScopeTypes: " )
787 (semantic-analyze-princ-sequence (oref context parents) "-> Parents: " ) 800 (semantic-analyze-princ-sequence (oref context parents) "-> Parents: " )
788 (semantic-analyze-princ-sequence (oref context scope) "-> Scope: " ) 801 (semantic-analyze-princ-sequence (oref context scope) "-> Scope: " )
789 ;;(semantic-analyze-princ-sequence (oref context fullscope) "Fullscope: " ) 802 ;;(semantic-analyze-princ-sequence (oref context fullscope) "Fullscope: " )
790 (semantic-analyze-princ-sequence (oref context localargs) "-> Local Args: " ) 803 (semantic-analyze-princ-sequence (oref context localargs) "-> Local Args: " )