(require 'data-debug)
(require 'semantic/db)
-(require 'semantic/db-mode)
(require 'semantic/format)
;;; Code:
(require 'eieio-opt)
)
(require 'semantic/db-file)
-(require 'semantic/db-mode)
(require 'semantic/find)
(require 'semantic/sort)
(require 'data-debug)
-;;; db-el.el --- Semantic database extensions for Emacs Lisp
+;;; semantic/db-el.el --- Semantic database extensions for Emacs Lisp
;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
;;; Free Software Foundation, Inc.
;; to also work in Emacs Lisp with no compromises.
;;
-(require 'semantic/db-search)
+(require 'semantic/db)
+
(eval-when-compile
;; For generic function searching.
(require 'eieio)
(provide 'semantic/db-el)
-;;; semanticdb-el.el ends here
+;;; semantic/db-el.el ends here
-;;; db-file.el --- Save a semanticdb to a cache file.
+;;; semantic/db-file.el --- Save a semanticdb to a cache file.
;;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
;;; Free Software Foundation, Inc.
db))
;;; File IO
+
+(declare-function inversion-test "inversion")
+
(defun semanticdb-load-database (filename)
"Load the database FILENAME."
- (require 'inversion)
(condition-case foo
(let* ((r (eieio-persistent-read filename))
(c (semanticdb-get-database-tables r))
(while c
(oset (car c) parent-db r)
(setq c (cdr c)))
- (if (not (inversion-test 'semanticdb-file fv))
- (when (inversion-test 'semantic-tag tv)
- ;; Incompatible version. Flush tables.
- (semanticdb-flush-database-tables r)
- ;; Reset the version to new version.
- (oset r semantic-tag-version semantic-tag-version)
- ;; Warn user
- (message "Semanticdb file is old. Starting over for %s"
- filename)
- )
- ;; Version is not ok. Flush whole system
- (message "semanticdb file is old. Starting over for %s"
- filename)
- ;; This database is so old, we need to replace it.
- ;; We also need to delete it from the instance tracker.
- (delete-instance r)
- (setq r nil))
+ (unless (and (equal semanticdb-file-version fv)
+ (equal semantic-tag-version tv))
+ ;; Try not to load inversion unless we need it:
+ (require 'inversion)
+ (if (not (inversion-test 'semanticdb-file fv))
+ (when (inversion-test 'semantic-tag tv)
+ ;; Incompatible version. Flush tables.
+ (semanticdb-flush-database-tables r)
+ ;; Reset the version to new version.
+ (oset r semantic-tag-version semantic-tag-version)
+ ;; Warn user
+ (message "Semanticdb file is old. Starting over for %s"
+ filename))
+ ;; Version is not ok. Flush whole system
+ (message "semanticdb file is old. Starting over for %s"
+ filename)
+ ;; This database is so old, we need to replace it.
+ ;; We also need to delete it from the instance tracker.
+ (delete-instance r)
+ (setq r nil)))
r)
(error (message "Cache Error: [%s] %s, Restart"
filename foo)
This variable is set to nil after the first error is encountered
to prevent overload.")
+(declare-function data-debug-insert-thing "data-debug")
+
(defmethod object-write ((obj semanticdb-table))
"When writing a table, we have to make sure we deoverlay it first.
Restore the overlays after writting.
(provide 'semantic/db-file)
-;;; semanticdb-file.el ends here
+;;; semantic/db-file.el ends here
(require 'eieio)
)
+(require 'semantic/find)
+
+(require 'semantic/tag-file)
+(require 'semantic/sort)
+
;;; Code:
+
+(defvar data-debug-thing-alist)
+(declare-function data-debug-insert-stuff-list "data-debug")
+(declare-function data-debug-insert-tag-list "data-debug")
+(declare-function semantic-scope-reset-cache "semantic/scope")
+(declare-function semanticdb-typecache-notify-reset "semantic/db-typecache")
+(declare-function ede-current-project "ede")
+
(defvar semanticdb-find-throttle-custom-list
'(repeat (radio (const 'local)
(const 'project)
"Customization values for semanticdb find throttle.
See `semanticdb-find-throttle' for details.")
+;;;###autoload
(defcustom semanticdb-find-default-throttle
'(local project unloaded system recursive)
"The default throttle for `semanticdb-find' routines.
(defmethod semantic-reset ((idx semanticdb-find-search-index))
"Reset the object IDX."
+ (require 'semantic/scope)
;; Clear the include path.
(oset idx include-path nil)
(when (oref idx type-cache)
(let ((tab-idx (semanticdb-get-table-index tab)))
;; Not a full reset?
(when (oref tab-idx type-cache)
+ (require 'db-typecache)
(semanticdb-typecache-notify-reset
(oref tab-idx type-cache)))
)))
(semanticdb-find-translate-path-brutish-default path)
(semanticdb-find-translate-path-includes-default path))))
+(define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
+ "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
+INCLUDETAG is a semantic TAG of class 'include.
+TABLE is a semanticdb table that identifies where INCLUDETAG came from.
+TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
+ )
+
(defun semanticdb-find-translate-path-brutish-default (path)
"Translate PATH into a list of semantic tables.
Default action as described in `semanticdb-find-translate-path'."
"Load an unloaded file in FILENAME using the default semanticdb loader."
(semanticdb-file-table-object filename))
-(define-overloadable-function semanticdb-find-table-for-include (includetag &optional table)
- "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object
-INCLUDETAG is a semantic TAG of class 'include.
-TABLE is a semanticdb table that identifies where INCLUDETAG came from.
-TABLE is optional if INCLUDETAG has an overlay of :filename attribute."
- )
-
(defun semanticdb-find-table-for-include-default (includetag &optional table)
"Default implementation of `semanticdb-find-table-for-include'.
Uses `semanticdb-current-database-list' as the search path.
(semanticdb-find-log-move-to-end)))
;;; Semanticdb find API functions
-;;
;; These are the routines actually used to perform searches.
;;
(defun semanticdb-find-tags-collector (function &optional path find-file-match
;;
(require 'cedet-global)
-(require 'semantic/db-search)
+(require 'semantic/db-find)
(require 'semantic/symref/global)
(eval-when-compile
(require 'eieio)
(require 'eieio-opt)
)
+
;;; Code:
+
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-thing result "data-debug")
+
+
(defun semanticdb-enable-gnu-global-databases (mode)
"Enable the use of the GNU Global SemanticDB back end for all files of MODE.
This will add an instance of a GNU Global database to each buffer
MODE is the major mode to support."
(semanticdb-enable-gnu-global-in-buffer t))
+(defclass semanticdb-project-database-global
+ ;; @todo - convert to one DB per directory.
+ (semanticdb-project-database eieio-instance-tracker)
+ ()
+ "Database representing a GNU Global tags file.")
+
(defun semanticdb-enable-gnu-global-in-buffer (&optional dont-err-if-not-available)
"Enable a GNU Global database in the current buffer.
Argument DONT-ERR-IF-NOT-AVAILABLE will throw an error if GNU Global
)
"A table for returning search results from GNU Global.")
-(defclass semanticdb-project-database-global
- ;; @todo - convert to one DB per directory.
- (semanticdb-project-database eieio-instance-tracker)
- ()
- "Database representing a GNU Global tags file.")
-
(defmethod semanticdb-equivalent-mode ((table semanticdb-table-global) &optional buffer)
"Return t, pretend that this table's mode is equivalent to BUFFER.
Equivalent modes are specified by by `semantic-equivalent-major-modes'
-;;; db-javascript.el --- Semantic database extensions for javascript
+;;; semantic/db-javascript.el --- Semantic database extensions for javascript
;;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
;;; Free Software Foundation, Inc.
;; the list of tags.
;;
-(require 'semantic/db-search)
+(require 'semantic/db)
+(require 'semantic/db-find)
+
(eval-when-compile
;; For generic function searching.
(require 'eieio)
;; function encodeURIComponent (uriComponent){}
-(provide 'semantic/db-el)
+(provide 'semantic/db-javascript)
-;;; semanticdb-el.el ends here
+;;; semantic/db-javascript.el ends here
(require 'semantic/db)
;;; Code:
-(defvar semanticdb-current-database nil
- "For a given buffer, this is the currently active database.")
-(make-variable-buffer-local 'semanticdb-current-database)
-(defvar semanticdb-current-table nil
- "For a given buffer, this is the currently active database table.")
-(make-variable-buffer-local 'semanticdb-current-table)
+;; Moved into semantic/db.el:
+;; (defvar semanticdb-current-database nil
+;; "For a given buffer, this is the currently active database.")
+;; (make-variable-buffer-local 'semanticdb-current-database)
+
+;; (defvar semanticdb-current-table nil
+;; "For a given buffer, this is the currently active database table.")
+;; (make-variable-buffer-local 'semanticdb-current-table)
+
+(declare-function semantic-lex-spp-set-dynamic-table "semantic/lex-spp")
(defcustom semanticdb-global-mode nil
"*If non-nil enable the use of `semanticdb-minor-mode'."
-;;; db-ref.el --- Handle cross-db file references
+;;; semantic/db-ref.el --- Handle cross-db file references
;;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc.
;;; Code:
+(require 'eieio)
+(require 'semantic/db)
+(require 'semantic/util)
+
+(defvar semanticdb-find-default-throttle)
+
+;; For the semantic-find-tags-by-name-regexp macro.
+(eval-when-compile (require 'semantic/find))
+(defvar semantic-case-fold)
+
(defmethod semanticdb-add-reference ((dbt semanticdb-abstract-table)
include-tag)
"Add a reference for the database table DBT based on INCLUDE-TAG.
(i-include :initarg :i-include))
"Simple class to allow ADEBUG to show a nice list.")
+(defvar semanticdb-current-table)
+(declare-function data-debug-new-buffer "data-debug")
+(declare-function data-debug-insert-object-slots "data-debug")
+
(defun semanticdb-ref-test (refresh)
"Dump out the list of references for the current buffer.
If REFRESH is non-nil, cause the current table to have it's references
refreshed before dumping the result."
(interactive "p")
+ (require 'data-debug)
+ (require 'semantic/db)
;; If we need to refresh... then do so.
(when refresh
(semanticdb-refresh-references semanticdb-current-table))
)
(provide 'semantic/db-ref)
-;;; semanticdb-ref.el ends here
+;;; semantic/db-ref.el ends here
(require 'semantic/db)
(require 'semantic/db-find)
+(require 'semantic/tag-ls)
+(require 'semantic/analyze/fcn)
+(require 'semantic/scope)
+
+(declare-function data-debug-insert-thing "data-debug")
+(declare-function data-debug-new-buffer "data-debug")
;;; Code:
-;;; db.el --- Semantic tag database manager
+;;; semantic/db.el --- Semantic tag database manager
;;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
;;; 2008, 2009 Free Software Foundation, Inc.
This can be changed to try out new types of search indicies.")
(make-variable-buffer-local 'semanticdb-default-find=index-class)
+(defvar semanticdb-current-database nil
+ "For a given buffer, this is the currently active database.")
+(make-variable-buffer-local 'semanticdb-current-database)
+
+(defvar semanticdb-current-table nil
+ "For a given buffer, this is the currently active database table.")
+(make-variable-buffer-local 'semanticdb-current-table)
;;; ABSTRACT CLASSES
;;
)
strings)))
+(defclass semanticdb-search-results-table (semanticdb-abstract-table)
+ ( )
+ "Table used for search results when there is no file or table association.
+Examples include search results from external sources such as from
+Emacs' own symbol table, or from external libraries.")
+
+(defmethod semanticdb-refresh-table ((obj semanticdb-search-results-table) &optional force)
+ "If the tag list associated with OBJ is loaded, refresh it.
+This will call `semantic-fetch-tags' if that file is in memory."
+ nil)
+
;;; Index Cache
;;
(defclass semanticdb-abstract-search-index ()
(provide 'semantic/db)
-;;; semanticdb.el ends here
+;;; semantic/db.el ends here