cedet/cedet.el (cedet-packages): Bump srecode version.
cedet/data-debug.el: Require `ring' for use of ring-length.
cedet/semantic.el (semantic-repeat-parse-whole-stream): Check
semantic-working-type before updating progress reporter.
cedet/semantic/adebug.el: Fix file header.
cedet/semantic/analyze.el: eval-when-compile semantic/find, for
semantic-find-tags-by-name. Declare semanticdb-strip-find-results and
semanticdb-find-tags-by-name.
cedet/semantic/chart.el: Require semantic/find, semantic/db-mode,
semantic/db-typecache, and semantic/scope.
cedet/semantic/complete.el: Declare
semantic-displayor-focus-abstract-child-p function (needed as the
semantic-displayor-focus-abstract class is defined only after used).
Move semantic-complete-inline-custom-type and
semantic-complete-inline-analyzer-displayor-class variable definitions
up, before they are used, to avoid compiler warning.
Require semantic/decorate, semantic/tag-file, eieio-opt, and
semantic/analyze/complete.
cedet/semantic/ctxt.el: Require semantic/find. Don't
eval-when-compile semantic/db
(semantic-get-local-variables): Use Emacs' built-in progress reporter
instead of working-status-forms.
cedet/semantic/db-debug.el: Require data-debug, semantic/db-mode, and
semantic/format.
cedet/semantic/db-ebrowse.el: Require semantic/db-mode, semantic/find,
semantic/sort, data-debug
(semanticdb-create-database): Require semantic/dep for
semantic-add-system-include.
(semanticdb-table-ebrowse, semanticdb-project-database-ebrowse): Move
class definitions near top of file, before they are used, to avoid
compiler warnings.
(semanticdb-ebrowse-add-tree-to-table): Use split-string.
2009-08-30 21:16:39 +00:00
|
|
|
|
;;; semantic/db-find.el --- Searching through semantic databases.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
|
2013-01-01 09:11:05 +00:00
|
|
|
|
;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
|
|
|
;; Keywords: tags
|
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; Databases of various forms can all be searched.
|
|
|
|
|
;; There are a few types of searches that can be done:
|
|
|
|
|
;;
|
|
|
|
|
;; Basic Name Search:
|
|
|
|
|
;; These searches scan a database table collection for tags based
|
|
|
|
|
;; on name.
|
|
|
|
|
;;
|
|
|
|
|
;; Basic Attribute Search:
|
|
|
|
|
;; These searches allow searching on specific attributes of tags,
|
|
|
|
|
;; such as name, type, or other attribute.
|
|
|
|
|
;;
|
|
|
|
|
;; Advanced Search:
|
|
|
|
|
;; These are searches that were needed to accomplish some
|
|
|
|
|
;; specialized tasks as discovered in utilities. Advanced searches
|
|
|
|
|
;; include matching methods defined outside some parent class.
|
|
|
|
|
;;
|
|
|
|
|
;; The reason for advanced searches are so that external
|
|
|
|
|
;; repositories such as the Emacs obarray, or java .class files can
|
|
|
|
|
;; quickly answer these needed questions without dumping the entire
|
|
|
|
|
;; symbol list into Emacs for additional refinement searches via
|
|
|
|
|
;; regular semanticdb search.
|
|
|
|
|
;;
|
|
|
|
|
;; How databases are decided upon is another important aspect of a
|
|
|
|
|
;; database search. When it comes to searching for a name, there are
|
|
|
|
|
;; these types of searches:
|
|
|
|
|
;;
|
|
|
|
|
;; Basic Search:
|
|
|
|
|
;; Basic search means that tags looking for a given name start
|
|
|
|
|
;; with a specific search path. Names are sought on that path
|
|
|
|
|
;; until it is empty or items on the path can no longer be found.
|
|
|
|
|
;; Use `semanticdb-dump-all-table-summary' to test this list.
|
|
|
|
|
;; Use `semanticdb-find-throttle-custom-list' to refine this list.
|
|
|
|
|
;;
|
|
|
|
|
;; Deep Search:
|
|
|
|
|
;; A deep search will search more than just the global namespace.
|
|
|
|
|
;; It will recurse into tags that contain more tags, and search
|
|
|
|
|
;; those too.
|
|
|
|
|
;;
|
|
|
|
|
;; Brute Search:
|
|
|
|
|
;; Brute search means that all tables in all databases in a given
|
|
|
|
|
;; project are searched. Brute searches are the search style as
|
|
|
|
|
;; written for semantic version 1.x.
|
|
|
|
|
;;
|
|
|
|
|
;; How does the search path work?
|
|
|
|
|
;;
|
|
|
|
|
;; A basic search starts with three parameters:
|
|
|
|
|
;;
|
|
|
|
|
;; (FINDME &optional PATH FIND-FILE-MATCH)
|
|
|
|
|
;;
|
|
|
|
|
;; FINDME is key to be searched for dependent on the type of search.
|
|
|
|
|
;; PATH is an indicator of which tables are to be searched.
|
|
|
|
|
;; FIND-FILE-MATCH indicates that any time a match is found, the
|
|
|
|
|
;; file associated with the tag should be read into a file.
|
|
|
|
|
;;
|
|
|
|
|
;; The PATH argument is then the most interesting argument. It can
|
|
|
|
|
;; have these values:
|
|
|
|
|
;;
|
2011-11-03 21:03:45 +01:00
|
|
|
|
;; nil - Take the current buffer, and use its include list
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; buffer - Use that buffer's include list.
|
|
|
|
|
;; filename - Use that file's include list. If the file is not
|
|
|
|
|
;; in a buffer, see of there is a semanticdb table for it. If
|
|
|
|
|
;; not, read that file into a buffer.
|
|
|
|
|
;; tag - Get that tag's buffer of file file. See above.
|
2011-11-03 21:03:45 +01:00
|
|
|
|
;; table - Search that table, and its include list.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Search Results:
|
|
|
|
|
;;
|
|
|
|
|
;; Semanticdb returns the results in a specific format. There are a
|
|
|
|
|
;; series of routines for using those results, and results can be
|
|
|
|
|
;; passed in as a search-path for refinement searches with
|
|
|
|
|
;; semanticdb. Apropos for semanticdb.*find-result for more.
|
|
|
|
|
;;
|
|
|
|
|
;; Application:
|
|
|
|
|
;;
|
|
|
|
|
;; Here are applications where different searches are needed which
|
|
|
|
|
;; exist as of semantic 1.4.x
|
|
|
|
|
;;
|
|
|
|
|
;; eldoc - popup help
|
|
|
|
|
;; => Requires basic search using default path. (Header files ok)
|
|
|
|
|
;; tag jump - jump to a named tag
|
2009-10-01 04:54:05 +00:00
|
|
|
|
;; => Requires a brute search using whole project. (Source files only)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; completion - Completing symbol names in a smart way
|
|
|
|
|
;; => Basic search (headers ok)
|
|
|
|
|
;; type analysis - finding type definitions for variables & fcns
|
|
|
|
|
;; => Basic search (headers ok)
|
|
|
|
|
;; Class browser - organize types into some structure
|
|
|
|
|
;; => Brute search, or custom navigation.
|
|
|
|
|
|
|
|
|
|
;; TODO:
|
|
|
|
|
;; During a search, load any unloaded DB files based on paths in the
|
|
|
|
|
;; current project.
|
|
|
|
|
|
|
|
|
|
(require 'semantic/db)
|
|
|
|
|
(require 'semantic/db-ref)
|
|
|
|
|
(eval-when-compile
|
2009-08-31 02:16:34 +00:00
|
|
|
|
(require 'semantic/find))
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;;; Code:
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
|
|
|
|
|
(defvar data-debug-thing-alist)
|
|
|
|
|
(declare-function data-debug-insert-stuff-list "data-debug")
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(declare-function data-debug-new-buffer "data-debug")
|
2009-10-03 02:11:59 +00:00
|
|
|
|
;;;(declare-function data-debug-insert-tag-list "adebug")
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
(declare-function semantic-scope-reset-cache "semantic/scope")
|
|
|
|
|
(declare-function semanticdb-typecache-notify-reset "semantic/db-typecache")
|
|
|
|
|
(declare-function ede-current-project "ede")
|
|
|
|
|
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defvar semanticdb-find-throttle-custom-list
|
2013-05-08 21:40:20 -04:00
|
|
|
|
'(set (const local)
|
|
|
|
|
(const project)
|
|
|
|
|
(const unloaded)
|
|
|
|
|
(const system)
|
|
|
|
|
(const recursive)
|
|
|
|
|
(const omniscience))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
"Customization values for semanticdb find throttle.
|
|
|
|
|
See `semanticdb-find-throttle' for details.")
|
|
|
|
|
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defcustom semanticdb-find-default-throttle
|
|
|
|
|
'(local project unloaded system recursive)
|
|
|
|
|
"The default throttle for `semanticdb-find' routines.
|
|
|
|
|
The throttle controls how detailed the list of database
|
|
|
|
|
tables is for a symbol lookup. The value is a list with
|
|
|
|
|
the following keys:
|
|
|
|
|
`file' - The file the search is being performed from.
|
|
|
|
|
This option is here for completeness only, and
|
|
|
|
|
is assumed to always be on.
|
|
|
|
|
`local' - Tables from the same local directory are included.
|
|
|
|
|
This includes files directly referenced by a file name
|
|
|
|
|
which might be in a different directory.
|
|
|
|
|
`project' - Tables from the same local project are included
|
|
|
|
|
If `project' is specified, then `local' is assumed.
|
|
|
|
|
`unloaded' - If a table is not in memory, load it. If it is not cached
|
|
|
|
|
on disk either, get the source, parse it, and create
|
|
|
|
|
the table.
|
|
|
|
|
`system' - Tables from system databases. These are specifically
|
|
|
|
|
tables from system header files, or language equivalent.
|
|
|
|
|
`recursive' - For include based searches, includes tables referenced
|
|
|
|
|
by included files.
|
|
|
|
|
`omniscience' - Included system databases which are omniscience, or
|
|
|
|
|
somehow know everything. Omniscience databases are found
|
|
|
|
|
in `semanticdb-project-system-databases'.
|
|
|
|
|
The Emacs Lisp system DB is an omniscience database."
|
|
|
|
|
:group 'semanticdb
|
|
|
|
|
:type semanticdb-find-throttle-custom-list)
|
|
|
|
|
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(make-variable-buffer-local 'semanticdb-find-default-throttle)
|
|
|
|
|
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-throttle-active-p (access-type)
|
|
|
|
|
"Non-nil if ACCESS-TYPE is an active throttle type."
|
|
|
|
|
(or (memq access-type semanticdb-find-default-throttle)
|
|
|
|
|
(eq access-type 'file)
|
|
|
|
|
(and (eq access-type 'local)
|
|
|
|
|
(memq 'project semanticdb-find-default-throttle))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
;;; Index Class
|
|
|
|
|
;;
|
|
|
|
|
;; The find routines spend a lot of time looking stuff up.
|
|
|
|
|
;; Use this handy search index to cache data between searches.
|
|
|
|
|
;; This should allow searches to start running faster.
|
|
|
|
|
(defclass semanticdb-find-search-index (semanticdb-abstract-search-index)
|
|
|
|
|
((include-path :initform nil
|
|
|
|
|
:documentation
|
|
|
|
|
"List of semanticdb tables from the include path.")
|
|
|
|
|
(type-cache :initform nil
|
|
|
|
|
:documentation
|
|
|
|
|
"Cache of all the data types accessible from this file.
|
|
|
|
|
Includes all types from all included files, merged namespaces, and
|
|
|
|
|
expunge duplicates.")
|
|
|
|
|
)
|
|
|
|
|
"Concrete search index for `semanticdb-find'.
|
|
|
|
|
This class will cache data derived during various searches.")
|
|
|
|
|
|
|
|
|
|
(defmethod semantic-reset ((idx semanticdb-find-search-index))
|
|
|
|
|
"Reset the object IDX."
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
(require 'semantic/scope)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; Clear the include path.
|
|
|
|
|
(oset idx include-path nil)
|
|
|
|
|
(when (oref idx type-cache)
|
|
|
|
|
(semantic-reset (oref idx type-cache)))
|
|
|
|
|
;; Clear the scope. Scope doesn't have the data it needs to track
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
;; its own reset.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semantic-scope-reset-cache)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-synchronize ((idx semanticdb-find-search-index)
|
|
|
|
|
new-tags)
|
|
|
|
|
"Synchronize the search index IDX with some NEW-TAGS."
|
|
|
|
|
;; Reset our parts.
|
|
|
|
|
(semantic-reset idx)
|
2011-12-05 00:55:25 -08:00
|
|
|
|
;; Notify dependants by clearing their indices.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semanticdb-notify-references
|
|
|
|
|
(oref idx table)
|
|
|
|
|
(lambda (tab me)
|
|
|
|
|
(semantic-reset (semanticdb-get-table-index tab))))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-partial-synchronize ((idx semanticdb-find-search-index)
|
|
|
|
|
new-tags)
|
|
|
|
|
"Synchronize the search index IDX with some changed NEW-TAGS."
|
|
|
|
|
;; Only reset if include statements changed.
|
|
|
|
|
(if (semantic-find-tags-by-class 'include new-tags)
|
|
|
|
|
(progn
|
|
|
|
|
(semantic-reset idx)
|
2011-12-05 00:55:25 -08:00
|
|
|
|
;; Notify dependants by clearing their indices.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semanticdb-notify-references
|
|
|
|
|
(oref idx table)
|
|
|
|
|
(lambda (tab me)
|
|
|
|
|
(semantic-reset (semanticdb-get-table-index tab))))
|
|
|
|
|
)
|
|
|
|
|
;; Else, not an include, by just a type.
|
|
|
|
|
(when (oref idx type-cache)
|
|
|
|
|
(when (semanticdb-partial-synchronize (oref idx type-cache) new-tags)
|
|
|
|
|
;; If the synchronize returns true, we need to notify.
|
2011-12-05 00:55:25 -08:00
|
|
|
|
;; Notify dependants by clearing their indices.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semanticdb-notify-references
|
|
|
|
|
(oref idx table)
|
|
|
|
|
(lambda (tab me)
|
|
|
|
|
(let ((tab-idx (semanticdb-get-table-index tab)))
|
|
|
|
|
;; Not a full reset?
|
|
|
|
|
(when (oref tab-idx type-cache)
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
|
(require 'semantic/db-typecache)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semanticdb-typecache-notify-reset
|
|
|
|
|
(oref tab-idx type-cache)))
|
|
|
|
|
)))
|
|
|
|
|
))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Path Translations
|
|
|
|
|
;;
|
|
|
|
|
;;; OVERLOAD Functions
|
|
|
|
|
;;
|
|
|
|
|
;; These routines needed to be overloaded by specific language modes.
|
|
|
|
|
;; They are needed for translating an INCLUDE tag into a semanticdb
|
|
|
|
|
;; TABLE object.
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(define-overloadable-function semanticdb-find-translate-path (path brutish)
|
|
|
|
|
"Translate PATH into a list of semantic tables.
|
|
|
|
|
Path translation involves identifying the PATH input argument
|
|
|
|
|
in one of the following ways:
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
nil - Take the current buffer, and use its include list
|
2009-08-28 19:18:35 +00:00
|
|
|
|
buffer - Use that buffer's include list.
|
|
|
|
|
filename - Use that file's include list. If the file is not
|
|
|
|
|
in a buffer, see of there is a semanticdb table for it. If
|
|
|
|
|
not, read that file into a buffer.
|
|
|
|
|
tag - Get that tag's buffer of file file. See above.
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
table - Search that table, and its include list.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
find result - Search the results of a previous find.
|
|
|
|
|
|
|
|
|
|
In addition, once the base path is found, there is the possibility of
|
|
|
|
|
each added table adding yet more tables to the path, so this routine
|
|
|
|
|
can return a lengthy list.
|
|
|
|
|
|
|
|
|
|
If argument BRUTISH is non-nil, then instead of using the include
|
|
|
|
|
list, use all tables found in the parent project of the table
|
|
|
|
|
identified by translating PATH. Such searches use brute force to
|
|
|
|
|
scan every available table.
|
|
|
|
|
|
|
|
|
|
The return value is a list of objects of type `semanticdb-table' or
|
2010-01-18 05:39:40 +01:00
|
|
|
|
their children. In the case of passing in a find result, the result
|
2009-08-28 19:18:35 +00:00
|
|
|
|
is returned unchanged.
|
|
|
|
|
|
|
|
|
|
This routine uses `semanticdb-find-table-for-include' to translate
|
|
|
|
|
specific include tags into a semanticdb table.
|
|
|
|
|
|
|
|
|
|
Note: When searching using a non-brutish method, the list of
|
|
|
|
|
included files will be cached between runs. Database-references
|
|
|
|
|
are used to track which files need to have their include lists
|
|
|
|
|
refreshed when things change. See `semanticdb-ref-test'.
|
|
|
|
|
|
|
|
|
|
Note for overloading: If you opt to overload this function for your
|
|
|
|
|
major mode, and your routine takes a long time, be sure to call
|
|
|
|
|
|
|
|
|
|
(semantic-throw-on-input 'your-symbol-here)
|
|
|
|
|
|
|
|
|
|
so that it can be called from the idle work handler."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-translate-path-default (path brutish)
|
|
|
|
|
"Translate PATH into a list of semantic tables.
|
|
|
|
|
If BRUTISH is non nil, return all tables associated with PATH.
|
|
|
|
|
Default action as described in `semanticdb-find-translate-path'."
|
|
|
|
|
(if (semanticdb-find-results-p path)
|
|
|
|
|
;; nil means perform the search over these results.
|
|
|
|
|
nil
|
|
|
|
|
(if brutish
|
|
|
|
|
(semanticdb-find-translate-path-brutish-default path)
|
|
|
|
|
(semanticdb-find-translate-path-includes-default path))))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
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.
2009-08-31 00:45:41 +00:00
|
|
|
|
(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."
|
|
|
|
|
)
|
|
|
|
|
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(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'."
|
|
|
|
|
(let ((basedb
|
|
|
|
|
(cond ((null path) semanticdb-current-database)
|
|
|
|
|
((semanticdb-table-p path) (oref path parent-db))
|
|
|
|
|
(t (let ((tt (semantic-something-to-tag-table path)))
|
2012-03-12 21:51:17 +01:00
|
|
|
|
(if tt
|
|
|
|
|
;; @todo - What does this DO ??!?!
|
|
|
|
|
(with-current-buffer (semantic-tag-buffer (car tt))
|
|
|
|
|
semanticdb-current-database)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
semanticdb-current-database))))))
|
|
|
|
|
(apply
|
|
|
|
|
#'nconc
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (db)
|
|
|
|
|
(let ((tabs (semanticdb-get-database-tables db))
|
|
|
|
|
(ret nil))
|
|
|
|
|
;; Only return tables of the same language (major-mode)
|
|
|
|
|
;; as the current search environment.
|
|
|
|
|
(while tabs
|
|
|
|
|
|
|
|
|
|
(semantic-throw-on-input 'translate-path-brutish)
|
|
|
|
|
|
|
|
|
|
(if (semanticdb-equivalent-mode-for-search (car tabs)
|
|
|
|
|
(current-buffer))
|
|
|
|
|
(setq ret (cons (car tabs) ret)))
|
|
|
|
|
(setq tabs (cdr tabs)))
|
|
|
|
|
ret))
|
|
|
|
|
;; FIXME:
|
|
|
|
|
;; This should scan the current project directory list for all
|
|
|
|
|
;; semanticdb files, perhaps handling proxies for them.
|
|
|
|
|
(semanticdb-current-database-list
|
|
|
|
|
(if basedb (oref basedb reference-directory)
|
|
|
|
|
default-directory))))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-incomplete-cache-entries-p (cache)
|
|
|
|
|
"Are there any incomplete entries in CACHE?"
|
|
|
|
|
(let ((ans nil))
|
|
|
|
|
(dolist (tab cache)
|
|
|
|
|
(when (and (semanticdb-table-child-p tab)
|
|
|
|
|
(not (number-or-marker-p (oref tab pointmax))))
|
|
|
|
|
(setq ans t))
|
|
|
|
|
)
|
|
|
|
|
ans))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-need-cache-update-p (table)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"Non-nil if the semanticdb TABLE cache needs to be updated."
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; If we were passed in something related to a TABLE,
|
|
|
|
|
;; do a caching lookup.
|
|
|
|
|
(let* ((index (semanticdb-get-table-index table))
|
|
|
|
|
(cache (when index (oref index include-path)))
|
|
|
|
|
(incom (semanticdb-find-incomplete-cache-entries-p cache))
|
|
|
|
|
(unl (semanticdb-find-throttle-active-p 'unloaded))
|
|
|
|
|
)
|
|
|
|
|
(if (and
|
|
|
|
|
cache ;; Must have a cache
|
|
|
|
|
(or
|
|
|
|
|
;; If all entries are "full", or if 'unloaded
|
|
|
|
|
;; OR
|
|
|
|
|
;; is not in the throttle, it is ok to use the cache.
|
|
|
|
|
(not incom) (not unl)
|
|
|
|
|
))
|
|
|
|
|
nil
|
|
|
|
|
;;cache
|
|
|
|
|
;; ELSE
|
|
|
|
|
;;
|
|
|
|
|
;; We need an update.
|
|
|
|
|
t))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-translate-path-includes-default (path)
|
|
|
|
|
"Translate PATH into a list of semantic tables.
|
|
|
|
|
Default action as described in `semanticdb-find-translate-path'."
|
|
|
|
|
(let ((table (cond ((null path)
|
|
|
|
|
semanticdb-current-table)
|
|
|
|
|
((bufferp path)
|
|
|
|
|
(semantic-buffer-local-value 'semanticdb-current-table path))
|
|
|
|
|
((and (stringp path) (file-exists-p path))
|
|
|
|
|
(semanticdb-file-table-object path t))
|
|
|
|
|
((semanticdb-abstract-table-child-p path)
|
|
|
|
|
path)
|
|
|
|
|
(t nil))))
|
|
|
|
|
(if table
|
|
|
|
|
;; If we were passed in something related to a TABLE,
|
|
|
|
|
;; do a caching lookup.
|
|
|
|
|
(let ((index (semanticdb-get-table-index table)))
|
|
|
|
|
(if (semanticdb-find-need-cache-update-p table)
|
2011-12-05 00:55:25 -08:00
|
|
|
|
;; Let's go look up our indices.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(let ((ans (semanticdb-find-translate-path-includes--internal path)))
|
|
|
|
|
(oset index include-path ans)
|
2011-12-05 00:55:25 -08:00
|
|
|
|
;; Once we have our new indices set up, notify those
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; who depend on us if we found something for them to
|
|
|
|
|
;; depend on.
|
|
|
|
|
(when ans (semanticdb-refresh-references table))
|
|
|
|
|
ans)
|
|
|
|
|
;; ELSE
|
|
|
|
|
;;
|
|
|
|
|
;; Just return the cache.
|
|
|
|
|
(oref index include-path)))
|
|
|
|
|
;; If we were passed in something like a tag list, or other boring
|
|
|
|
|
;; searchable item, then instead do the regular thing without caching.
|
|
|
|
|
(semanticdb-find-translate-path-includes--internal path))))
|
|
|
|
|
|
|
|
|
|
(defvar semanticdb-find-lost-includes nil
|
|
|
|
|
"Include files that we cannot find associated with this buffer.")
|
|
|
|
|
(make-variable-buffer-local 'semanticdb-find-lost-includes)
|
|
|
|
|
|
|
|
|
|
(defvar semanticdb-find-scanned-include-tags nil
|
|
|
|
|
"All include tags scanned, plus action taken on the tag.
|
|
|
|
|
Each entry is an alist:
|
|
|
|
|
(ACTION . TAG)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
where ACTION is one of 'scanned, 'duplicate, 'lost
|
2009-08-28 19:18:35 +00:00
|
|
|
|
and TAG is a clone of the include tag that was found.")
|
|
|
|
|
(make-variable-buffer-local 'semanticdb-find-scanned-include-tags)
|
|
|
|
|
|
|
|
|
|
(defvar semanticdb-implied-include-tags nil
|
|
|
|
|
"Include tags implied for all files of a given mode.
|
|
|
|
|
Set this variable with `defvar-mode-local' for a particular mode so
|
|
|
|
|
that any symbols that exist for all files for that mode are included.
|
|
|
|
|
|
2009-10-01 04:54:05 +00:00
|
|
|
|
Note: This could be used as a way to write a file in a language
|
2009-08-28 19:18:35 +00:00
|
|
|
|
to declare all the built-ins for that language.")
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-translate-path-includes--internal (path)
|
|
|
|
|
"Internal implementation of `semanticdb-find-translate-path-includes-default'.
|
|
|
|
|
This routine does not depend on the cache, but will always derive
|
|
|
|
|
a new path from the provided PATH."
|
|
|
|
|
(let ((includetags nil)
|
|
|
|
|
(curtable nil)
|
|
|
|
|
(matchedtables (list semanticdb-current-table))
|
|
|
|
|
(matchedincludes nil)
|
|
|
|
|
(lostincludes nil)
|
|
|
|
|
(scannedincludes nil)
|
|
|
|
|
(incfname nil)
|
|
|
|
|
nexttable)
|
|
|
|
|
(cond ((null path)
|
|
|
|
|
(semantic-refresh-tags-safe)
|
|
|
|
|
(setq includetags (append
|
|
|
|
|
(semantic-find-tags-included (current-buffer))
|
|
|
|
|
semanticdb-implied-include-tags)
|
|
|
|
|
curtable semanticdb-current-table
|
|
|
|
|
incfname (buffer-file-name))
|
|
|
|
|
)
|
|
|
|
|
((semanticdb-table-p path)
|
|
|
|
|
(setq includetags (semantic-find-tags-included path)
|
|
|
|
|
curtable path
|
|
|
|
|
incfname (semanticdb-full-filename path))
|
|
|
|
|
)
|
|
|
|
|
((bufferp path)
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer path
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semantic-refresh-tags-safe))
|
|
|
|
|
(setq includetags (semantic-find-tags-included path)
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
curtable (with-current-buffer path
|
|
|
|
|
semanticdb-current-table)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
incfname (buffer-file-name path)))
|
|
|
|
|
(t
|
|
|
|
|
(setq includetags (semantic-find-tags-included path))
|
|
|
|
|
(when includetags
|
|
|
|
|
;; If we have some tags, derive a table from them.
|
|
|
|
|
;; else we will do nothing, so the table is useless.
|
|
|
|
|
|
|
|
|
|
;; @todo - derive some tables
|
|
|
|
|
(message "Need to derive tables for %S in translate-path-includes--default."
|
|
|
|
|
path)
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
;; Make sure each found include tag has an originating file name associated
|
|
|
|
|
;; with it.
|
|
|
|
|
(when incfname
|
|
|
|
|
(dolist (it includetags)
|
|
|
|
|
(semantic--tag-put-property it :filename incfname)))
|
|
|
|
|
|
|
|
|
|
;; Loop over all include tags adding to matchedtables
|
|
|
|
|
(while includetags
|
|
|
|
|
(semantic-throw-on-input 'semantic-find-translate-path-includes-default)
|
|
|
|
|
|
|
|
|
|
;; If we've seen this include string before, lets skip it.
|
|
|
|
|
(if (member (semantic-tag-name (car includetags)) matchedincludes)
|
|
|
|
|
(progn
|
|
|
|
|
(setq nexttable nil)
|
|
|
|
|
(push (cons 'duplicate (semantic-tag-clone (car includetags)))
|
|
|
|
|
scannedincludes)
|
|
|
|
|
)
|
|
|
|
|
(setq nexttable (semanticdb-find-table-for-include (car includetags) curtable))
|
|
|
|
|
(when (not nexttable)
|
|
|
|
|
;; Save the lost include.
|
|
|
|
|
(push (car includetags) lostincludes)
|
|
|
|
|
(push (cons 'lost (semantic-tag-clone (car includetags)))
|
|
|
|
|
scannedincludes)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; Push the include file, so if we can't find it, we only
|
|
|
|
|
;; can't find it once.
|
|
|
|
|
(push (semantic-tag-name (car includetags)) matchedincludes)
|
|
|
|
|
|
|
|
|
|
;; (message "Scanning %s" (semantic-tag-name (car includetags)))
|
|
|
|
|
(when (and nexttable
|
|
|
|
|
(not (memq nexttable matchedtables))
|
|
|
|
|
(semanticdb-equivalent-mode-for-search nexttable
|
|
|
|
|
(current-buffer))
|
|
|
|
|
)
|
|
|
|
|
;; Add to list of tables
|
|
|
|
|
(push nexttable matchedtables)
|
|
|
|
|
|
|
|
|
|
;; Queue new includes to list
|
|
|
|
|
(if (semanticdb-find-throttle-active-p 'recursive)
|
|
|
|
|
;; @todo - recursive includes need to have the originating
|
|
|
|
|
;; buffer's location added to the path.
|
|
|
|
|
(let ((newtags
|
|
|
|
|
(cond
|
|
|
|
|
((semanticdb-table-p nexttable)
|
|
|
|
|
(semanticdb-refresh-table nexttable)
|
|
|
|
|
;; Use the method directly, or we will recurse
|
|
|
|
|
;; into ourselves here.
|
|
|
|
|
(semanticdb-find-tags-by-class-method
|
|
|
|
|
nexttable 'include))
|
|
|
|
|
(t ;; @todo - is this ever possible???
|
|
|
|
|
(message "semanticdb-ftp - how did you do that?")
|
|
|
|
|
(semantic-find-tags-included
|
|
|
|
|
(semanticdb-get-tags nexttable)))
|
|
|
|
|
))
|
|
|
|
|
(newincfname (semanticdb-full-filename nexttable))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(push (cons 'scanned (semantic-tag-clone (car includetags)))
|
|
|
|
|
scannedincludes)
|
|
|
|
|
|
|
|
|
|
;; Setup new tags so we know where they are.
|
|
|
|
|
(dolist (it newtags)
|
|
|
|
|
(semantic--tag-put-property it :filename
|
|
|
|
|
newincfname))
|
|
|
|
|
|
|
|
|
|
(setq includetags (nconc includetags newtags)))
|
|
|
|
|
;; ELSE - not recursive throttle
|
|
|
|
|
(push (cons 'scanned-no-recurse
|
|
|
|
|
(semantic-tag-clone (car includetags)))
|
|
|
|
|
scannedincludes)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
(setq includetags (cdr includetags)))
|
|
|
|
|
|
|
|
|
|
(setq semanticdb-find-lost-includes lostincludes)
|
|
|
|
|
(setq semanticdb-find-scanned-include-tags (reverse scannedincludes))
|
|
|
|
|
|
|
|
|
|
;; Find all the omniscient databases for this major mode, and
|
|
|
|
|
;; add them if needed
|
|
|
|
|
(when (and (semanticdb-find-throttle-active-p 'omniscience)
|
|
|
|
|
semanticdb-search-system-databases)
|
|
|
|
|
;; We can append any mode-specific omniscience databases into
|
|
|
|
|
;; our search list here.
|
|
|
|
|
(let ((systemdb semanticdb-project-system-databases)
|
|
|
|
|
(ans nil))
|
|
|
|
|
(while systemdb
|
|
|
|
|
(setq ans (semanticdb-file-table
|
|
|
|
|
(car systemdb)
|
|
|
|
|
;; I would expect most omniscient to return the same
|
2011-12-05 12:59:28 +01:00
|
|
|
|
;; thing regardless of filename, but we may have
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; one that can return a table of all things the
|
|
|
|
|
;; current file needs.
|
|
|
|
|
(buffer-file-name (current-buffer))))
|
|
|
|
|
(when (not (memq ans matchedtables))
|
|
|
|
|
(setq matchedtables (cons ans matchedtables)))
|
|
|
|
|
(setq systemdb (cdr systemdb))))
|
|
|
|
|
)
|
|
|
|
|
(nreverse matchedtables)))
|
|
|
|
|
|
|
|
|
|
(define-overloadable-function semanticdb-find-load-unloaded (filename)
|
|
|
|
|
"Create a database table for FILENAME if it hasn't been parsed yet.
|
|
|
|
|
Assumes that FILENAME exists as a source file.
|
|
|
|
|
Assumes that a preexisting table does not exist, even if it
|
|
|
|
|
isn't in memory yet."
|
|
|
|
|
(if (semanticdb-find-throttle-active-p 'unloaded)
|
|
|
|
|
(:override)
|
|
|
|
|
(semanticdb-file-table-object filename t)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-load-unloaded-default (filename)
|
|
|
|
|
"Load an unloaded file in FILENAME using the default semanticdb loader."
|
|
|
|
|
(semanticdb-file-table-object filename))
|
|
|
|
|
|
2009-09-13 15:58:30 +00:00
|
|
|
|
;; The creation of the overload occurs above.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(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.
|
|
|
|
|
INCLUDETAG and TABLE are documented in `semanticdb-find-table-for-include'.
|
|
|
|
|
Included databases are filtered based on `semanticdb-find-default-throttle'."
|
|
|
|
|
(if (not (eq (semantic-tag-class includetag) 'include))
|
|
|
|
|
(signal 'wrong-type-argument (list includetag 'include)))
|
|
|
|
|
|
|
|
|
|
(let ((name
|
|
|
|
|
;; Note, some languages (like Emacs or Java) use include tag names
|
|
|
|
|
;; that don't represent files! We want to have file names.
|
|
|
|
|
(semantic-tag-include-filename includetag))
|
|
|
|
|
(originfiledir nil)
|
|
|
|
|
(roots nil)
|
|
|
|
|
(tmp nil)
|
|
|
|
|
(ans nil))
|
|
|
|
|
|
|
|
|
|
;; INCLUDETAG should have some way to reference where it came
|
|
|
|
|
;; from! If not, TABLE should provide the way. Each time we
|
|
|
|
|
;; look up a tag, we may need to find it in some relative way
|
|
|
|
|
;; and must set our current buffer eto the origin of includetag
|
|
|
|
|
;; or nothing may work.
|
|
|
|
|
(setq originfiledir
|
|
|
|
|
(cond ((semantic-tag-file-name includetag)
|
|
|
|
|
;; A tag may have a buffer, or a :filename property.
|
|
|
|
|
(file-name-directory (semantic-tag-file-name includetag)))
|
|
|
|
|
(table
|
|
|
|
|
(file-name-directory (semanticdb-full-filename table)))
|
|
|
|
|
(t
|
|
|
|
|
;; @todo - what to do here? Throw an error maybe
|
|
|
|
|
;; and fix usage bugs?
|
|
|
|
|
default-directory)))
|
|
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
;; Step 1: Relative path name
|
|
|
|
|
;;
|
|
|
|
|
;; If the name is relative, then it should be findable as relative
|
|
|
|
|
;; to the source file that this tag originated in, and be fast.
|
|
|
|
|
;;
|
|
|
|
|
((and (semanticdb-find-throttle-active-p 'local)
|
|
|
|
|
(file-exists-p (expand-file-name name originfiledir)))
|
|
|
|
|
|
|
|
|
|
(setq ans (semanticdb-find-load-unloaded
|
|
|
|
|
(expand-file-name name originfiledir)))
|
|
|
|
|
)
|
|
|
|
|
;; Step 2: System or Project level includes
|
|
|
|
|
;;
|
|
|
|
|
((or
|
|
|
|
|
;; First, if it a system include, we can investigate that tags
|
|
|
|
|
;; dependency file
|
|
|
|
|
(and (semanticdb-find-throttle-active-p 'system)
|
|
|
|
|
|
|
|
|
|
;; Sadly, not all languages make this distinction.
|
|
|
|
|
;;(semantic-tag-include-system-p includetag)
|
|
|
|
|
|
|
|
|
|
;; Here, we get local and system files.
|
|
|
|
|
(setq tmp (semantic-dependency-tag-file includetag))
|
|
|
|
|
)
|
|
|
|
|
;; Second, project files are active, we and we have EDE,
|
|
|
|
|
;; we can find it using the same tool.
|
|
|
|
|
(and (semanticdb-find-throttle-active-p 'project)
|
|
|
|
|
;; Make sure EDE is available, and we have a project
|
|
|
|
|
(featurep 'ede) (ede-current-project originfiledir)
|
|
|
|
|
;; The EDE query is hidden in this call.
|
|
|
|
|
(setq tmp (semantic-dependency-tag-file includetag))
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
(setq ans (semanticdb-find-load-unloaded tmp))
|
|
|
|
|
)
|
|
|
|
|
;; Somewhere in our project hierarchy
|
|
|
|
|
;;
|
|
|
|
|
;; Remember: Roots includes system databases which can create
|
|
|
|
|
;; specialized tables we can search.
|
|
|
|
|
;;
|
|
|
|
|
;; NOTE: Not used if EDE is active!
|
|
|
|
|
((and (semanticdb-find-throttle-active-p 'project)
|
2011-11-20 20:35:27 +01:00
|
|
|
|
;; And don't do this if it is a system include. Not supported by all languages,
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; but when it is, this is a nice fast way to skip this step.
|
|
|
|
|
(not (semantic-tag-include-system-p includetag))
|
|
|
|
|
;; Don't do this if we have an EDE project.
|
|
|
|
|
(not (and (featurep 'ede)
|
|
|
|
|
;; Note: We don't use originfiledir here because
|
|
|
|
|
;; we want to know about the source file we are
|
|
|
|
|
;; starting from.
|
|
|
|
|
(ede-current-project)))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(setq roots (semanticdb-current-database-list))
|
|
|
|
|
|
|
|
|
|
(while (and (not ans) roots)
|
|
|
|
|
(let* ((ref (if (slot-boundp (car roots) 'reference-directory)
|
|
|
|
|
(oref (car roots) reference-directory)))
|
|
|
|
|
(fname (cond ((null ref) nil)
|
|
|
|
|
((file-exists-p (expand-file-name name ref))
|
|
|
|
|
(expand-file-name name ref))
|
|
|
|
|
((file-exists-p (expand-file-name (file-name-nondirectory name) ref))
|
|
|
|
|
(expand-file-name (file-name-nondirectory name) ref)))))
|
|
|
|
|
(when (and ref fname)
|
|
|
|
|
;; There is an actual file. Grab it.
|
|
|
|
|
(setq ans (semanticdb-find-load-unloaded fname)))
|
|
|
|
|
|
|
|
|
|
;; ELSE
|
|
|
|
|
;;
|
|
|
|
|
;; NOTE: We used to look up omniscient databases here, but that
|
|
|
|
|
;; is now handled one layer up.
|
|
|
|
|
;;
|
|
|
|
|
;; Missing: a database that knows where missing files are. Hmm.
|
|
|
|
|
;; perhaps I need an override function for that?
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(setq roots (cdr roots))))
|
|
|
|
|
)
|
|
|
|
|
ans))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Perform interactive tests on the path/search mechanisms.
|
|
|
|
|
;;
|
2009-09-05 23:12:41 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-test-translate-path (&optional arg)
|
|
|
|
|
"Call and output results of `semanticdb-find-translate-path'.
|
|
|
|
|
With ARG non-nil, specify a BRUTISH translation.
|
|
|
|
|
See `semanticdb-find-default-throttle' and `semanticdb-project-roots'
|
|
|
|
|
for details on how this list is derived."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(semantic-fetch-tags)
|
|
|
|
|
(require 'data-debug)
|
|
|
|
|
(let ((start (current-time))
|
|
|
|
|
(p (semanticdb-find-translate-path nil arg))
|
|
|
|
|
(end (current-time))
|
|
|
|
|
)
|
|
|
|
|
(data-debug-new-buffer "*SEMANTICDB FTP ADEBUG*")
|
|
|
|
|
(message "Search of tags took %.2f seconds."
|
|
|
|
|
(semantic-elapsed-time start end))
|
|
|
|
|
|
|
|
|
|
(data-debug-insert-stuff-list p "*")))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-test-translate-path-no-loading (&optional arg)
|
|
|
|
|
"Call and output results of `semanticdb-find-translate-path'.
|
|
|
|
|
With ARG non-nil, specify a BRUTISH translation.
|
|
|
|
|
See `semanticdb-find-default-throttle' and `semanticdb-project-roots'
|
|
|
|
|
for details on how this list is derived."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(semantic-fetch-tags)
|
|
|
|
|
(require 'data-debug)
|
|
|
|
|
(let* ((semanticdb-find-default-throttle
|
2009-09-06 21:22:05 +00:00
|
|
|
|
(if (featurep 'semantic/db-find)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(remq 'unloaded semanticdb-find-default-throttle)
|
|
|
|
|
nil))
|
|
|
|
|
(start (current-time))
|
|
|
|
|
(p (semanticdb-find-translate-path nil arg))
|
|
|
|
|
(end (current-time))
|
|
|
|
|
)
|
|
|
|
|
(data-debug-new-buffer "*SEMANTICDB FTP ADEBUG*")
|
|
|
|
|
(message "Search of tags took %.2f seconds."
|
|
|
|
|
(semantic-elapsed-time start end))
|
|
|
|
|
|
|
|
|
|
(data-debug-insert-stuff-list p "*")))
|
|
|
|
|
|
2009-09-05 23:12:41 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-adebug-lost-includes ()
|
|
|
|
|
"Translate the current path, then display the lost includes.
|
|
|
|
|
Examines the variable `semanticdb-find-lost-includes'."
|
|
|
|
|
(interactive)
|
|
|
|
|
(require 'data-debug)
|
|
|
|
|
(semanticdb-find-translate-path nil nil)
|
|
|
|
|
(let ((lost semanticdb-find-lost-includes)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(if (not lost)
|
|
|
|
|
(message "There are no unknown includes for %s"
|
|
|
|
|
(buffer-name))
|
|
|
|
|
|
|
|
|
|
(data-debug-new-buffer "*SEMANTICDB lost-includes ADEBUG*")
|
2010-04-02 20:42:10 -04:00
|
|
|
|
;; (data-debug-insert-tag-list lost "*")
|
2009-08-28 19:18:35 +00:00
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-adebug-insert-scanned-tag-cons (consdata prefix prebuttontext)
|
|
|
|
|
"Insert a button representing scanned include CONSDATA.
|
2009-10-01 04:54:05 +00:00
|
|
|
|
PREFIX is the text that precedes the button.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
PREBUTTONTEXT is some text between prefix and the overlay button."
|
|
|
|
|
(let* ((start (point))
|
|
|
|
|
(end nil)
|
|
|
|
|
(mode (car consdata))
|
|
|
|
|
(tag (cdr consdata))
|
|
|
|
|
(name (semantic-tag-name tag))
|
|
|
|
|
(file (semantic-tag-file-name tag))
|
|
|
|
|
(str1 (format "%S %s" mode name))
|
|
|
|
|
(str2 (format " : %s" file))
|
|
|
|
|
(tip nil))
|
|
|
|
|
(insert prefix prebuttontext str1)
|
|
|
|
|
(setq end (point))
|
|
|
|
|
(insert str2)
|
|
|
|
|
(put-text-property start end 'face
|
|
|
|
|
(cond ((eq mode 'scanned)
|
|
|
|
|
'font-lock-function-name-face)
|
|
|
|
|
((eq mode 'duplicate)
|
|
|
|
|
'font-lock-comment-face)
|
|
|
|
|
((eq mode 'lost)
|
|
|
|
|
'font-lock-variable-name-face)
|
|
|
|
|
((eq mode 'scanned-no-recurse)
|
|
|
|
|
'font-lock-type-face)))
|
|
|
|
|
(put-text-property start end 'ddebug (cdr consdata))
|
|
|
|
|
(put-text-property start end 'ddebug-indent(length prefix))
|
|
|
|
|
(put-text-property start end 'ddebug-prefix prefix)
|
|
|
|
|
(put-text-property start end 'help-echo tip)
|
|
|
|
|
(put-text-property start end 'ddebug-function
|
|
|
|
|
'data-debug-insert-tag-parts-from-point)
|
|
|
|
|
(insert "\n")
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-adebug-scanned-includes ()
|
|
|
|
|
"Translate the current path, then display the lost includes.
|
|
|
|
|
Examines the variable `semanticdb-find-lost-includes'."
|
|
|
|
|
(interactive)
|
|
|
|
|
(require 'data-debug)
|
|
|
|
|
(semanticdb-find-translate-path nil nil)
|
|
|
|
|
(let ((scanned semanticdb-find-scanned-include-tags)
|
|
|
|
|
(data-debug-thing-alist
|
|
|
|
|
(cons
|
|
|
|
|
'((lambda (thing) (and (consp thing)
|
|
|
|
|
(symbolp (car thing))
|
|
|
|
|
(memq (car thing)
|
|
|
|
|
'(scanned scanned-no-recurse
|
|
|
|
|
lost duplicate))))
|
|
|
|
|
. semanticdb-find-adebug-insert-scanned-tag-cons)
|
|
|
|
|
data-debug-thing-alist))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(if (not scanned)
|
|
|
|
|
(message "There are no includes scanned %s"
|
|
|
|
|
(buffer-name))
|
|
|
|
|
|
|
|
|
|
(data-debug-new-buffer "*SEMANTICDB scanned-includes ADEBUG*")
|
|
|
|
|
(data-debug-insert-stuff-list scanned "*")
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
;;; API Functions
|
|
|
|
|
;;
|
|
|
|
|
;; Once you have a search result, use these routines to operate
|
|
|
|
|
;; on the search results at a higher level
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-strip-find-results (results &optional find-file-match)
|
|
|
|
|
"Strip a semanticdb search RESULTS to exclude objects.
|
|
|
|
|
This makes it appear more like the results of a `semantic-find-' call.
|
|
|
|
|
Optional FIND-FILE-MATCH loads all files associated with RESULTS
|
|
|
|
|
into buffers. This has the side effect of enabling `semantic-tag-buffer' to
|
|
|
|
|
return a value.
|
|
|
|
|
If FIND-FILE-MATCH is 'name, then only the filename is stored
|
|
|
|
|
in each tag instead of loading each file into a buffer.
|
|
|
|
|
If the input RESULTS are not going to be used again, and if
|
|
|
|
|
FIND-FILE-MATCH is nil, you can use `semanticdb-fast-strip-find-results'
|
|
|
|
|
instead."
|
|
|
|
|
(if find-file-match
|
|
|
|
|
;; Load all files associated with RESULTS.
|
|
|
|
|
(let ((tmp results)
|
|
|
|
|
(output nil))
|
|
|
|
|
(while tmp
|
|
|
|
|
(let ((tab (car (car tmp)))
|
|
|
|
|
(tags (cdr (car tmp))))
|
|
|
|
|
(dolist (T tags)
|
2011-11-13 22:27:12 -08:00
|
|
|
|
;; Normalization gives specialty database tables a chance
|
2009-08-28 19:18:35 +00:00
|
|
|
|
;; to convert into a more stable tag format.
|
|
|
|
|
(let* ((norm (semanticdb-normalize-one-tag tab T))
|
|
|
|
|
(ntab (car norm))
|
|
|
|
|
(ntag (cdr norm))
|
|
|
|
|
(nametable ntab))
|
|
|
|
|
|
|
|
|
|
;; If it didn't normalize, use what we had.
|
|
|
|
|
(if (not norm)
|
|
|
|
|
(setq nametable tab)
|
|
|
|
|
(setq output (append output (list ntag))))
|
|
|
|
|
|
|
|
|
|
;; Find-file-match allows a tool to make sure the tag is
|
|
|
|
|
;; 'live', somewhere in a buffer.
|
|
|
|
|
(cond ((eq find-file-match 'name)
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(or (semantic--tag-get-property ntag :filename)
|
|
|
|
|
(let ((f (semanticdb-full-filename nametable)))
|
|
|
|
|
(semantic--tag-put-property ntag :filename f))))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
((and find-file-match ntab)
|
|
|
|
|
(semanticdb-get-buffer ntab))
|
|
|
|
|
)
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
(setq tmp (cdr tmp)))
|
|
|
|
|
output)
|
|
|
|
|
;; @todo - I could use nconc, but I don't know what the caller may do with
|
|
|
|
|
;; RESULTS after this is called. Right now semantic-complete will
|
|
|
|
|
;; recycling the input after calling this routine.
|
|
|
|
|
(apply #'append (mapcar #'cdr results))))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-fast-strip-find-results (results)
|
|
|
|
|
"Destructively strip a semanticdb search RESULTS to exclude objects.
|
|
|
|
|
This makes it appear more like the results of a `semantic-find-' call.
|
|
|
|
|
This is like `semanticdb-strip-find-results', except the input list RESULTS
|
|
|
|
|
will be changed."
|
|
|
|
|
(apply #'nconc (mapcar #'cdr results)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-results-p (resultp)
|
|
|
|
|
"Non-nil if RESULTP is in the form of a semanticdb search result.
|
|
|
|
|
This query only really tests the first entry in the list that is RESULTP,
|
|
|
|
|
but should be good enough for debugging assertions."
|
|
|
|
|
(and (listp resultp)
|
|
|
|
|
(listp (car resultp))
|
|
|
|
|
(semanticdb-abstract-table-child-p (car (car resultp)))
|
|
|
|
|
(or (semantic-tag-p (car (cdr (car resultp))))
|
|
|
|
|
(null (car (cdr (car resultp)))))))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-result-prin1-to-string (result)
|
|
|
|
|
"Presuming RESULT satisfies `semanticdb-find-results-p', provide a short PRIN1 output."
|
|
|
|
|
(if (< (length result) 2)
|
|
|
|
|
(concat "#<FIND RESULT "
|
|
|
|
|
(mapconcat (lambda (a)
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
|
(concat "(" (eieio-object-name (car a) ) " . "
|
2009-08-28 19:18:35 +00:00
|
|
|
|
"#<TAG LIST " (number-to-string (length (cdr a))) ">)"))
|
|
|
|
|
result
|
|
|
|
|
" ")
|
|
|
|
|
">")
|
2011-11-14 15:59:56 -08:00
|
|
|
|
;; Longer results should have an abbreviated form.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(format "#<FIND RESULT %d TAGS in %d FILES>"
|
|
|
|
|
(semanticdb-find-result-length result)
|
|
|
|
|
(length result))))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-result-with-nil-p (resultp)
|
|
|
|
|
"Non-nil of RESULTP is in the form of a semanticdb search result.
|
2010-01-18 05:39:40 +01:00
|
|
|
|
The value nil is valid where a TABLE usually is, but only if the TAG
|
2009-08-28 19:18:35 +00:00
|
|
|
|
results include overlays.
|
|
|
|
|
This query only really tests the first entry in the list that is RESULTP,
|
|
|
|
|
but should be good enough for debugging assertions."
|
|
|
|
|
(and (listp resultp)
|
|
|
|
|
(listp (car resultp))
|
|
|
|
|
(let ((tag-to-test (car-safe (cdr (car resultp)))))
|
|
|
|
|
(or (and (semanticdb-abstract-table-child-p (car (car resultp)))
|
|
|
|
|
(or (semantic-tag-p tag-to-test)
|
|
|
|
|
(null tag-to-test)))
|
|
|
|
|
(and (null (car (car resultp)))
|
|
|
|
|
(or (semantic-tag-with-position-p tag-to-test)
|
|
|
|
|
(null tag-to-test))))
|
|
|
|
|
)))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-result-length (result)
|
|
|
|
|
"Number of tags found in RESULT."
|
|
|
|
|
(let ((count 0))
|
|
|
|
|
(mapc (lambda (onetable)
|
|
|
|
|
(setq count (+ count (1- (length onetable)))))
|
|
|
|
|
result)
|
|
|
|
|
count))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-result-nth (result n)
|
|
|
|
|
"In RESULT, return the Nth search result.
|
|
|
|
|
This is a 0 based search result, with the first match being element 0.
|
|
|
|
|
|
|
|
|
|
The returned value is a cons cell: (TAG . TABLE) where TAG
|
|
|
|
|
is the tag at the Nth position. TABLE is the semanticdb table where
|
|
|
|
|
the TAG was found. Sometimes TABLE can be nil."
|
|
|
|
|
(let ((ans nil)
|
|
|
|
|
(anstable nil))
|
|
|
|
|
;; Loop over each single table hit.
|
|
|
|
|
(while (and (not ans) result)
|
|
|
|
|
;; For each table result, get local length, and modify
|
|
|
|
|
;; N to be that much less.
|
|
|
|
|
(let ((ll (length (cdr (car result))))) ;; local length
|
|
|
|
|
(if (> ll n)
|
|
|
|
|
;; We have a local match.
|
|
|
|
|
(setq ans (nth n (cdr (car result)))
|
|
|
|
|
anstable (car (car result)))
|
|
|
|
|
;; More to go. Decrement N.
|
|
|
|
|
(setq n (- n ll))))
|
|
|
|
|
;; Keep moving.
|
|
|
|
|
(setq result (cdr result)))
|
|
|
|
|
(cons ans anstable)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-result-test (result)
|
|
|
|
|
"Test RESULT by accessing all the tags in the list."
|
|
|
|
|
(if (not (semanticdb-find-results-p result))
|
|
|
|
|
(error "Does not pass `semanticdb-find-results-p.\n"))
|
|
|
|
|
(let ((len (semanticdb-find-result-length result))
|
|
|
|
|
(i 0))
|
|
|
|
|
(while (< i len)
|
|
|
|
|
(let ((tag (semanticdb-find-result-nth result i)))
|
|
|
|
|
(if (not (semantic-tag-p (car tag)))
|
|
|
|
|
(error "%d entry is not a tag" i)))
|
|
|
|
|
(setq i (1+ i)))))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-result-nth-in-buffer (result n)
|
|
|
|
|
"In RESULT, return the Nth search result.
|
|
|
|
|
Like `semanticdb-find-result-nth', except that only the TAG
|
|
|
|
|
is returned, and the buffer it is found it will be made current.
|
|
|
|
|
If the result tag has no position information, the originating buffer
|
|
|
|
|
is still made current."
|
|
|
|
|
(let* ((ret (semanticdb-find-result-nth result n))
|
|
|
|
|
(ans (car ret))
|
|
|
|
|
(anstable (cdr ret)))
|
|
|
|
|
;; If we have a hit, double-check the find-file
|
|
|
|
|
;; entry. If the file must be loaded, then gat that table's
|
|
|
|
|
;; source file into a buffer.
|
|
|
|
|
|
|
|
|
|
(if anstable
|
|
|
|
|
(let ((norm (semanticdb-normalize-one-tag anstable ans)))
|
|
|
|
|
(when norm
|
|
|
|
|
;; The normalized tags can now be found based on that
|
|
|
|
|
;; tags table.
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
(condition-case foo
|
|
|
|
|
(progn
|
|
|
|
|
(semanticdb-set-buffer (car norm))
|
|
|
|
|
;; Now reset ans
|
|
|
|
|
(setq ans (cdr norm)))
|
|
|
|
|
;; Don't error for this case, but don't store
|
|
|
|
|
;; the thing either.
|
|
|
|
|
(no-method-definition nil))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
;; Return the tag.
|
|
|
|
|
ans))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-result-mapc (fcn result)
|
|
|
|
|
"Apply FCN to each element of find RESULT for side-effects only.
|
|
|
|
|
FCN takes two arguments. The first is a TAG, and the
|
2009-10-01 04:54:05 +00:00
|
|
|
|
second is a DB from whence TAG originated.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Returns result."
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-18 22:49:54 -04:00
|
|
|
|
(mapc (lambda (sublst-icky)
|
|
|
|
|
(mapc (lambda (tag-icky)
|
|
|
|
|
(funcall fcn tag-icky (car sublst-icky)))
|
|
|
|
|
(cdr sublst-icky)))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
result)
|
|
|
|
|
result)
|
|
|
|
|
|
|
|
|
|
;;; Search Logging
|
|
|
|
|
;;
|
|
|
|
|
;; Basic logging to see what the search routines are doing.
|
|
|
|
|
(defvar semanticdb-find-log-flag nil
|
|
|
|
|
"Non-nil means log the process of searches.")
|
|
|
|
|
|
|
|
|
|
(defvar semanticdb-find-log-buffer-name "*SemanticDB Find Log*"
|
|
|
|
|
"The name of the logging buffer.")
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-toggle-logging ()
|
2009-10-01 04:54:05 +00:00
|
|
|
|
"Toggle semanticdb logging."
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(setq semanticdb-find-log-flag (null semanticdb-find-log-flag))
|
|
|
|
|
(message "Semanticdb find logging is %sabled"
|
|
|
|
|
(if semanticdb-find-log-flag "en" "dis")))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-reset-log ()
|
|
|
|
|
"Reset the log buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(when semanticdb-find-log-flag
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(erase-buffer)
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-log-move-to-end ()
|
|
|
|
|
"Move to the end of the semantic log."
|
|
|
|
|
(let ((cb (current-buffer))
|
|
|
|
|
(cw (selected-window)))
|
|
|
|
|
(unwind-protect
|
|
|
|
|
(progn
|
|
|
|
|
(set-buffer semanticdb-find-log-buffer-name)
|
|
|
|
|
(if (get-buffer-window (current-buffer) 'visible)
|
|
|
|
|
(select-window (get-buffer-window (current-buffer) 'visible)))
|
|
|
|
|
(goto-char (point-max)))
|
|
|
|
|
(if cw (select-window cw))
|
|
|
|
|
(set-buffer cb))))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-log-new-search (forwhat)
|
|
|
|
|
"Start a new search FORWHAT."
|
|
|
|
|
(when semanticdb-find-log-flag
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer (get-buffer-create semanticdb-find-log-buffer-name)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(insert (format "New Search: %S\n" forwhat))
|
|
|
|
|
)
|
|
|
|
|
(semanticdb-find-log-move-to-end)))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-log-activity (table result)
|
|
|
|
|
"Log that TABLE has been searched and RESULT was found."
|
|
|
|
|
(when semanticdb-find-log-flag
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer semanticdb-find-log-buffer-name
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(insert "Table: " (object-print table)
|
|
|
|
|
" Result: " (int-to-string (length result)) " tags"
|
|
|
|
|
"\n")
|
|
|
|
|
)
|
|
|
|
|
(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
|
|
|
|
|
brutish)
|
|
|
|
|
"Collect all tags returned by FUNCTION over PATH.
|
|
|
|
|
The FUNCTION must take two arguments. The first is TABLE,
|
|
|
|
|
which is a semanticdb table containing tags. The second argument
|
2010-01-18 05:39:40 +01:00
|
|
|
|
to FUNCTION is TAGS. TAGS may be a list of tags. If TAGS is non-nil,
|
|
|
|
|
then FUNCTION should search the TAG list, not through TABLE.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer.
|
|
|
|
|
|
|
|
|
|
Note: You should leave FIND-FILE-MATCH as nil. It is far more
|
|
|
|
|
efficient to take the results from any search and use
|
|
|
|
|
`semanticdb-strip-find-results' instead. This argument is here
|
|
|
|
|
for backward compatibility.
|
|
|
|
|
|
|
|
|
|
If optional argument BRUTISH is non-nil, then ignore include statements,
|
|
|
|
|
and search all tables in this project tree."
|
|
|
|
|
(let (found match)
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; If path is a buffer, set ourselves up in that buffer
|
|
|
|
|
;; so that the override methods work correctly.
|
|
|
|
|
(when (bufferp path) (set-buffer path))
|
|
|
|
|
(if (semanticdb-find-results-p path)
|
|
|
|
|
;; When we get find results, loop over that.
|
|
|
|
|
(dolist (tableandtags path)
|
|
|
|
|
(semantic-throw-on-input 'semantic-find-translate-path)
|
|
|
|
|
;; If FIND-FILE-MATCH is non-nil, skip tables of class
|
|
|
|
|
;; `semanticdb-search-results-table', since those are system
|
|
|
|
|
;; databases and not associated with a file.
|
|
|
|
|
(unless (and find-file-match
|
|
|
|
|
(obj-of-class-p
|
|
|
|
|
(car tableandtags) semanticdb-search-results-table))
|
|
|
|
|
(when (setq match (funcall function
|
|
|
|
|
(car tableandtags) (cdr tableandtags)))
|
|
|
|
|
(when find-file-match
|
|
|
|
|
(save-excursion (semanticdb-set-buffer (car tableandtags))))
|
|
|
|
|
(push (cons (car tableandtags) match) found)))
|
|
|
|
|
)
|
|
|
|
|
;; Only log searches across data bases.
|
|
|
|
|
(semanticdb-find-log-new-search nil)
|
|
|
|
|
;; If we get something else, scan the list of tables resulting
|
|
|
|
|
;; from translating it into a list of objects.
|
|
|
|
|
(dolist (table (semanticdb-find-translate-path path brutish))
|
|
|
|
|
(semantic-throw-on-input 'semantic-find-translate-path)
|
|
|
|
|
;; If FIND-FILE-MATCH is non-nil, skip tables of class
|
|
|
|
|
;; `semanticdb-search-results-table', since those are system
|
|
|
|
|
;; databases and not associated with a file.
|
|
|
|
|
(unless (and find-file-match
|
|
|
|
|
(obj-of-class-p table semanticdb-search-results-table))
|
|
|
|
|
(when (and table (setq match (funcall function table nil)))
|
|
|
|
|
(semanticdb-find-log-activity table match)
|
|
|
|
|
(when find-file-match
|
|
|
|
|
(save-excursion (semanticdb-set-buffer table)))
|
|
|
|
|
(push (cons table match) found))))))
|
|
|
|
|
;; At this point, FOUND has had items pushed onto it.
|
|
|
|
|
;; This means items are being returned in REVERSE order
|
|
|
|
|
;; of the tables searched, so if you just get th CAR, then
|
|
|
|
|
;; too-bad, you may have some system-tag that has no
|
|
|
|
|
;; buffer associated with it.
|
|
|
|
|
|
|
|
|
|
;; It must be reversed.
|
|
|
|
|
(nreverse found)))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-tags-by-name (name &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching NAME on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-by-name-method table name tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-tags-by-name-regexp (regexp &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching REGEXP on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-by-name-regexp-method table regexp tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-tags-for-completion (prefix &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching PREFIX on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-for-completion-method table prefix tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;;###autoload
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-find-tags-by-class (class &optional path find-file-match)
|
|
|
|
|
"Search for all tags of CLASS on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-by-class-method table class tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
|
|
|
|
;;; Deep Searches
|
|
|
|
|
(defun semanticdb-deep-find-tags-by-name (name &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching NAME on PATH.
|
|
|
|
|
Search also in all components of top level tags founds.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-deep-find-tags-by-name-method table name tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-deep-find-tags-by-name-regexp (regexp &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching REGEXP on PATH.
|
|
|
|
|
Search also in all components of top level tags founds.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-deep-find-tags-by-name-regexp-method table regexp tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-deep-find-tags-for-completion (prefix &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching PREFIX on PATH.
|
|
|
|
|
Search also in all components of top level tags founds.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-deep-find-tags-for-completion-method table prefix tags))
|
|
|
|
|
path find-file-match))
|
|
|
|
|
|
|
|
|
|
;;; Brutish Search Routines
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;;
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(defun semanticdb-brute-deep-find-tags-by-name (name &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching NAME on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
The argument BRUTISH will be set so that searching includes all tables
|
|
|
|
|
in the current project.
|
2009-10-01 04:54:05 +00:00
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
2009-08-28 19:18:35 +00:00
|
|
|
|
associated wit that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-deep-find-tags-by-name-method table name tags))
|
|
|
|
|
path find-file-match t))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-brute-deep-find-tags-for-completion (prefix &optional path find-file-match)
|
|
|
|
|
"Search for all tags matching PREFIX on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
The argument BRUTISH will be set so that searching includes all tables
|
|
|
|
|
in the current project.
|
2009-10-01 04:54:05 +00:00
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
2009-08-28 19:18:35 +00:00
|
|
|
|
associated wit that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-deep-find-tags-for-completion-method table prefix tags))
|
|
|
|
|
path find-file-match t))
|
|
|
|
|
|
|
|
|
|
(defun semanticdb-brute-find-tags-by-class (class &optional path find-file-match)
|
|
|
|
|
"Search for all tags of CLASS on PATH.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
The argument BRUTISH will be set so that searching includes all tables
|
|
|
|
|
in the current project.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-by-class-method table class tags))
|
|
|
|
|
path find-file-match t))
|
|
|
|
|
|
|
|
|
|
;;; Specialty Search Routines
|
|
|
|
|
(defun semanticdb-find-tags-external-children-of-type
|
|
|
|
|
(type &optional path find-file-match)
|
|
|
|
|
"Search for all tags defined outside of TYPE w/ TYPE as a parent.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-external-children-of-type-method table type tags))
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 23:11:03 +01:00
|
|
|
|
path find-file-match t))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
|
|
|
|
|
(defun semanticdb-find-tags-subclasses-of-type
|
|
|
|
|
(type &optional path find-file-match)
|
|
|
|
|
"Search for all tags of class type defined that subclass TYPE.
|
|
|
|
|
See `semanticdb-find-translate-path' for details on PATH.
|
|
|
|
|
FIND-FILE-MATCH indicates that any time a match is found, the file
|
|
|
|
|
associated with that tag should be loaded into a buffer."
|
|
|
|
|
(semanticdb-find-tags-collector
|
|
|
|
|
(lambda (table tags)
|
|
|
|
|
(semanticdb-find-tags-subclasses-of-type-method table type tags))
|
|
|
|
|
path find-file-match t))
|
|
|
|
|
|
|
|
|
|
;;; METHODS
|
|
|
|
|
;;
|
|
|
|
|
;; Default methods for semanticdb database and table objects.
|
|
|
|
|
;; Override these with system databases to as new types of back ends.
|
|
|
|
|
|
|
|
|
|
;;; Top level Searches
|
|
|
|
|
(defmethod semanticdb-find-tags-by-name-method ((table semanticdb-abstract-table) name &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags with NAME.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-by-name name (or tags (semanticdb-get-tags table))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-find-tags-by-name-regexp-method ((table semanticdb-abstract-table) regexp &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags matching REGEXP.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-by-name-regexp regexp (or tags (semanticdb-get-tags table))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-find-tags-for-completion-method ((table semanticdb-abstract-table) prefix &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags matching PREFIX.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-for-completion prefix (or tags (semanticdb-get-tags table))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-find-tags-by-class-method ((table semanticdb-abstract-table) class &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags of CLASS.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;; Delegate 'include' to the overridable
|
|
|
|
|
;; `semantic-find-tags-included', which by default will just call
|
|
|
|
|
;; `semantic-find-tags-by-class'.
|
|
|
|
|
(if (eq class 'include)
|
|
|
|
|
(semantic-find-tags-included (or tags (semanticdb-get-tags table)))
|
|
|
|
|
(semantic-find-tags-by-class class (or tags (semanticdb-get-tags table)))))
|
2009-08-28 19:18:35 +00:00
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-find-tags-external-children-of-type-method ((table semanticdb-abstract-table) parent &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags whose parent is the PARENT type.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
2009-09-28 15:15:00 +00:00
|
|
|
|
(require 'semantic/find)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semantic-find-tags-external-children-of-type parent (or tags (semanticdb-get-tags table))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-find-tags-subclasses-of-type-method ((table semanticdb-abstract-table) parent &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags whose parent is the PARENT type.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Returns a table of all matching tags."
|
2009-09-28 15:15:00 +00:00
|
|
|
|
(require 'semantic/find)
|
2009-08-28 19:18:35 +00:00
|
|
|
|
(semantic-find-tags-subclasses-of-type parent (or tags (semanticdb-get-tags table))))
|
|
|
|
|
|
|
|
|
|
;;; Deep Searches
|
|
|
|
|
(defmethod semanticdb-deep-find-tags-by-name-method ((table semanticdb-abstract-table) name &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags with NAME.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Search in all tags in TABLE, and all components of top level tags in
|
|
|
|
|
TABLE.
|
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Return a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-by-name name (semantic-flatten-tags-table (or tags (semanticdb-get-tags table)))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-deep-find-tags-by-name-regexp-method ((table semanticdb-abstract-table) regexp &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags matching REGEXP.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Search in all tags in TABLE, and all components of top level tags in
|
|
|
|
|
TABLE.
|
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Return a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-by-name-regexp regexp (semantic-flatten-tags-table (or tags (semanticdb-get-tags table)))))
|
|
|
|
|
|
|
|
|
|
(defmethod semanticdb-deep-find-tags-for-completion-method ((table semanticdb-abstract-table) prefix &optional tags)
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"In TABLE, find all occurrences of tags matching PREFIX.
|
2009-08-28 19:18:35 +00:00
|
|
|
|
Search in all tags in TABLE, and all components of top level tags in
|
|
|
|
|
TABLE.
|
|
|
|
|
Optional argument TAGS is a list of tags to search.
|
|
|
|
|
Return a table of all matching tags."
|
|
|
|
|
(semantic-find-tags-for-completion prefix (semantic-flatten-tags-table (or tags (semanticdb-get-tags table)))))
|
|
|
|
|
|
|
|
|
|
(provide 'semantic/db-find)
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "loaddefs.el"
|
2009-09-05 01:00:36 +00:00
|
|
|
|
;; generated-autoload-load-name: "semantic/db-find"
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;; End:
|
|
|
|
|
|
cedet/cedet.el (cedet-packages): Bump srecode version.
cedet/data-debug.el: Require `ring' for use of ring-length.
cedet/semantic.el (semantic-repeat-parse-whole-stream): Check
semantic-working-type before updating progress reporter.
cedet/semantic/adebug.el: Fix file header.
cedet/semantic/analyze.el: eval-when-compile semantic/find, for
semantic-find-tags-by-name. Declare semanticdb-strip-find-results and
semanticdb-find-tags-by-name.
cedet/semantic/chart.el: Require semantic/find, semantic/db-mode,
semantic/db-typecache, and semantic/scope.
cedet/semantic/complete.el: Declare
semantic-displayor-focus-abstract-child-p function (needed as the
semantic-displayor-focus-abstract class is defined only after used).
Move semantic-complete-inline-custom-type and
semantic-complete-inline-analyzer-displayor-class variable definitions
up, before they are used, to avoid compiler warning.
Require semantic/decorate, semantic/tag-file, eieio-opt, and
semantic/analyze/complete.
cedet/semantic/ctxt.el: Require semantic/find. Don't
eval-when-compile semantic/db
(semantic-get-local-variables): Use Emacs' built-in progress reporter
instead of working-status-forms.
cedet/semantic/db-debug.el: Require data-debug, semantic/db-mode, and
semantic/format.
cedet/semantic/db-ebrowse.el: Require semantic/db-mode, semantic/find,
semantic/sort, data-debug
(semanticdb-create-database): Require semantic/dep for
semantic-add-system-include.
(semanticdb-table-ebrowse, semanticdb-project-database-ebrowse): Move
class definitions near top of file, before they are used, to avoid
compiler warnings.
(semanticdb-ebrowse-add-tree-to-table): Use split-string.
2009-08-30 21:16:39 +00:00
|
|
|
|
;;; semantic/db-find.el ends here
|