context_menu.rst (4488B)
1 .. _searchfox_context_menu: 2 3 ============ 4 Context Menu 5 ============ 6 7 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). 8 9 Clicking symbols, such as function name or variable name shows a context menu for the clicked symbols. 10 11 .. image:: img/context-menu.png 12 :class: border 13 :alt: The context menu for symbols 14 :width: 428px 15 16 Symbols 17 ------- 18 19 Go to definition of ... 20 Open the definition of given symbol. 21 22 This is shown for the consumers of functions, variables. 23 24 Go to declaration of ... 25 Open the forward declaration of given function. 26 27 Search for ... 28 Open the search result of given symbol. 29 30 The search result will include the definition, declaration, and uses. 31 32 Search for the substring ... 33 Open the search result of given substring. 34 35 Sticky highlight 36 Keep applying the highlight on the symbol. 37 38 This is useful for example when you're scrolling through the function while highlighting one of the function arguments. 39 40 Structured Analysis 41 ------------------- 42 43 For bindings generated by XPIDL and WebIDL, Searchfox generates structured analysis, which associates these C++ symbol, JavaScript symbol, generated binding, etc. 44 45 .. image:: img/context-menu-idl-1.png 46 :class: border 47 :alt: The context menu for WebIDL definitions 48 :width: 678px 49 50 .. image:: img/context-menu-idl-2.png 51 :class: border 52 :alt: The context menu for WebIDL generated bindings 53 :width: 538px 54 55 Go to IDL definition ... 56 Open the definition inside the XPIDL/WebIDL file for given interface etc. 57 58 Go to definition of IDL C++ binding ... 59 Open the auto-generated binding for given method or attribute. 60 61 Search for IDL JS ... 62 Open the search result of given symbol in JS files. 63 64 Search for IDL C++ binding ... 65 Open the search result of given auto-generated binding. 66 67 Search for IDL ... 68 Open the search result of all symbols related to the IDL definition, including the JS symbol and C++ bindings. 69 70 Macro expansion 71 --------------- 72 73 For preprocessor macros inside C/C++ code, Searchfox can show the expansion result, possibly for each compilation target. 74 75 .. image:: img/context-menu-macro-1.png 76 :class: border 77 :alt: The context menu for macros 78 :width: 673px 79 80 Expansion on ... 81 Open a macro expansion popup for given compilation target 82 83 .. image:: img/context-menu-macro-2.png 84 :class: border 85 :alt: The macro expansion popup 86 :width: 636px 87 88 Class field layout 89 ------------------ 90 91 See :ref:`class field layout <searchfox_field_layout>` document for more details.. 92 93 For C++ classes, Searchfox can show the field layout table for each compilation target. 94 95 This is behind the alpha feature gate "Semantic Info Queries". 96 97 Class layout of ... 98 Open the class field layout table of given class. 99 100 This item is shown on the classes which has the class field layout information. 101 102 Diagramming 103 ----------- 104 105 See :ref:`diagramming <searchfox_diagramming>` document for more details.. 106 107 For functions, classes, methods, and fields, Searchfox can show the diagram of how they're used, called, or related. 108 109 These items are behind the alpha feature gate "Diagramming". 110 111 Uses diagram of ... 112 Open a diagram that shows how given field is used. 113 114 Calls diagram of ... 115 Open a diagram that shows how given function is called. 116 117 Class diagram of ... 118 Open a diagram that shows given class and its fields, the hierarchy, etc. 119 120 Inheritance diagram of ... 121 Open a diagram that shows the class hierarchy of given class. 122 123 Go to use of ... 124 Open the use site of the function shown as the edge in the diagram. 125 126 This item is shown for the uses diagram's edge. 127 128 GC analysis 129 ----------- 130 131 For functions that uses SpiderMonkey JSAPI, Searchfox can show which function can perform GC. 132 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. 133 134 This is behind the alpha feature gate "Semantic Info Queries". 135 136 Can GC/Cannot GC 137 If a function can perform GC, "Can GC" item is shown. 138 Clicking this shows a possible call path to the GC. 139 140 If a function can never perform GC, "Cannot GC" item is shown. 141 142 If the function is not found in the hazard analysis data, neither of these items are shown. 143 This can happen if the function is not covered by the hazard analysis, or if the function symbol differs between GCC and Clang.