150 lines
4.3 KiB
Markdown
150 lines
4.3 KiB
Markdown
(searchfox-context-menu)=
|
|
|
|
# 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.
|
|
|
|
```{image} img/context-menu.png
|
|
:alt: The context menu for symbols
|
|
:class: border
|
|
:width: 428px
|
|
```
|
|
|
|
## 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.
|
|
|
|
```{image} img/context-menu-idl-1.png
|
|
:alt: The context menu for WebIDL definitions
|
|
:class: border
|
|
:width: 687px
|
|
```
|
|
|
|
```{image} img/context-menu-idl-2.png
|
|
:alt: The context menu for WebIDL generated bindings
|
|
:class: border
|
|
:width: 549px
|
|
```
|
|
|
|
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.
|
|
|
|
## Possible symbols
|
|
|
|
For JavaScript properties, if there are small number of matching properties in the WebIDL definitions, "Possible IDL definitions" submenu is shown.
|
|
This menu item is shown only when there are 3 or less numbers of properties with the same name across WebIDL interfaces.
|
|
|
|
```{image} img/context-menu-possible.png
|
|
:alt: The context menu for possible symbols
|
|
:class: border
|
|
:width: 648px
|
|
```
|
|
|
|
Possible IDL definitions
|
|
|
|
: Opens a sub menu for IDL symbols with the property name, which can be the property the code is using.
|
|
|
|
## Macro expansion
|
|
|
|
For preprocessor macros inside C/C++ code, Searchfox can show the expansion result, possibly for each compilation target.
|
|
|
|
```{image} img/context-menu-macro-1.png
|
|
:alt: The context menu for macros
|
|
:class: border
|
|
:width: 673px
|
|
```
|
|
|
|
Expansion on ...
|
|
|
|
: Open a macro expansion popup for given compilation target
|
|
|
|
```{image} img/context-menu-macro-2.png
|
|
:alt: The macro expansion popup
|
|
:class: border
|
|
:width: 636px
|
|
```
|
|
|
|
## Class field layout
|
|
|
|
See {ref}`class field layout <searchfox-field-layout>` document for more details..
|
|
|
|
For C++ classes, Searchfox can show the field layout table for each compilation target.
|
|
|
|
This is behind the alpha feature gate "Semantic Info Queries".
|
|
|
|
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.
|
|
|
|
## Diagramming
|
|
|
|
See {ref}`diagramming <searchfox-diagramming>` document for more details..
|
|
|
|
For functions, classes, methods, and fields, Searchfox can show the diagram of how they're used, called, or related.
|
|
|
|
## 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](https://firefox-source-docs.mozilla.org/js/HazardAnalysis/index.html) 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.
|