Context Menu

Searchfox provides a custom context menu, which is opened on the primary button click (not the secondary button click, which is for the browser’s built-in context menu).

Clicking symbols, such as function name or variable name shows a context menu for the clicked symbols.

The context menu for symbols

Symbols

Go to definition of …

Open the definition of given symbol.

This is shown for the consumers of functions, variables.

Go to declaration of …

Open the forward declaration of given function.

Search for …

Open the search result of given symbol.

The search result will include the definition, declaration, and uses.

Search for the substring …

Open the search result of given substring.

Sticky highlight

Keep applying the highlight on the symbol.

This is useful for example when you’re scrolling through the function while highlighting one of the function arguments.

Structured Analysis

For bindings generated by XPIDL and WebIDL, Searchfox generates structured analysis, which associates these C++ symbol, JavaScript symbol, generated binding, etc.

The context menu for WebIDL definitions The context menu for WebIDL generated bindings
Go to IDL definition …

Open the definition inside the XPIDL/WebIDL file for given interface etc.

Go to definition of IDL C++ binding …

Open the auto-generated binding for given method or attribute.

Search for IDL JS …

Open the search result of given symbol in JS files.

Search for IDL C++ binding …

Open the search result of given auto-generated binding.

Search for IDL …

Open the search result of all symbols related to the IDL definition, including the JS symbol and C++ bindings.

Macro expansion

For preprocessor macros inside C/C++ code, Searchfox can show the expansion result, possibly for each compilation target.

The context menu for macros
Expansion on …

Open a macro expansion popup for given compilation target

The macro expansion popup

Class field layout

For C++ classes, Searchfox can show the field layout table for each compilation target.

This is behind the alpha feature gate “Semantic Info Queries”.

The context menu for classes
Class layout of …

Open the class field layout table of given class.

This item is shown on the classes which has the class field layout information.

Diagrams

For functions, classes, methods, and fields, Searchfox can show the diagram of how they’re used, called, or related.

These items are behind the alpha feature gate “Diagramming”.

Uses diagram of …

Open a diagram that shows how given field is used.

Calls diagram of …

Open a diagram that shows how given function is called.

Class diagram of …

Open a diagram that shows given class and its fields, the hierarchy, etc.

Inheritance diagram of …

Open a diagram that shows the class hierarchy of given class.

Go to use of …

Open the use site of the function shown as the edge in the diagram.

This item is shown for the uses diagram’s edge.

GC analysis

For functions that uses SpiderMonkey JSAPI, Searchfox can show which function can perform GC. See the Static Analysis for Rooting and Heap Write Hazards document for more details how the analysis works.

This is behind the alpha feature gate “Semantic Info Queries”.

Can GC/Cannot GC

If a function can perform GC, “Can GC” item is shown. Clicking this shows a possible call path to the GC.

If a function can never perform GC, “Cannot GC” item is shown.

If the function is not found in the hazard analysis data, neither of these items are shown. This can happen if the function is not covered by the hazard analysis, or if the function symbol differs between GCC and Clang.