comparison lisp/cedet/semantic/db-find.el @ 104441:902d22a2d922

cedet/semantic/db-debug.el: Don't require semantic/db-mode, since semanticdb-current-database and semanticdb-current-table are now in semantic/db.el. cedet/semantic/db-ebrowse.el: Don't require semantic/db-mode, since semanticdb-current-database and semanticdb-current-table are now in semantic/db.el. cedet/semantic/db-el.el: Require semantic/lex-spp. Require semantic/db instead of semantic/db-search. cedet/semantic/db-file.el: Declare inversion-test and data-debug-insert-thing. (semanticdb-load-database): Load inversion only if necessary. cedet/semantic/db-find.el: Autoload semanticdb-find-default-throttle. Defvar data-debug-thing-alist, and ede-current-project. Declare data-debug-insert-stuff-list, data-debug-insert-tag-list, semantic-scope-reset-cache, and semanticdb-typecache-notify-reset. Require semantic/tag-file, and semantic/sort. (semantic-reset): Require semantic/scope. (semanticdb-partial-synchronize): Require semantic/db-typecache. (semanticdb-find-table-for-include) Move up to avoid compiler warning. cedet/semantic/db-global.el: Declare data-debug-new-buffer and data-debug-insert-thing. (semanticdb-project-database-global) Move up to avoid compiler warning. cedet/semantic/db-javascript.el: Fix provide statement. Require semantic/db-find instead of semantic/db-search. cedet/semantic/db-mode.el: Declare semantic-lex-spp-set-dynamic-table. (semanticdb-current-database, semanticdb-current-table): Move into semantic/db.el cedet/semantic/db-ref.el: Require eieio, semantic/db, and semantic/util. Declare data-debug-new-buffer and data-debug-insert-object-slots. Defvar semantic-case-fold. Require semantic/find when compiling. cedet/semantic/db-typecache.el: Require semantic/tag-ls, semantic/analyze/fcn, and semantic/scope. Declare data-debug-insert-thing and data-debug-new-buffer. cedet/semantic/db.el (semanticdb-search-results-table): Move class definition here from semantic/db-search.el. (semanticdb-current-database, semanticdb-current-table) Move variable definitions here from semantic/db-mode.el.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 31 Aug 2009 00:45:41 +0000
parents da5b2513c225
children b22b44e953cb
comparison
equal deleted inserted replaced
104440:8af937a89d62 104441:902d22a2d922
119 (require 'semantic/db-ref) 119 (require 'semantic/db-ref)
120 (eval-when-compile 120 (eval-when-compile
121 (require 'eieio) 121 (require 'eieio)
122 ) 122 )
123 123
124 (require 'semantic/find)
125
126 (require 'semantic/tag-file)
127 (require 'semantic/sort)
128
124 ;;; Code: 129 ;;; Code:
130
131 (defvar data-debug-thing-alist)
132 (declare-function data-debug-insert-stuff-list "data-debug")
133 (declare-function data-debug-insert-tag-list "data-debug")
134 (declare-function semantic-scope-reset-cache "semantic/scope")
135 (declare-function semanticdb-typecache-notify-reset "semantic/db-typecache")
136 (declare-function ede-current-project "ede")
137
125 (defvar semanticdb-find-throttle-custom-list 138 (defvar semanticdb-find-throttle-custom-list
126 '(repeat (radio (const 'local) 139 '(repeat (radio (const 'local)
127 (const 'project) 140 (const 'project)
128 (const 'unloaded) 141 (const 'unloaded)
129 (const 'system) 142 (const 'system)
130 (const 'recursive) 143 (const 'recursive)
131 (const 'omniscience))) 144 (const 'omniscience)))
132 "Customization values for semanticdb find throttle. 145 "Customization values for semanticdb find throttle.
133 See `semanticdb-find-throttle' for details.") 146 See `semanticdb-find-throttle' for details.")
134 147
148 ;;;###autoload
135 (defcustom semanticdb-find-default-throttle 149 (defcustom semanticdb-find-default-throttle
136 '(local project unloaded system recursive) 150 '(local project unloaded system recursive)
137 "The default throttle for `semanticdb-find' routines. 151 "The default throttle for `semanticdb-find' routines.
138 The throttle controls how detailed the list of database 152 The throttle controls how detailed the list of database
139 tables is for a symbol lookup. The value is a list with 153 tables is for a symbol lookup. The value is a list with
186 "Concrete search index for `semanticdb-find'. 200 "Concrete search index for `semanticdb-find'.
187 This class will cache data derived during various searches.") 201 This class will cache data derived during various searches.")
188 202
189 (defmethod semantic-reset ((idx semanticdb-find-search-index)) 203 (defmethod semantic-reset ((idx semanticdb-find-search-index))
190 "Reset the object IDX." 204 "Reset the object IDX."
205 (require 'semantic/scope)
191 ;; Clear the include path. 206 ;; Clear the include path.
192 (oset idx include-path nil) 207 (oset idx include-path nil)
193 (when (oref idx type-cache) 208 (when (oref idx type-cache)
194 (semantic-reset (oref idx type-cache))) 209 (semantic-reset (oref idx type-cache)))
195 ;; Clear the scope. Scope doesn't have the data it needs to track 210 ;; Clear the scope. Scope doesn't have the data it needs to track
231 (oref idx table) 246 (oref idx table)
232 (lambda (tab me) 247 (lambda (tab me)
233 (let ((tab-idx (semanticdb-get-table-index tab))) 248 (let ((tab-idx (semanticdb-get-table-index tab)))
234 ;; Not a full reset? 249 ;; Not a full reset?
235 (when (oref tab-idx type-cache) 250 (when (oref tab-idx type-cache)
251 (require 'db-typecache)
236 (semanticdb-typecache-notify-reset 252 (semanticdb-typecache-notify-reset
237 (oref tab-idx type-cache))) 253 (oref tab-idx type-cache)))
238 ))) 254 )))
239 )) 255 ))
240 )) 256 ))
297 ;; nil means perform the search over these results. 313 ;; nil means perform the search over these results.
298 nil 314 nil
299 (if brutish 315 (if brutish
300 (semanticdb-find-translate-path-brutish-default path) 316 (semanticdb-find-translate-path-brutish-default path)
301 (semanticdb-find-translate-path-includes-default path)))) 317 (semanticdb-find-translate-path-includes-default path))))
318
319 (define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
320 "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
321 INCLUDETAG is a semantic TAG of class 'include.
322 TABLE is a semanticdb table that identifies where INCLUDETAG came from.
323 TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
324 )
302 325
303 (defun semanticdb-find-translate-path-brutish-default (path) 326 (defun semanticdb-find-translate-path-brutish-default (path)
304 "Translate PATH into a list of semantic tables. 327 "Translate PATH into a list of semantic tables.
305 Default action as described in `semanticdb-find-translate-path'." 328 Default action as described in `semanticdb-find-translate-path'."
306 (let ((basedb 329 (let ((basedb
580 603
581 (defun semanticdb-find-load-unloaded-default (filename) 604 (defun semanticdb-find-load-unloaded-default (filename)
582 "Load an unloaded file in FILENAME using the default semanticdb loader." 605 "Load an unloaded file in FILENAME using the default semanticdb loader."
583 (semanticdb-file-table-object filename)) 606 (semanticdb-file-table-object filename))
584 607
585 (define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
586 "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
587 INCLUDETAG is a semantic TAG of class 'include.
588 TABLE is a semanticdb table that identifies where INCLUDETAG came from.
589 TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
590 )
591
592 (defun semanticdb-find-table-for-include-default (includetag &optional table) 608 (defun semanticdb-find-table-for-include-default (includetag &optional table)
593 "Default implementation of `semanticdb-find-table-for-include'. 609 "Default implementation of `semanticdb-find-table-for-include'.
594 Uses `semanticdb-current-database-list' as the search path. 610 Uses `semanticdb-current-database-list' as the search path.
595 INCLUDETAG and TABLE are documented in `semanticdb-find-table-for-include'. 611 INCLUDETAG and TABLE are documented in `semanticdb-find-table-for-include'.
596 Included databases are filtered based on `semanticdb-find-default-throttle'." 612 Included databases are filtered based on `semanticdb-find-default-throttle'."
1077 "\n") 1093 "\n")
1078 ) 1094 )
1079 (semanticdb-find-log-move-to-end))) 1095 (semanticdb-find-log-move-to-end)))
1080 1096
1081 ;;; Semanticdb find API functions 1097 ;;; Semanticdb find API functions
1082 ;;
1083 ;; These are the routines actually used to perform searches. 1098 ;; These are the routines actually used to perform searches.
1084 ;; 1099 ;;
1085 (defun semanticdb-find-tags-collector (function &optional path find-file-match 1100 (defun semanticdb-find-tags-collector (function &optional path find-file-match
1086 brutish) 1101 brutish)
1087 "Collect all tags returned by FUNCTION over PATH. 1102 "Collect all tags returned by FUNCTION over PATH.