File: db-find.el.html
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:
nil - Take the current buffer, and use its include list
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.
table - Search that table, and its include list.
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
=> Requires a brute search using whole project. (Source files only)
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.
Defined variables (7)
semanticdb-find-default-throttle | The default throttle for ‘semanticdb-find’ routines. |
semanticdb-find-log-buffer-name | The name of the logging buffer. |
semanticdb-find-log-flag | Non-nil means log the process of searches. |
semanticdb-find-lost-includes | Include files that we cannot find associated with this buffer. |
semanticdb-find-scanned-include-tags | All include tags scanned, plus action taken on the tag. |
semanticdb-find-throttle-custom-list | Customization values for semanticdb find throttle. |
semanticdb-implied-include-tags | Include tags implied for all files of a given mode. |