Welcome to Searchfox
Direct link to the tree
Searchfox is a source code indexing tool for Mozilla Firefox. It indexes C++ and JavaScript code. This is the help page for Searchfox.
Query Language
Queries entered into the search box use exact string matching. No search operators are supported. Case insensitive matching and regular expression matching can be requested with the check boxes. Path filtering uses globbing. A path matches even if only a substring of the path is matched by the glob. Use the^
and $ operators to match the beginning or end of the
path. Here are some examples:
test- Find all paths containing the substring "
test". ^js/src- Find all paths starting with
js/src. *.cpp- Find all paths containing "
.cpp". *.cpp$- Find all paths ending with "
.cpp". ^js/src/*.cpp$- Find all C++ files in
js/src, but not in subdirectories (i.e.,*does not match/). ^js/src/**.cpp$- Find all C++ files in
js/srcor in subdirectories (i.e.,**matches/). ^js/src/**.{cpp,h}$- Find all C++ source or header files in
js/srcor in subdirectories.
Cross-referencing
Once you have arrived at a file, you can mouse over identifiers. If the color of the identifier changes, then clicking on the identifier will open a context menu for cross-referencing identifiers.
reviveCrashedTab” and
clicking. A context menu will open and you can choose to search for all references to the symbol
(definitions, assignments, and uses).
In JavaScript code, a second option is sometimes offered. Try mousing
over the same identifier in the following:
“SessionStore.reviveCrashedTab”.
In this case, you're given the opportunity to search for
SessionStore.reviveCrashedTab (and not
SessionStoreInternal.reviveCrashedTab). Also, since there is only one definition of
SessionStore.reviveCrashedTab, you can jump directly to it.
In some cases there is ambiguity whether to search for C++ or JavaScript implementations of an XPCOM method. Searching for the method from C++ or JavaScript will find the same-language implementations of that method as well as the IDL declaration. Visiting the IDL declaration and searching from there will yield all implementations.
Syntax Highlighting
Searchfox uses semantic syntax highlighting. Types are shown in teal (blue-green). Definitions are shown in bold. Hovering over an identifier highlights other uses of that identifier.Releases
Version 2.0 (May 31, 2016)
- Insta-blame
- Semantic syntax highlighting
Version 1.5 (March 16, 2016)
- IDL support
- XBL support
- Support for C++ variables, enums, and macros
- Indexes generated code
Version 1.0 (January 10, 2016)
- Full text search of entire tree
Indexing is provided via Livegrep. - Cross-referencing JavaScript code
Global variables are indexed as properties. Heuristics allow code likethis.methodto be indexed asClass.methodbased on context. A variety of class patterns are supported, although not ES6 classes yet. Test files are not yet indexed. JavaScript in HTML, XUL, and XBL filed is not yet indexed. - Cross-referencing C++ code
Only functions are indexed. Support for fields and types is coming soon. Methods are indexed by walking up the inheritance hierarchy to find the uppermost declaration of the method (the root). All methods transitively overriding that method are indexed together. With multiple inheritance, there may be more than one root method; in this case, the first one is chosen arbitrarily. This is a bug to be fixed.