-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathhelp_template.html
More file actions
120 lines (92 loc) · 4.7 KB
/
Copy pathhelp_template.html
File metadata and controls
120 lines (92 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<div class="intro">
<h1>Welcome to Searchfox</h1>
<p>
Searchfox is a source code indexing tool for Mozilla Firefox. It
indexes C++, Rust, and JavaScript code. This is the help page for Searchfox.
You can contribute to Searchfox! Visit
our <a href="https://github.com/mozsearch/mozsearch">GitHub page</a>.
Please send bug reports to
<a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Webtools&component=Searchfox">Bugzilla</a>.
<h2>Query Language</h2>
<p>Searchfox supports both text and file path searches.</p>
<p>Queries entered into the search box use exact string matching, except for <a href="https://firefox-source-docs.mozilla.org/contributing/searchfox/searchfox_search.html#advanced-query-syntax">the advanced syntax</a>.
Case insensitive matching and
<a href="https://github.com/google/re2/wiki/syntax">regular expression matching</a>
can be requested with the check boxes.
See <a href="https://firefox-source-docs.mozilla.org/contributing/searchfox/searchfox_search.html">the documentation</a> for more details.
</p>
<p>Path filtering uses globbing. A path matches even if only a substring
of the path is matched by the glob. Use the <code>^</code>
and <code>$</code> operators to match the beginning or end of the
path. Here are some examples:</p>
<dl>
<dt><code>test</code></dt>
<dd>Find all paths containing the substring "<code>test</code>".
<dt><code>^js/src</code></dt>
<dd>Find all paths starting with <code>js/src</code>.
<dt><code>*.cpp</code></dt>
<dd>Find all paths containing "<code>.cpp</code>".
<dt><code>*.cpp$</code></dt>
<dd>Find all paths ending with "<code>.cpp</code>".
<dt><code>^js/src/*.cpp$</code></dt>
<dd>Find all C++ files in <code>js/src</code>, but not in
subdirectories (i.e., <code>*</code> does not match <code>/</code>).
<dt><code>^js/src/**.cpp$</code></dt>
<dd>Find all C++ files in <code>js/src</code> or in subdirectories
(i.e., <code>**</code> matches <code>/</code>).
<dt><code>^js/src/**.{cpp,h}$</code></dt>
<dd>Find all C++ source or header files in <code>js/src</code> or in subdirectories.
</dl>
<h2>Repositories indexed</h2>
{TABLE}
<h2>Cross-referencing</h2>
<p>
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.
</p>
<div id="file">
<p>
You can see an example by mousing
over “<code><span class="syn_def syn_def" data-symbols="#reviveCrashedTab" data-confidences="["concrete"]">reviveCrashedTab</span></code>” and
clicking. A context menu will open and you can choose to search for all references to the symbol
(definitions, assignments, and uses).
</p>
<p>
In JavaScript code, a second option is sometimes offered. Try mousing
over the same identifier in the following:
“<code>SessionStore.<span class="syn_def" data-symbols="#reviveCrashedTab,SessionStore#reviveCrashedTab" data-confidences="["concrete","concrete"]">reviveCrashedTab</span></code>”.
In this case, you're given the opportunity to search for
<code>SessionStore.reviveCrashedTab</code> (and not
<code>SessionStoreInternal.reviveCrashedTab</code>). Also, since there is only one definition of
<code>SessionStore.reviveCrashedTab</code>, you can jump directly to it.
</p>
</div>
<p>
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.
</p>
<h2>Syntax Highlighting</h2>
<p>
Searchfox uses semantic syntax highlighting.
The color depends on the color scheme, light or dark.
</p>
<ul>
<li>Types are shown in <span class="syn_type">teal (blue-green) or sky-blue</span></li>
<li>Definitions are shown in <span class="syn_def">bold</span></li>
<li>Comments are shown in <span class="syn_comment">dark-red or gray</span></li>
<li>Reserved words are shown in <span class="syn_reserved">blue or orange</span></li>
<li>String are shown in <span class="syn_string">green or light-green</span></li>
<li>Regular expressions are shown in <span class="syn_regex">gray or lavendar</span></li>
<li>Hovering over an identifier <span class="selected" data-symbols>highlights</span> other uses of that <span class="selected" data-symbols>identifier</span></li>
</div>
<script>
var SYM_INFO = {
"#reviveCrashedTab": {"sym":"#reviveCrashedTab","pretty":"reviveCrashedTab"},
"SessionStore#reviveCrashedTab": {"sym":"SessionStore#reviveCrashedTab","pretty":"SessionStore.reviveCrashedTab","jumps":{"def":"browser/components/sessionstore/SessionStore.sys.mjs#708"}},
};
</script>